I have created a sample web site that consists of a Master Page with a RadTabStrip and three tabs that link to three content pages ==> PageOne.aspx, PageTwo.aspx, and PageThree.aspx. The Master Page displays the current date/time which changes as each new tab is clicked.
My question, is there a way to have the new pages load without having to reload the Master Page, using Ajax or something. In this simple example, the date / time would not update as each new tab is clicked.
If so, how would I do this. How would I change this.
My question, is there a way to have the new pages load without having to reload the Master Page, using Ajax or something. In this simple example, the date / time would not update as each new tab is clicked.
If so, how would I do this. How would I change this.
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<!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
>Untitled Page</
title
>
<
asp:ContentPlaceHolder
id
=
"head"
runat
=
"server"
>
</
asp:ContentPlaceHolder
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
div
>
<
asp:Label
ID
=
"lblDateTime"
runat
=
"server"
Text
=
"Label"
></
asp:Label
>
</
div
>
<
div
>
<
telerik:RadTabStrip
ID
=
"RadTabStrip"
runat
=
"server"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Page One"
NavigateUrl
=
"PageOne.aspx"
Value
=
"PageOne.aspx"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Page Two"
NavigateUrl
=
"PageTwo.aspx"
Value
=
"PageTwo.aspx"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Page Three"
NavigateUrl
=
"PageThree.aspx"
Value
=
"PageThree.aspx"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
br
/><
br
/>
<
asp:ContentPlaceHolder
id
=
"ContentPlaceHolder1"
runat
=
"server"
>
</
asp:ContentPlaceHolder
>
</
div
>
</
form
>
</
body
>
</
html
>
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="PageOne.aspx.vb" Inherits="PageOne" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
Runat
=
"Server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
b
>Page One</
b
>
</
asp:Content
>
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="PageTwo.aspx.vb" Inherits="PageOne" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
Runat
=
"Server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
b
>Page Two</
b
>
</
asp:Content
>
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="PageThree.aspx.vb" Inherits="PageOne" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
Runat
=
"Server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
b
>Page Three</
b
>
</
asp:Content
>
On Page Load
Public Sub SetCurrentTab()
Dim tab As RadTab = RadTabStrip.FindTabByValue(System.IO.Path.GetFileName(Request.Url.ToString()))
If tab IsNot Nothing Then
tab.Selected = True
End If
End Sub
End Class