Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i have a usercontrol with a textbox control in it, im trying to make a "Text" property for it with both get and set, setting a value isnt a problem but somehow i cant manage to retain the value of the textbox as it postback

 

   <Bindable(True), Category("Appearance"), DefaultValue("")> _
   Public Property Text() As String
       Get
           Dim obj As Object = ViewState("Text")
           If Not (obj Is Nothing) Then
               Return CType(obj, String)
           Else
               Return String.Empty
           End If
       End Get
       Set(ByVal value As String)
           ViewState("Text") = value
       End Set
   End Property

 

doing this wont work if i typed-in anything and submit the form

  MyLabel.Text = MyControl.Text

 

anyone? :confused:

slow down when you need to hurry, stop when you need to move on,

look back when you need to forget, or you might slip and leave sanity

Posted

found the problem, my control in my web form has ReadOnly set to True (was hoping itll still pass the value since HTML form doesnt pass values only when its disabled)

 

any workaround for this?

slow down when you need to hurry, stop when you need to move on,

look back when you need to forget, or you might slip and leave sanity

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...