Hi,
I am trying to get the following scenario working:
Masterpage (containing radajaxmanager) > ContentPage
ContentPage contains 2 divs wrapped in an ajaxified wrapper. First div has a linkbutton that reveals the second div. Second div contains a required field validator.
The initially hidden validator doesn't work (using display:none; not visible=false).
If I take this exact scenario and remove the masterpage, it works fine.
For example - this DOES WORK
This doesn't
I am trying to get the following scenario working:
Masterpage (containing radajaxmanager) > ContentPage
ContentPage contains 2 divs wrapped in an ajaxified wrapper. First div has a linkbutton that reveals the second div. Second div contains a required field validator.
The initially hidden validator doesn't work (using display:none; not visible=false).
If I take this exact scenario and remove the masterpage, it works fine.
For example - this DOES WORK
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2_nomaster.aspx.cs" Inherits="_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"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
/>
<
div
runat
=
"server"
id
=
"ajaxWrapper"
>
<
div
runat
=
"server"
ID
=
"pn0"
>
<
asp:LinkButton
runat
=
"server"
ID
=
"lb1"
OnClick
=
"nextClick1"
>Go</
asp:LinkButton
>
</
div
>
<
div
runat
=
"server"
id
=
"pn1"
style
=
"display:none;"
>
Required field with required validator
<
asp:RequiredFieldValidator
runat
=
"server"
ErrorMessage
=
"*"
ID
=
"req1"
ControlToValidate
=
"tb1"
ValidationGroup
=
"formGroup1"
/>
<
asp:TextBox
runat
=
"server"
ID
=
"tb1"
/>
<
asp:LinkButton
runat
=
"server"
ID
=
"lb2"
OnClick
=
"nextClick2"
CausesValidation
=
"true"
ValidationGroup
=
"formGroup1"
>Next</
asp:LinkButton
>
</
div
>
<
div
runat
=
"server"
ID
=
"pn2"
style
=
"display:none;"
>
Validation passed
</
div
>
</
div
>
____
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RadAjaxManager1.AjaxSettings.AddAjaxSetting(ajaxWrapper, ajaxWrapper);
}
protected void nextClick1(object sender, EventArgs e)
{
pn0.Style["Display"] = "none";
pn1.Style["Display"] = "block";
}
protected void nextClick2(object sender, EventArgs e)
{
pn1.Style["Display"] = "none";
pn2.Style["Display"] = "block";
}
}
This doesn't
<%@ Page Title="" Language="C#" MasterPageFile="~/test.master" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="myPage" %>
<%@ MasterType VirtualPath="~/test.master" %>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
Runat
=
"Server"
>
<
div
runat
=
"server"
id
=
"ajaxWrapper"
>
<
div
runat
=
"server"
ID
=
"pn0"
>
<
asp:LinkButton
runat
=
"server"
ID
=
"LB1"
OnClick
=
"nextClick1"
>Go</
asp:LinkButton
>
</
div
>
<
div
runat
=
"server"
id
=
"pn1"
style
=
"display:none;"
>
Required field with required validator
<
asp:RequiredFieldValidator
runat
=
"server"
ErrorMessage
=
"*"
ID
=
"req1"
ControlToValidate
=
"tb1"
ValidationGroup
=
"formGroup1"
/>
<
asp:TextBox
runat
=
"server"
ID
=
"tb1"
/>
<
asp:LinkButton
runat
=
"server"
ID
=
"LB2"
OnClick
=
"nextClick2"
CausesValidation
=
"true"
ValidationGroup
=
"formGroup1"
>Next</
asp:LinkButton
>
</
div
>
<
div
runat
=
"server"
ID
=
"pn2"
style
=
"display:none;"
>
Validation passed
</
div
>
</
div
>
</
asp:Content
>
______
public partial class myPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RadAjaxManager myAjaxMgr = (RadAjaxManager)this.Page.Master.FindControl("RadAjaxManager1");
myAjaxMgr.AjaxSettings.AddAjaxSetting(ajaxWrapper, ajaxWrapper);
}
protected void nextClick1(object sender, EventArgs e)
{
pn0.Style["Display"] = "none";
pn1.Style["Display"] = "block";
}
protected void nextClick2(object sender, EventArgs e)
{
pn1.Style["Display"] = "none";
pn2.Style["Display"] = "block";
}
}