As I have a very large page,I decide to turn the viewstate off.
The problem I am facing now is that when I bind the Grid on PostBack,the TextBox retains the old value and it does not update to new value.
If I use a HTML input type text as shown below,then it binds correctly,but for ASP.Net TextBox it does not.(If the runat="server" attribute is present then it does not and if I remove that attribute it binds.)
For each items in the category I need to provide quantity,then save it and when I select a different category,the gridview will be build using the items of the selected category.So when I select a different category,the textboxes retains the value of previous items.
Does not bind:
It does bind:
The problem I am facing now is that when I bind the Grid on PostBack,the TextBox retains the old value and it does not update to new value.
If I use a HTML input type text as shown below,then it binds correctly,but for ASP.Net TextBox it does not.(If the runat="server" attribute is present then it does not and if I remove that attribute it binds.)
For each items in the category I need to provide quantity,then save it and when I select a different category,the gridview will be build using the items of the selected category.So when I select a different category,the textboxes retains the value of previous items.
Does not bind:
<asp:TextBox ID="txtBoxQty" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.PhysicalWholeUnitsUsableOnHand")%>'
</asp:TextBox>
It does bind:
<input type="text" value='<%#DataBinder.Eval(Container, "DataItem.PhysicalQuantity")%>' /> Even,when I try to provide text in the ItemDataBound Event,it does not take the new value. Even though,I have disabled the ViewState of the Grid,I am able to access the TextBox Control in the ItemDataBound Event. I am using DataSet to bind the GridView. eg.gridView.DataSource=dataset; I am posting all the value using javascript and WebService and then uisng __doPostBack to do a postback. Kindly let me know if any additional information is required. Also,kindly let me know how to make the above functionality work. Thanks Jignesh