|
Hi,
I have created a calendar user control in ASP.NET. i can use it on any ASP.NET page. I have created a property to select the date format. By default i give the "mm/dd/yyyy" format. I want to add attributes to this property and want to assign it during design time. I have used the following code but nothing is displayed for the control's properties. Can any1 help me out? It's urgent.
<componentmodel.browsable(false), componentmodel.defaultvalue("mm="" dd="" yyyy"),="" componentmodel.description("get="" set="" the="" date="" format.")=""> _
Public Property DateFormat() As String
Get
Return mDateFormat
End Get
Set(ByVal Value As String)
mDateFormat = Value
End Set
End Property
Thanks
Riz
|
|
|
|
|
Do you use VS 2005 or 2003? Basically, the VS 2003 does not support dislaying custom properties of a web user control in the Properties window.
|
|
|
|
|
Thanks for the long awaited reply.....
I am using VS 2003. It's very urgent for me to find a suitable solution to this problem......Is there any other way to do it?
Waiting for ur reply.
Thanks
Riz
|
|
|
|
|
<Bindable(False), Browsable(True), Category("Appearance"), DefaultValue("")> ReadOnly Property Text() As String
That line will show up in the Properties window in VS.NET 2003 for a custom control. Just change the type and name to match yours and the Category is where in the Property window you want it to be placed. You can also disable properties by doing this.
<Browsable(False)> Shadows Property TabIndex() As Integer
Get
End Get
Set(ByVal Value As Integer)
End Set
End Property
You will need to remove and re-add this to the Toolbox and then close and re-open VS.NET in order for everything to show up correctly.
Cleako
|
|
|
|
|
Hi,
thanks for the reply..... Since it is a user created control(web user control)....i am not able to add it to the toolbox. If i try to drag and drop it to the toolbox then it comes as a link in the toolbox.
Can u please tell me how exactly to go about in doing this?
Eagerly waiting for ur response.
Thanks
Riz
|
|
|
|
|
If you created a user control then there is a DLL out there for it correct? I assume you built it into something like a Web User Control library or something of the sort.
Well you right click on the Toolbox and choose Add/Remove Items then browse to that DLL and select it and choose ok. If you created the control correctly then it will show up with a generic icon in the Toolbox at the bottom where you can then drag it onto your web pages.
I did this with 4 or 5 controls myself and did some research on Google and maybe even some questions here and was able to successfully add the controls to the Toolbox as well as expose and control the properties to those controls.
Cleako
|
|
|
|
|
I have created a web user control i.e dateselector.ascx. this i created in a web application. Then i tried using it in an aspx page and used it successfully.I did not make use of Web user control library.
I am totaly new to a user controlso wud require some help.
I want the web control to come in the toolbox. I have used a lot of javascipt and CSS to create a web user control.
Please help me out to solve this problem.
Riz
|
|
|
|
|
Ahhh, I have misunderstood you. I guess I got caught up thinking you made a custom user control such as an overridden textbox or something like that. A user control like you are talking about is just something that can be used commonly throughout your project.
If you want that to be a permanent control that you can use on all projects then you will have to create it in something like the Web Control Library which will then create a DLL that you can import into your toolbox. I think this is what you are wanting to use based on what you have said and it is possible to do you just have to do all the coding in a .VB or .CS class file instead so you would register the script to the control and add the CSS values that it should point to, etc...
I hope this points you in a better direction. Here are some links.
http://www.samspublishing.com/articles/article.asp?p=101748&seqNum=5&rl=1[^]
http://aspalliance.com/cookbook/ViewChapter.aspx?Chapter=3[^]
http://www.codeproject.com/aspnet/composite_controls.asp[^]
Cleako
|
|
|
|
|
Thanks a lot for ur help.
I am still a bit confused abt it. I wanted to mail u my code so that u cud help me out with my problem.
Can u give me ur email id plz?
Thanks
Riz
|
|
|
|
|
In my project i have used the skmmenu control in that menu control the datasource property was disabled why? how can i make it to enable?
|
|
|
|
|
Because you ask for a specific product, so IMHO you should check out their support site[^].
|
|
|
|
|
hello everybody,
i was trying to write the contents of my aspx page to an html file; but i have got an error like this The process cannot access the file 'c:\inetpub\wwwroot\Webexcel\temp.html' because it is being used by another process.""
does anybody know how to fix this.. pls help
thanks in advance
sebastian
|
|
|
|
|
You might want to try a SysInternal tool to check which process is holding the file, then you can think of how to solve the problem. If it is used by the ASP.NET due to the last write then you need to make sure that you release the file as soon as your writing code finishes.
|
|
|
|
|
thanks for your response,but i am creating the file dynamically @ runtime , and immediately after creation i am trying to write in to this. then the error fires ..
any other idea,,.
|
|
|
|
|
Can you post some of your relevant code?
|
|
|
|
|
yeah surely pls find the code below.
'namespaces
Imports System.Net
Imports System.io
' declarations
Dim mwreq As WebRequest
Dim mwresp As WebResponse
Dim sr As StreamReader
Dim strhtml As String
Dim sw As StreamWriter
'inside the button click
mwreq = WebRequest.Create("http://localhost/Webexcel/Default.aspx")
mwresp = mwreq.GetResponse()
sr = New StreamReader(mwresp.GetResponseStream)
strhtml = sr.ReadToEnd
sw = File.CreateText(Server.MapPath("temp.html"))
sw.WriteLine(strhtml)
Response.WriteFile(Server.MapPath("temp.html"))
this is code i have used,
i think you can sort out something.
nb: actually i am in india(time zone GMT + 5.30)
thats why the reply is so late. excuse:
bye
|
|
|
|
|
Sebastian T Xavier wrote: sw = File.CreateText(Server.MapPath("temp.html"))
sw.WriteLine(strhtml)
Here, you open a connection to write to the specified and the stream remains open, not closed yet.
Sebastian T Xavier wrote: Response.WriteFile(Server.MapPath("temp.html"))
Now, you are trying to open a new connection to the file that is being used by the sw stream. So no wonder that you get the error, in this case you either have to close the sw stream first before running the Response.Write method or use the current stream to keep writing to the file.
|
|
|
|
|
but the error occurs in the following line......
sw = File.CreateText(Server.MapPath("temp.html"))
see, can you execute this code segment in your pc.
ok thanks, once again.
|
|
|
|
|
But like I said, you still need to close the sw stream explicitly:
sw.WriteLine(strhtml)
sw.Close()
|
|
|
|
|
yeah its working now . thank you very much
|
|
|
|
|
Hi all,
I am using atlas (ajax) in my webpage,which contain textbox,timer and button.
In timer control I am calling function which change the text in textbox.
while tracing in code new value is assigned to textbox but it is not reflected in textbox.
If I call same function on button click this will assign new value to textbox and get reflected in textbox.
Why this is so.
Can anybody help me to solve this issue.
Regards,
Nagraj.
|
|
|
|
|
What does your code look like? Do you put the timer and textbox in the UpdatePanel control?
|
|
|
|
|
Hai to all,
How to use tabindex property in a table,how it will work if we use this property???Give me solution with an example.
Thanks in advance
kissy
|
|
|
|
|
Kissy16 wrote: Give me solution with an example.
Give me your paycheck.
only two letters away from being an asset
|
|
|
|
|
Thanls for ur repsonse.
Here i am giving my code,Can i display each cell(each cell is a panel)by using tabindex or button_click event???Wat i have to do for this???
in .vb or .aspx wat code i have to give.Is it possible to do so????
asp:Table id="Table2" runat="server" CellPadding="0" CellSpacing="0"
asp:TableRow
asp:TableCell
asp:Panel runat="server" ID="pnl1"
asp:Label runat="server" ID="lblname" text=Name/asp:Label
asp:TextBox runat="server" ID="Textbox5"/asp:TextBox
/asp:Panel/asp:TableCell
asp:TableCell
asp:Panel runat="server" ID="pnl2"
asp:Label runat="server" ID="label1"hello/asp:Label
asp:TextBox runat="server" ID="txtname"/asp:TextBox
/asp:Panel
/asp:TableCell/asp:TableRow/asp:Table
kissy
|
|
|
|