Bound Property problem

T

Tommy

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.ComponentModel
Imports System.Web.UI
<ListBindable(True)> Public Class clsTextBox
Inherits System.Web.UI.WebControls.TextBox
Private _iPricePk As Integer
<Bindable(True), _
NotifyParentProperty(True), _
PersistenceMode(PersistenceMode.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
 
C

Cor Ligthert

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
 
T

Tommy

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
 

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

Top