Saturday, September 20, 2014

How to Retrive Dynamically Generated Textboxes values using JavaScript in Asp.Net

After generating texboxes dynamically as shown in my previous artical(ClickHere to see) it is the time to retrive values of textboxes entered by the user .

In .aspx Page 

In continuation of my previous artical (ClickHere to see) add following html code in your page


 <asp:Button runat="server" ID="btnGetValues" Text="GetValues" OnClick="btnGetValues_Click" />



In .cs Page 

Add following code







In above code "txt1" and "txt2" is the ids of textbox in html code.we are fecting values using From.getValues() and storing it into string array .Complie and execute following figure shows values in string array.











After entering values in textboxes and click "GetValues" floowing figure shows texbox values in strin array.








Now you can loop using "for" and  insert into database.

No comments:

Post a Comment