Property not set on postback

C

Chris Kennedy

I have a very basic control. In the ChildControls I have added a
response.write to write a property I have set. I does it on the first
display but when I press the added button control it doesn't write anything.
Can anyone help?

Namespace nscontrols
Public Class clscontrol : Inherits System.Web.UI.WebControls.WebControl

Implements INamingContainer
Dim btn as new button()
Dim _location as string
Public Property Location as String

Get

Return _location

End Get
Set
_location = Value.ToString()
End Set
End Property


Protected Overrides Sub CreateChildControls()
System.Web.HttpContext.Current.Response.Write(_location)

btn.id = "btn"
btn.text = "test"
Controls.add(btn)
End sub

End class
End Namespace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top