Bound Property problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tommy

    Bound Property problem

    I added a property to the asp.net textbox. It is set as bindable and i am
    able to do so. When i go to read the property the value is not there.

    Somehow it isn't persisted on the server. I tried using ViewState() to set
    and read the property and it did nothing. Here is the code I am using.

    Any help is really appreciated.

    Thanks..
    Tommy

    Imports System.Componen tModel
    Imports System.Web.UI
    <ListBindable(T rue)> Public Class clsTextBox
    Inherits System.Web.UI.W ebControls.Text Box
    Private _iPricePk As Integer
    <Bindable(True) , _
    NotifyParentPro perty(True), _
    PersistenceMode (PersistenceMod e.InnerProperty )> _
    Public Property iPricePK() As Integer
    Get
    Return Me._iPricePk
    End Get
    Set(ByVal Value As Integer)
    Me._iPricePk = Value
    End Set
    End Property
    End Class


  • Cor Ligthert

    #2
    Re: Bound Property problem

    Tommy,

    With the change to answer your question wrong.

    I do not know how you are using this code, however to make it more clear.

    In a webform is nothing persistent on the server. Everything should be
    stored in the viewstate or a session when it is about page information and
    to be retrieved back from the page (viewstate) or server (session).

    The term for that is "a webform is stateless"

    I hope this gives some idea's

    Cor


    Comment

    • Tommy

      #3
      Re: Bound Property problem

      I should have given more details...

      I have to create a page with close to 100 textboxes on it to display a bunch
      of pricing information. They will be grouped so I am using nested repeaters
      (or trying to). I have the textboxes in the repeaters bound to the
      datasource but it seems i have to manage my own updates. I cannot seem to
      get the pre-canned stuff to work. (ds.update). The page will look similar to
      a spreadsheet and all textboxes have to be enabled all the time so using the
      grid is out.

      I thought if I added a property to the textbox and bind it to the primary
      key field it came from i can easily iterate through the controls collection
      of each repeater and do the update like that.

      I'd be very interested in hearing if anyone else has another idea on how to
      accomplish this. It seems asp.net isn't really geared to handle this without
      a bit of creativity.

      Thanks for your answer.

      Tommy


      "Cor Ligthert" <notmyfirstname @planet.nl> wrote in message
      news:%23FXor8%2 3wEHA.2012@TK2M SFTNGP15.phx.gb l...[color=blue]
      > Tommy,
      >
      > With the change to answer your question wrong.
      >
      > I do not know how you are using this code, however to make it more clear.
      >
      > In a webform is nothing persistent on the server. Everything should be
      > stored in the viewstate or a session when it is about page information and
      > to be retrieved back from the page (viewstate) or server (session).
      >
      > The term for that is "a webform is stateless"
      >
      > I hope this gives some idea's
      >
      > Cor
      >
      >[/color]


      Comment

      Working...