I used Javascript on the client to update an ASP text box control that was rendered as an HTML text box.
When I tried to access the value in the text box control on the server, I was not too surprised that the updated Textbox value was not accessible through the regular Text property of the TextBox control, since the state of this value, I assume that probably was saved in the ViewState, and the server did not know that the Client script changed it.
This is the best way to get the updated value using something like:
Request.Form (TextBox.UniqueID)?
I suspect that since the text field is populated in the row of the GridView control and the row was added during the execution of the DataBind, I can get different results than if the TextBox was drawn on the control at design time,
I have confirmed that the value placed in the text field by the client is accessible through this:
Request.Form( CType(Row.Cells.Item(4).FindControl("txtTotal"), TextBox).UniqueID)
but not accessible through this:
CType(Row.Cells.Item(4).FindControl("txtTotal"), TextBox).Text
the latter returns an empty string.
I think these two lines tell the whole story.
It seems ugly to have two properties to get the value of a text field and even ugly when you consider that they return different results.
Is there a better way or is it just the development of the client side in all its glory?
, , - , (, winform) , ASP.NET . - , , , -.