WebUserControl not validation

Posted by Vatcharm under ASP.NET AJAX on 2/16/2010 | Views : 2127 | Status : [Member] | Replies : 1
I have webusercontrol and set Requirevalidate for control webcontrol with in it.
When i click button(it is in webusercontrol) page not validate but it run code behind button.
How should i do.?
===========
<div>
<asp:Label ID="Label1" runat="server" Text="Employer : *" Width="100px"></asp:Label>
<telerik:RadComboBox ID="cboEmployer" runat="server" DataTextField="EmployerName" DataValueField="EmployerID" Skin="Outlook" Width="378px" DataSourceID="SqlDataSourceEmployer" OnSelectedIndexChanged="cboEmployer_SelectedIndexChanged" MarkFirstMatch="True" AllowCustomText="True" AutoCompleteSeparator=";" EmptyMessage="--- Choose Items ---" AutoPostBack="True" >
<HeaderTemplate>
<table style="width:315px; text-align:left; border:1px;">
<tr>
<td>--- Employers ---</td>
</tr>
</table>
</HeaderTemplate>
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="validateEmployer" runat="server" ControlToValidate="cboEmployer" ErrorMessage="**RequiredField" ValidationGroup="GApp" Font-Size="0.9em" Width="91px">
</asp:RequiredFieldValidator>
</div>
<asp:Button ID="btnSave" runat="server" Text="Save" Width="99px" CssClass="xlinkConfirm" ValidationGroup="GApp" OnClick="btnSave_Click" OnClientClick="return getConfirm()"/>

====Code Behide ====
protected void btnSave_Click(object sender, EventArgs e)
{
Page.RegisterStartupScript("myAlert", "<script>alert('Item Insert Successfull');</script>");
}


=====
Thank you.




Responses

Posted by: Vuyiswamb on: 2/16/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
This Should work. can you replace the Telerik Combobox with the normal asp.net dropdownlist and try it again. if it works we will take it from there. I use Telerik all the time i will help you if its the control.

Thank you for posting at dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response