[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Adding a new property to a textbox

=?Utf-8?B?cm9kY2hhcg==?=

2/24/2004 3:51:00 PM

I'm new to asp.net and here's what I'm hoping to do. I want to create a control that uses the textbox control (inherits from?) and adds a new property called "Audit" to it. I then want to use this new textbox on a new webpage and be able to set the Audit property

Can someone point me to an example

Thanks
dave
1 Answer

Sarmad Aljazrawi

2/24/2004 6:53:00 PM

0

here is the code.

If Page.IsPostBack Then

' This would retrieve the property value when the form is
postback
TextBox2.Text = TextBox1.Attributes.Item("Audit")

End If

' This would add the audit property to the textbox
TextBox1.Attributes.Clear()
TextBox1.Attributes.Add("Audit", "1")

Dim myHttpResponse As HttpResponse = Response
Dim myHTMLTextWriter As New HtmlTextWriter(myHttpResponse.Output)

' This is to write the property to the html tag
TextBox1.Attributes.AddAttributes(myHTMLTextWriter)


i've tried this and it worked. hope this would solve your problem.

Regards
--
Sarmad Aljazrawi
B.Sc. Computer Science, MSDBA, MCP
www.aljazrawi.net


"Dave" <anonymous@discussions.microsoft.com> wrote in message
news:2C851622-CC8B-44E3-9BF2-DDC1DE178BAF@microsoft.com...
> I'm new to asp.net and here's what I'm hoping to do. I want to create a
control that uses the textbox control (inherits from?) and adds a new
property called "Audit" to it. I then want to use this new textbox on a new
webpage and be able to set the Audit property.
>
> Can someone point me to an example?
>
> Thanks,
> dave