The code is as follows:
<%@ page language= "C #" codefile= "A.aspx.cs" inherits= "ordermanage_a"%> <%@ Register src= ". /usercontrol/ctrlcalendar.ascx "Tagname=" Ctrlcalendar "tagprefix=" uc1 "%>
Ctrlcalendar.ascx
Copy the code code as follows:
<%@ Control language= "C #" codefile= "CtrlCalendar.ascx.cs" inherits= "Ctrlcalendar"%> <table id= "Table1" style = "height:24px" cellspacing= "0" cellpadding= "0" width= "+" border= "0" > <tr> <td style= "width:81px" > <font face= "song body" > <asp:textbox id= "txtdat" width= "84px" runat= "Server" borderstyle= "Groove" ></asp: textbox></font></td> <td><div id= "Div_imgcanlendar" ><font face= "song Body" ></font></div></td> </tr> </table>
JS gets the value of the ASP. NET Server-side control Label with TextBox RadioButtonList and DropDownList when you do a BS schema project, you often encounter the need to use JS to invoke the value of the ASP. Most of the controls his value can be called by JS to call its Value property to get the values of this control, but there are exceptions. A commonly used label control. His value with JS can not be obtained by the Value property. Label Control JS Gets an instance of Var text= document.getelementbyidx (' Label1 '). InnerText; If so, var text= document.getelementbyidx (' Label1 '). Value; The text is undefined. The value of the textbox can be var text= document.getelementbyidx (' TextBox 1 '). Value; For, RadioButtonList and DropDownList their acquisition way is very different! This is mainly because the HTML elements they generate are not the same. The value of DropDownList is simple: var ddlvalue = document.getelementbyidx (' ctl00_ Contentplaceholder3_ddlfolws '). Value; the value of RadioButtonList is more troublesome: var Value = ""; var Result = document.getelementsbyname (' ctl00$contentplaceholder3$ Rblresult '); for (var i = 0; i < result.length; i++) { if (Result.item (i). Checked) { value = Result.item (i). value; } } If the RadioButtonList control does not have a selection then value is empty! For other controls JS gets the value of the method later in the discussion.
JavaScript Gets the value of the ASP. NET Server-side control