Hi,
I have a RadTabStrip tied to a RadMultiPage. The RadTabStrip has CausesValidation="false" and the ontabclick event is handled. In the event handler, I call Page.Validate() and then inspect Page.IsValid. When the RadMultiPage control has RenderSelectedPageOnly="false", this works as expected. When it has RenderSelectedPageOnly="true", my validator is effectively ignored and Page.IsValid is returned as true.
Example code:
If you run this code and click on the second tab, the ltResult control shows "page is not valid". This is correct as there is a requiredfieldvalidator in the RadPageView. If you change the value of RenderSelectedPageOnly to "true", the ltResult control shows "page is valid", which is incorrect.
In reality, my page has several RadPageView controls with dynamically loaded usercontrols containing a lot of content. I need to be able to set RenderSelectedPageOnly="true" to save on bandwidth and client processing time. Can you tell me how to get this working with RenderSelectedPageOnly="true"?
I am using Version 2010.3.1215.40 of Telerik RadControls for ASP.NET Ajax.
Thanks,
Craig
I have a RadTabStrip tied to a RadMultiPage. The RadTabStrip has CausesValidation="false" and the ontabclick event is handled. In the event handler, I call Page.Validate() and then inspect Page.IsValid. When the RadMultiPage control has RenderSelectedPageOnly="false", this works as expected. When it has RenderSelectedPageOnly="true", my validator is effectively ignored and Page.IsValid is returned as true.
Example code:
<
telerik:RadScriptManager
ID
=
"rsm"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadTabStrip1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTabStrip1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadMultiPage1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"ltResult"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Result: <
asp:Literal
ID
=
"ltResult"
runat
=
"server"
Text
=
""
></
asp:Literal
>
<
br
/>
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
MultiPageID
=
"RadMultiPage1"
ontabclick
=
"RadTabStrip1_TabClick"
SelectedIndex
=
"0"
CausesValidation
=
"false"
>
<
Tabs
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Root RadTab1"
PageViewID
=
"RadPageView1"
Selected
=
"True"
>
</
telerik:RadTab
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Root RadTab2"
PageViewID
=
"RadPageView2"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
</
div
>
<
telerik:RadMultiPage
ID
=
"RadMultiPage1"
Runat
=
"server"
SelectedIndex
=
"0"
RenderSelectedPageOnly
=
"false"
>
<
telerik:RadPageView
ID
=
"RadPageView1"
runat
=
"server"
>
Tab 1 content: <
asp:TextBox
ID
=
"TextBox2"
runat
=
"server"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"rfv_TextBox2"
runat
=
"server"
ControlToValidate
=
"TextBox2"
ErrorMessage
=
"Client Error"
>
</
asp:RequiredFieldValidator
>
</
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"RadPageView2"
runat
=
"server"
>
Tab 2 content:
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
protected
void
RadTabStrip1_TabClick(
object
sender, Telerik.Web.UI.RadTabStripEventArgs e)
{
Page.Validate();
if
(Page.IsValid)
{
ltResult.Text =
"page is valid"
;
}
else
{
ltResult.Text =
"page is not valid"
;
}
}
If you run this code and click on the second tab, the ltResult control shows "page is not valid". This is correct as there is a requiredfieldvalidator in the RadPageView. If you change the value of RenderSelectedPageOnly to "true", the ltResult control shows "page is valid", which is incorrect.
In reality, my page has several RadPageView controls with dynamically loaded usercontrols containing a lot of content. I need to be able to set RenderSelectedPageOnly="true" to save on bandwidth and client processing time. Can you tell me how to get this working with RenderSelectedPageOnly="true"?
I am using Version 2010.3.1215.40 of Telerik RadControls for ASP.NET Ajax.
Thanks,
Craig