Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in my case i use more than form tag in usercontrol and each form has some controls with validations 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">
<label for="txt_Comp_Title" class="control-label">موضوع الشكوى</label>
<input type="text" class="form-control" id="txt_Comp_Title" runat="server" placeholder="موضوع الشكوي" data-error="من فضلك ادخل موضوع الشكوى !!" required>
<div class="help-block">سوف ترسل رسالة إلي البريد برقم الشكوى؛رجاء التحقق من البريد</div>
</div>




<div class="form-group">
<label for="txt_Comp_Details">تفاصيل الشكوى</label>
<textarea class="form-control" id="txt_Comp_Details" runat="server" rows="3"></textarea>
</div>





<div class="form-group">
<label for="txt_Comp_Verification" class="control-label">ادخل الكود المرئي </label>
<div class="form-inline row">
<div class="form-group col-sm-6">
<input type="text" maxlength="20" class="form-control" id="txt_Comp_Verification" runat="server" placeholder="الكود المرئي" required>
</div>
<div class="form-group col-sm-6">

<asp:Image ID="image_Verification0" runat="server" />

<div class="help-block with-errors">

<asp:Label ID="lb_Com_VerError" runat="server" Text="عفواً الكود غير صحيح" Visible="false"></asp:Label>

</div>
</div>
</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>

What I have tried:

i am using aspx page with master page and the masterpage has form runat server
Posted
Comments
F-ES Sitecore 18-Nov-17 7:04am    
You can't nest forms, so remove the form and go from there.
Mohammed Elkholy 18-Nov-17 8:49am    
i nead the form for bootstrap validations
F-ES Sitecore 19-Nov-17 10:46am    
You can keep the outer form on the master page, but you can't put further forms inside that form. You're just going to have to re-work things so that it works with either one server form, or multiple normal forms with no runat=server and none nested inside each other.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900