Jump to content

Asp.net Question For Form Tag


Recommended Posts

Posted

Hi, 

 

I am a basic .net developer .. idi html form in a form tag  asp.net lo ela use cheyali ? 

 

HTML 

 <h1>Find Person</h1>

      <p>
        <form class="group">
          <div class="col _50">
            <label for="FirstName">First Name</label>
            <input name="FirstName" id="FirstName"/>
          </div>
          <div class="col _50">
            <label for="LastName">Last Name</label>
            <input name="LastName" id="LastName"/>
          </div>
</form>
</p>
 
ASP.net lo ila rasanu
 

<h1>Find Person</h1>

<form class="group" runat="server">

<div class="col _50">

<asp:Label AssociatedControlId="FirstName" runat="server">First Name</asp:Label>

<asp:Textbox ID="FirstName" type="text" ClientIDMode="Static" runat="server" />

          </div>

          <div class="col _50">

<asp:Label AssociatedControlId="LastName" runat="server">Last Name</asp:Label>

<asp:Textbox ID="LastName" type="text" ClientIDMode="Static" runat="server" />  

          </div>  
</form>
 
 
Ila rasithe already form tag master page lo undi and cannot be used again ani vasthundi?  Is there any solution for this issue? please help. 
Posted

By default, an asp.net webform should contain only one form .. as ur havin one form in masterpage u can't directly write another form in aspx page...

 

so to bypass this one, u need to write like this...

 

  <form class="group" runat="server"  visible="false">

......

 

</form>

 

cs page : in ur cs page u handle the visibility of form dynamically...

 

Page_Load(object sender,EventArgs e)

{

form2.Visible=true; // or false based on ur requirement....

}

×
×
  • Create New...