Link to home
Start Free TrialLog in
Avatar of nabil saad
nabil saad

asked on

How to use tag<form> in usercontrol and the page has the parent tag<form> See more: C#ASP.NET

in my case i use more than form tag in usercontrol and each form has some controls with validations and the validation works fine but when i try to call codebehind method the button don't fire the event

here is example of my code in user control
<form data-toggle="validator" role="form">


<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>






<div class="form-group">
<label for="DDL_Comp_Baladya">البلدية</label>
<select class="form-control" id="DDL_Comp_Baladya" runat="server">
</select>
</div>


<div class="form-group">
<label for="DDL_Comp_Baladya">الإدارة</label>
<select class="form-control" id="DDL_Comp_Management" runat="server">
</select>
</div>




<div class="form-group">
<label for="txt_Comp_Name" class="control-label">الاسم</label>
<input type="text" class="form-control" id="txt_Comp_Name" runat="server" placeholder="الاسم" data-required="عفواَ من فضلك ادخل الاسم !!" required>
</div>


<div class="form-group has-feedback">
<label for="txt_Comp_Phone" class="control-label">الهاتف</label>

<input type="text" pattern="[0-9]+" title="" maxlength="10" class="form-control" id="txt_Comp_Phone" runat="server" placeholder="الهاتف">
</div>


<div class="form-group has-feedback">
<label for="txt_Comp_ID" class="control-label">السجل المدني / الأقامة</label>

<input type="text" pattern="[0-9]+" title="" maxlength="10" class="form-control" id="txt_Comp_ID" runat="server" placeholder="السجل المدني / الأقامة" required>
</div>


<div class="form-group has-feedback">
<label for="txt_Comp_Mobile" class="control-label">الجوال</label>


<input type="text" pattern="[0-9]+" title="" maxlength="10" class="form-control" id="txt_Comp_Mobile" runat="server" placeholder="الجوال" required>
</div>



<div class="form-group">
<label for="txt_Comp_Email" class="control-label">البريد الالكتروني </label>
<input type="email" class="form-control" id="txt_Comp_Email" runat="server" placeholder="البريدي الالكتروني" data-error="عفواَ ادخل البريد بصورة صحيحة !!" required>
<div class="help-block with-errors"></div>
</div>



<div class="form-group">

<button id="btn_Comp_Submit" class="btn btn-content hvr-bounce-to-left" runat="server" onserverclick="btn_Comp_Submit_Click" fo>إرســال</button>

</div>



</ContentTemplate>
</asp:UpdatePanel>
</form>

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.