Vinit Patel

Posts Tagged ‘Multiple Textboxes at Runtime

Declare a public string in the partial class of the CS file. like

public string str;

now place the str in the aspx file where you need to create the multiple textboxes like this

<%=str%>

now in the button click event using stringbuilder append the code that is used to create the TextBoxes dynamically like this

StringBuilder sb=new  StringBuilder();

sb.Append(“<asp:TextBox id=”xxx” runat=”server”/>”);

like this u can bind number of TextBoxes.

now assign this “sb” to the “str”

str=sb.ToString();

your Textboxes get created in the aspx file.

Advertisements

Calendar

June 2018
M T W T F S S
« Jan    
 123
45678910
11121314151617
18192021222324
252627282930  

Stats Of Blog

  • 7,384 hits

Cluster Map

Advertisements