Reader Level:
ARTICLE

AssociatedControlID Property in ASP.NET

Posted by Abhimanyu K Vatsa Articles | ASP.NET Programming May 10, 2012
In this quick article you will learn how to use the AssociatedControlID property in ASP.NET.
  • 0
  • 0
  • 10502

Introduction

I can see many websites today having no such feature such as when the user clicks on a label control the textbox gets the focus. As you can see in the animated image given below, in the first login set when I clicked on the label control, the text box does not get the focus and the same in another login set, the textbox gets the focus and we can start typing.

image001.gif

Reason: Such websites do not use the AssociatedControlID property.

Use of AssociatedControlID property

We use the AssociatedControlID property to associate a Label control with another server control on a Web form. When a Label control is associated with another server control, its attributes can be used to extend the functionality of the associated control. You can use the Label control as a caption for another control, or you can set the tab index or hot key for an associated control.

When the AssociatedControlID property is set, the Label control renders as an HTML label element, with the for attribute set to the ID property of the associated control. You can set other attributes of the label element using the Label properties. For example, you can use the Text and AccessKey properties to provide the caption and hot key for an associated control.

If you are an ASP.NET guy, you can use:

<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label>
<
asp:TextBox ID="UserName" runat="server"></asp:TextBox>

If you are an HTML guy, you can use:

<label for="UserName" id="UserNameLabel">Username:</label>
<
input name="UserName" type="text" id="UserName" />

Which means that in ASP.NET we use the AssociatedControlID property and in HTML we use the "for" attribute for the same result.

Article Extensions
Contents added by Anand Upadhyay on Mar 14, 2013
Client side validation  using java script



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Top Class IB Tutors</title>
<link href="css/ib-css.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function validate()
{
      if (document.getElementById("<%=Txtname.ClientID%>").value=="")
      {
                 alert("Name Feild can not be blank");
                 document.getElementById("<%=Txtname.ClientID%>").focus();
                 return false;
      }
      if(document.getElementById("<%=Txtemail.ClientID %>").value=="")
      {
                 alert("Email id can not be blank");
                document.getElementById("<%=Txtemail.ClientID %>").focus();
                return false;
      }
     var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
     var emailid=document.getElementById("<%=Txtemail.ClientID %>").value;
     var matchArray = emailid.match(emailPat);
     if (matchArray == null)
    {
               alert("Your email address seems incorrect. Please try again.");
               document.getElementById("<%=Txtemail.ClientID %>").focus();
               return false;
    }
    if (document.getElementById("<%=Txtphone.ClientID%>").value=="")
      {
                 alert("Phone Feild can not be blank");
                 document.getElementById("<%=Txtphone.ClientID%>").focus();
                 return false;
      }
    if (document.getElementById("<%=Txtpass.ClientID%>").value!=document.getElementById("<%=Txtconfirmpass.ClientID%>").value)
      {
                 alert("Can not match password");
                
                 return false;
      }

     return true;
}
</script>
    <style type="text/css">
        .style1
        {
            width: 27%;
        }
        .style2
        {
            height: 5px;
            width: 27%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
   
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#0a77ca">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top" background="images/strip.jpg"><table width="969" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="504" height="148" align="left"><img src="images/logo.jpg" width="504" height="89" /></td>
        <td width="204" align="right"><a href="registration.aspx"><img src="images/registration.jpg" width="92" height="94" style="border:0px" /></a></td>
        <td width="261" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="90" align="right"><img src="images/call-us.jpg" width="216" height="84" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="31%" align="right"><img src="images/email-icon.jpg" width="31" height="24" /></td>
                <td width="69%" align="left" class="blue-content"><strong>&nbsp;&nbsp;<span class="email">ramprhr@gmail.com</span></strong></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="33" align="center" valign="top" background="images/menu-strip.jpg"><table width="969" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="33"><div class="Navigation"> <a href="index.aspx" class="Button">Home</a>
              <div class="Button_im"></div>
          <a href="about_us.aspx" class="Button">About Us </a>
              <div class="Button_im"></div>
          <a href="subject_offered.aspx" class="Button">Subjects Offered</a>
              <div class="Button_im"></div>
          <a href="ib_portfolio.aspx" class="Button">IB Portfolio / Essay</a>
              <div class="Button_im"></div>
          <a href="tutors.aspx" class="Button">About Our Tutors</a>
              <div class="Button_im"></div>
          <a href="contact_us.aspx" class="Button">Contact us </a></div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center"><table width="969" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="8" colspan="3"></td>
      </tr>
      <tr>
        <td width="245" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="blue-strip"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="4%" height="31">&nbsp;</td>
                <td width="91%" align="center" class="heading1">Subjects Offered<br /></td>
                <td width="5%">&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#f5f5f5"><table width="229" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="6"></td>
              </tr>
              <tr>
                <td><img src="images/white-top.jpg" width="229" height="11" /></td>
              </tr>
              <tr>
                <td align="left" valign="top" bgcolor="#FFFFFF"><asp:DataList ID="DataList1" runat="server">
                    <ItemTemplate>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="17%" align="center"><img src="images/arrow.jpg" width="9" height="10" /></td>
                        <td width="83%" height="30" align="left" class="tab"><a href="subject_offered.aspx#<%# DataBinder.Eval(Container.DataItem, "id")%>" class="tab"><%# DataBinder.Eval(Container.DataItem, "title")%></a> </td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td align="center"><img src="images/dot.jpg" width="211" height="1" /></td>
                  </tr>
                  <html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head2" runat="server">
    <title></title>
<link href="css/ib-css.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    function validate() {
        if (document.getElementById("<%=Txtname.ClientID%>").value == "") {
            alert("Name Feild can not be blank");
            document.getElementById("<%=Txtname.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=Txtemail.ClientID %>").value == "") {
            alert("Email id can not be blank");
            document.getElementById("<%=Txtemail.ClientID %>").focus();
            return false;
        }
        var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
        var emailid = document.getElementById("<%=Txtemail.ClientID %>").value;
        var matchArray = emailid.match(emailPat);
        if (matchArray == null) {
            alert("Your email address seems incorrect. Please try again.");
            document.getElementById("<%=Txtemail.ClientID %>").focus();
            return false;
        }
        if (document.getElementById("<%=Txtphone.ClientID%>").value == "") {
            alert("Phone Feild can not be blank");
            document.getElementById("<%=Txtphone.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=Txtpass.ClientID%>").value != document.getElementById("<%=Txtconfirmpass.ClientID%>").value) {
            alert("Can not match password");

            return false;
        }

        return true;
    }
</script>
    <style type="text/css">
        .style1
        {
            width: 27%;
        }
        .style2
        {
            height: 5px;
            width: 27%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
   
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#0a77ca">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top" background="images/strip.jpg"><table width="969" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="504" height="148" align="left"><img src="images/logo.jpg" width="504" height="89" /></td>
        <td width="204" align="right"><a href="registration.aspx"><img src="images/registration.jpg" width="92" height="94" style="border:0px" /></a></td>
        <td width="261" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="90" align="right"><img src="images/call-us.jpg" width="216" height="84" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="31%" align="right"><img src="images/email-icon.jpg" width="31" height="24" /></td>
                <td width="69%" align="left" class="blue-content"><strong>&nbsp;&nbsp;<span class="email">ramprhr@gmail.com</span></strong></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="33" align="center" valign="top" background="images/menu-strip.jpg"><table width="969" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="33"><div class="Navigation"> <a href="index.aspx" class="Button">Home</a>
              <div class="Button_im"></div>
          <a href="about_us.aspx" class="Button">About Us </a>
              <div class="Button_im"></div>
          <a href="subject_offered.aspx" class="Button">Subjects Offered</a>
              <div class="Button_im"></div>
          <a href="ib_portfolio.aspx" class="Button">IB Portfolio / Essay</a>
              <div class="Button_im"></div>
          <a href="tutors.aspx" class="Button">About Our Tutors</a>
              <div class="Button_im"></div>
          <a href="contact_us.aspx" class="Button">Contact us </a></div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center"><table width="969" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="8" colspan="3"></td>
      </tr>
      <tr>
        <td width="245" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="blue-strip"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="4%" height="31">&nbsp;</td>
                <td width="91%" align="center" class="heading1">Subjects Offered<br /></td>
                <td width="5%">&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#f5f5f5"><table width="229" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="6"></td>
              </tr>
              <tr>
                <td><img src="images/white-top.jpg" width="229" height="11" /></td>
              </tr>
              <tr>
                <td align="left" valign="top" bgcolor="#FFFFFF"><asp:DataList ID="DataList1" runat="server">
                    <ItemTemplate>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="17%" align="center"><img src="images/arrow.jpg" width="9" height="10" /></td>
                        <td width="83%" height="30" align="left" class="tab"><a href="subject_offered.aspx#<%# DataBinder.Eval(Container.DataItem, "id")%>" class="tab"><%# DataBinder.Eval(Container.DataItem, "title")%></a> </td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td align="center"><img src="images/dot.jpg" width="211" height="1" /></td>
                  </tr>
                 
                 
                </table>
                    </ItemTemplate>
                    </asp:DataList>                  </td>
              </tr>
              <tr>
                <td><img src="images/white-botom.jpg" width="229" height="11" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#f5f5f5">&nbsp;</td>
          </tr>
          <tr>
            <td align="center" bgcolor="#f5f5f5"><a href="asignment.aspx"> <img src="images/submit-your.jpg" style="border:0px;" /></a></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#f5f5f5">&nbsp;</td>
          </tr>
        </table></td>
        <td width="14" align="left" valign="top">&nbsp;</td>
        <td width="710" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="top"><img src="images/about-banner.jpg" width="709" height="167" /></td>
          </tr>
          <tr>
            <td height="10" align="left" valign="top"></td>
          </tr>
         
         
          <tr><td valign="top" class="heading">Registration Form</td></tr>
          <tr><td valign="top" style="height:25px"></td></tr>
          <tr><td valign="top">
              <asp:Label ID="Label1" runat="server"></asp:Label></td></tr>
          <tr><td valign="top">
          <table width="100%" cellpadding="0" cellspacing="0">
         
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Email :</b></td>
          <td>
              <asp:TextBox ID="Txtemail" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Password :</b></td>
          <td>
              <asp:TextBox ID="Txtpass" runat="server"
                  style="width:160px;"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Confirm Password :</b></td>
          <td>
              <asp:TextBox ID="Txtconfirmpass" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Full Name :</b></td>
          <td>
              <asp:TextBox ID="Txtname" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Gender :</b></td>
          <td>
              <asp:RadioButton ID="male" runat="server" Text="Male" />
              <asp:RadioButton ID="female"
                  runat="server" Text="Female" />
              </td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Grade :</b></td>
          <td>
              <asp:DropDownList ID="DropDownList1" runat="server">
              <asp:ListItem>-Select Grade-</asp:ListItem>
              <asp:ListItem>5</asp:ListItem>
              <asp:ListItem>6</asp:ListItem>
              <asp:ListItem>7</asp:ListItem>
              <asp:ListItem>8</asp:ListItem>
              <asp:ListItem>9</asp:ListItem>
              <asp:ListItem>10</asp:ListItem>
              <asp:ListItem>11</asp:ListItem>
              <asp:ListItem>12</asp:ListItem>
              <asp:ListItem>Upto College Level</asp:ListItem>
              <asp:ListItem>College Level</asp:ListItem>
              <asp:ListItem>University Level</asp:ListItem>
              </asp:DropDownList>
              </td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Subject :</b></td>
          <td>
              <asp:TextBox ID="Txtsubject" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Phone :</b></td>
          <td>
              <asp:TextBox ID="Txtphone" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Address :</b></td>
          <td>
              <asp:TextBox ID="Txtaddress" runat="server" TextMode="MultiLine" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>City :</b></td>
          <td>
              <asp:TextBox ID="Txtcity" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>State :</b></td>
          <td>
              <asp:TextBox ID="Txtstate" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Country :</b></td>
          <td>
              <asp:TextBox ID="Txtcountry" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Query :</b></td>
          <td>
              <asp:TextBox ID="Txtquery" runat="server" style="width:160px"
                  TextMode="MultiLine"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"></td>
          <td>
              <asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" OnClientClick=" return validate()" />
              </td>
          </tr>
          <tr><td class="style2"></td></tr>
          </table>
         
          </td></tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="3" valign="top" class="footer"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="2%">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
            <td width="1%">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td width="51%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="41" align="left" class="heading1">Testimonials</td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top" class="testimonials"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="24%" height="115">&nbsp;</td>
                        <td width="42%" valign="top" class="blue-content"><marquee direction="up" scrollamount="2" style="height:180px">
                          <asp:DataList ID="DataList3" runat="server">
                          <ItemTemplate>
                          <div align="justify"><b><%# DataBinder.Eval(Container.DataItem, "title")%></b></div>
                          <div align="justify"><%# DataBinder.Eval(Container.DataItem, "content")%></div>
                          </ItemTemplate>
                          </asp:DataList></marquee></td>
                        <td width="34%">&nbsp;</td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
            <td width="46%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="4%" height="31">&nbsp;</td>
                <td width="94%" align="left" class="heading1">Post Your Question</td>
                <td width="2%">&nbsp;</td>
              </tr>
              <tr>
                <td height="33">&nbsp;</td>
                <td align="left"><iframe src="testimonial.html" frameborder="0" scrolling="no" width="400px" height="200px"></iframe></td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="61%" align="left" class="blue-content"><a href="index.aspx" style="color:#4371AC"> Home |</a> <a href="about_us.aspx" style="color:#4371AC">About Us |</a> <a href="subject_offered.aspx" style="color:#4371AC">Subjects Offered  |</a> <a href="ib_portfolio.aspx" style="color:#4371AC">IB Portfolio |</a> <a href="tutors.aspx" style="color:#4371AC">About Our Tutors |</a> <a href="contact_us.aspx" style="color:#4371AC">Contact Us</a> <br>
              <span style="color:#4371AC"> Copyright 2011 All Right Reserved</span></td>
            <td width="39%" align="right"><a href="www.geneticinfogain.aspx" target="_blank"><%--<img src="images/gt-logo.png" width="153" height="47" style="border:0px;" />--%></a> </td>
          </tr>
         
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
    </form>
   
</body>
</html>
                 
                </table>
                    </ItemTemplate>
                    </asp:DataList>                  </td>
              </tr>
              <tr>
                <td><img src="images/white-botom.jpg" width="229" height="11" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#f5f5f5">&nbsp;</td>
          </tr>
          <tr>
            <td align="center" bgcolor="#f5f5f5"><a href="asignment.aspx"> <img src="images/submit-your.jpg" style="border:0px;" /></a></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#f5f5f5">&nbsp;</td>
          </tr>
        </table></td>
        <td width="14" align="left" valign="top">&nbsp;</td>
        <td width="710" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="top"><img src="images/about-banner.jpg" width="709" height="167" /></td>
          </tr>
          <tr>
            <td height="10" align="left" valign="top"></td>
          </tr>
         
         
          <tr><td valign="top" class="heading">Registration Form</td></tr>
          <tr><td valign="top" style="height:25px"></td></tr>
          <tr><td valign="top">
              <asp:Label ID="Label1" runat="server"></asp:Label></td></tr>
          <tr><td valign="top">
          <table width="100%" cellpadding="0" cellspacing="0">
         
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Email :</b></td>
          <td>
              <asp:TextBox ID="Txtemail" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Password :</b></td>
          <td>
              <asp:TextBox ID="Txtpass" runat="server"
                  style="width:160px;"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Confirm Password :</b></td>
          <td>
              <asp:TextBox ID="Txtconfirmpass" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Full Name :</b></td>
          <td>
              <asp:TextBox ID="Txtname" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Gender :</b></td>
          <td>
              <asp:RadioButton ID="male" runat="server" Text="Male" />
              <asp:RadioButton ID="female"
                  runat="server" Text="Female" />
              </td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Grade :</b></td>
          <td>
              <asp:DropDownList ID="DropDownList1" runat="server">
              <asp:ListItem>-Select Grade-</asp:ListItem>
              <asp:ListItem>5</asp:ListItem>
              <asp:ListItem>6</asp:ListItem>
              <asp:ListItem>7</asp:ListItem>
              <asp:ListItem>8</asp:ListItem>
              <asp:ListItem>9</asp:ListItem>
              <asp:ListItem>10</asp:ListItem>
              <asp:ListItem>11</asp:ListItem>
              <asp:ListItem>12</asp:ListItem>
              <asp:ListItem>Upto College Level</asp:ListItem>
              <asp:ListItem>College Level</asp:ListItem>
              <asp:ListItem>University Level</asp:ListItem>
              </asp:DropDownList>
              </td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"
                  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Subject :</b></td>
          <td>
              <asp:TextBox ID="Txtsubject" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Phone :</b></td>
          <td>
              <asp:TextBox ID="Txtphone" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Address :</b></td>
          <td>
              <asp:TextBox ID="Txtaddress" runat="server" TextMode="MultiLine" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>City :</b></td>
          <td>
              <asp:TextBox ID="Txtcity" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>State :</b></td>
          <td>
              <asp:TextBox ID="Txtstate" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Country :</b></td>
          <td>
              <asp:TextBox ID="Txtcountry" runat="server" style="width:160px"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"><b>Query :</b></td>
          <td>
              <asp:TextBox ID="Txtquery" runat="server" style="width:160px"
                  TextMode="MultiLine"></asp:TextBox></td>
          </tr>
          <tr><td class="style2"></td></tr>
          <tr>
          <td align="left"  style="padding-left:50px; font-size:14px; color:#606060; font-family:Arial"
                  class="style1"></td>
          <td>
              <asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" OnClientClick=" return validate()" />
              </td>
          </tr>
          <tr><td class="style2"></td></tr>
          </table>
         
          </td></tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="3" valign="top" class="footer"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="2%">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
            <td width="1%">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td width="51%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="41" align="left" class="heading1">Testimonials</td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top" class="testimonials"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="24%" height="115">&nbsp;</td>
                        <td width="42%" valign="top" class="blue-content"><marquee direction="up" scrollamount="2" style="height:180px">
                          <asp:DataList ID="DataList3" runat="server">
                          <ItemTemplate>
                          <div align="justify"><b><%# DataBinder.Eval(Container.DataItem, "title")%></b></div>
                          <div align="justify"><%# DataBinder.Eval(Container.DataItem, "content")%></div>
                          </ItemTemplate>
                          </asp:DataList></marquee></td>
                        <td width="34%">&nbsp;</td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
            <td width="46%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="4%" height="31">&nbsp;</td>
                <td width="94%" align="left" class="heading1">Post Your Question</td>
                <td width="2%">&nbsp;</td>
              </tr>
              <tr>
                <td height="33">&nbsp;</td>
                <td align="left"><iframe src="testimonial.html" frameborder="0" scrolling="no" width="400px" height="200px"></iframe></td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="61%" align="left" class="blue-content"><a href="index.aspx" style="color:#4371AC"> Home |</a>  <a href="contact_us.aspx" style="color:#4371AC">Contact Us</a> <br>
              <span style="color:#4371AC"> </span></td>
            <td width="39%" align="right"><a href="" target="_blank"></a> </td>
          </tr>
         
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
    </form>
   
</body>
</html>
COMMENT USING

Trending up