G
goscottie
How do I prevent field validator which resides outside of UpdatePanel
from firing off? The label will update correctly without
RequiredFieldValidator via Ajax. TIA.
Code below....
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></
asp:TextBox><asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Required" ControlToValidate="TextBox1">*</
asp:RequiredFieldValidator>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></
asp:Label><br />
<asp:Button ID="Button1"
runat="server" Text="Button" onclick="Button1_Click1" /</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
--==========
Code behind
protected void Button1_Click1(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}
from firing off? The label will update correctly without
RequiredFieldValidator via Ajax. TIA.
Code below....
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></
asp:TextBox><asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Required" ControlToValidate="TextBox1">*</
asp:RequiredFieldValidator>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></
asp:Label><br />
<asp:Button ID="Button1"
runat="server" Text="Button" onclick="Button1_Click1" /</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
--==========
Code behind
protected void Button1_Click1(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}