c# - Create a dynamic template of an asp.net page -


what doing is, took 1 asp.net web page, in took 2 dropdown boxes, 1 control name , other 1 control type.

in control type select textbox in dropdown's selectedindexchanged method. wrote code below:

protected void dropdownlist2_selectedindexchanged(object sender, eventargs e) {      cname = ddlcontrolname.text;      ctype = ddlcontroltype.text;      //if (!ispostback)      //{          if (ctype == "textbox")          {             cnamec = "txt" + cname;             lblmsg.text = cnamec;             ds.append(cnamec);              //viewstate["vs"] = cnamec+".text";              string c = "lbl" + cname;              //control c = parsecontrol("<asp:textbox id="+"'"+cnamec+"'"+ "runat='server'/><br/>");               control c = parsecontrol("<asp:textbox id='" + cnamec + "' runat='server'/><br/>");               //  control c = parsecontrol("<asp:textbox id='" + txtname +"' runat='server'/><br/>");               plhtemplate.controls.add(c);               control t = parsecontrol("<asp:label id='" + c + "' runat='server' text= '" + cname + "' font-size='large' forecolor='#003366' /><br/>");               plhlable.controls.add(t);          //}      } } 

in textbox id created dynamically, based on control name example: control name clientname textbox id txtclientname. problem is, can't use id in form, textbox value in javascript never catch id.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -