Hi,
I have an asp:textbox conteined in a asp:repeater that take its value from a db's table:
<code>
<ItemTemplate>
.... <asp:TextBox ID="Textbox1" Runat=server Text='<%#Container.DataItem("value")%>'>
......
</ItemTemplate>
</code>
The idea is that the client sees the value conteined and if he wants to cange it he can do it by typing the new value into the textbox first and then pushing the button "updete".
The problem is that when it goes into the Sub UpDate by pushing the button:
<code>
Sub UpDate(sender As Object, e As EventArgs)
.....
Dim address
address= Textbox1.text
'"tumtumtum"customers.ItemTemplate()
......
End Sub
</code>
it gives me the following error:
"Object reference not set to an instance of an object.
....
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
...
Line 52: address= Textbox1.text
......."
It seems that if I want to update the value by typing it into an asp:textbox conteined in an asp:repeater I have not to write address=Textbox1.text becouse the asp:textbox is conteined in en asp:Repeater. Is it right?
Can sombody tell me how can write it and if this way is the correct way to update values?
thanks a lot,
Valerio
I have an asp:textbox conteined in a asp:repeater that take its value from a db's table:
<code>
<ItemTemplate>
.... <asp:TextBox ID="Textbox1" Runat=server Text='<%#Container.DataItem("value")%>'>
......
</ItemTemplate>
</code>
The idea is that the client sees the value conteined and if he wants to cange it he can do it by typing the new value into the textbox first and then pushing the button "updete".
The problem is that when it goes into the Sub UpDate by pushing the button:
<code>
Sub UpDate(sender As Object, e As EventArgs)
.....
Dim address
address= Textbox1.text
'"tumtumtum"customers.ItemTemplate()
......
End Sub
</code>
it gives me the following error:
"Object reference not set to an instance of an object.
....
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
...
Line 52: address= Textbox1.text
......."
It seems that if I want to update the value by typing it into an asp:textbox conteined in an asp:repeater I have not to write address=Textbox1.text becouse the asp:textbox is conteined in en asp:Repeater. Is it right?
Can sombody tell me how can write it and if this way is the correct way to update values?
thanks a lot,
Valerio