Posts

Showing posts from February, 2014

Get value of dynamic textbox when button click

                               Get value of  dynamic textbox  when button click <html> <head id = "Head1" runat = "server" > <title> sample </title> <script runat = "server" > protected void Page_Load ( object sender , EventArgs e ) { if (! IsPostBack ) { var lstTextBox = new List < TextBox >(); for ( int i = 0 ; i <= 4 ; i ++) { TextBox txtbx = new TextBox (); txtbx . ID = string . Format ( "txtbx{0}" , i ); // txtbx.AutoPostBack = true; lstTextBox . Add ( txtbx ); txtbx . Text = "initial value" + i . ToString (); Panel1 . Controls . Add ( txtbx ); } Session [ "ls...