c# - Can not change value in textbox when edit -



c# - Can not change value in textbox when edit -

in page-load method set value textbox this

txtid.value = pro.getid().tostring(); txtmodel.text = pro.getmodal(); txtname.text = pro.getname(); cbcategory.selectedvalue = pro.getcategory(); txtprice.text = pro.getprice().tostring(); txtdescription.text = pro.getdescription();

and when submit edit product value

string id = txtid.value.tostring(); string modal = txtmodel.text.tostring(); int category = int.parse(cbcategory.selectedvalue); string name = txtname.text.tostring(); string description = txtdescription.text.tostring();

and seek alter value different original when bug it's still maintain original value , save database.

where setting these values on page load may reason. set within if (!page.ispostback) follows

if (!page.ispostback) { txtid.value = pro.getid().tostring(); txtmodel.text = pro.getmodal(); txtname.text = pro.getname(); cbcategory.selectedvalue = pro.getcategory(); txtprice.text = pro.getprice().tostring(); txtdescription.text = pro.getdescription(); }

and why using txtid.value hidden-field?

c# asp.net

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -