c# - How to retrieve text from text box after postback? -


I retrieve values ​​there from code behind an attempt to submit a post to which the text box when I assume all Are empty

My submit button:

  & lt; ICCM: ICCMImageButton id = "btnSubmit" runat = "server" meta: resourcekey = "btnResSubmit" onclick = "btnSubmit_Click" PostBack = "true" style = "float: right; padding-right: 5px;" Tabindex = "23" / & Gt;  

C # code behind:

  protected void btnSubmit_Click (object sender, EventArgs e) {// Code objCmd.Parameters.Add ( "@ FirstName ", SqlDbType.NVarChar, 50) .Value = txtFName.Text.ToString (); // more code}  

page loads:

  btnSubmit.ClickScript = "if (ValidatePage () == false) {return false}; this. disabled = true document.getElementById (this.getAttribute ( 'ControlID') + 'text') innerHTML = '' + Resources.ICCMCPortal.Submitting + '';. ";  

OnInt:

  btnSubmit.Page = this.Page;  

The value of the text is always "" until I place the text box in the page load first, regardless of the text, if I made any changes to it.

set you inside the values ​​text box here:

  protected void Page_Load (Object Sender, EventArgs e) {if (IsPostBack) {SetTextboxValues ​​(); }}  

will not reset to PostBit this way.


Comments