Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello,

In my project i m using an update panel,which is working fine but the problem is with my validation which is under the update panel.When i m not giving any data in my text boxes and submitting the form the validation is not working.

Please suggest me some solution and remember i can't add any DDL into my application.

Thanks in Advance
Syed
Posted
Updated 17-Jul-14 23:00pm
v2
Comments
krishnaMurali 18-Jul-14 3:14am    
are your validation controls also under updatepanel? if not, they should be..
and also mention (Page.IsValid) before saving the values
Syed.net 18-Jul-14 5:00am    
yes it is under the panel.

 
Share this answer
 
please check your code once again.. below is working
XML
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>


XML
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:RequiredFieldValidator runat="server" ID="rfvtxt1" ControlToValidate="TextBox1" ErrorMessage="Required"></asp:RequiredFieldValidator>
      <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
      <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
          </ContentTemplate>
          </asp:UpdatePanel>

and code behind
C#
protected void Button1_Click(object sender, EventArgs e)
   {
       Label1.Text = "the value is:" + TextBox1.Text; //any code
   }
 
Share this answer
 
v2

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