Share via


SPMobileUrlRedirection.PageFileName Property

Gets or sets the file name of the page to which the mobile device should be redirected.

Namespace:  Microsoft.SharePoint.MobileControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

Public Property PageFileName As String
    Get
    Set

Dim instance As SPMobileUrlRedirection
Dim value As String

value = instance.PageFileName

instance.PageFileName = value
public string PageFileName { get; set; }

Property Value

Type: System.String
A String that specifies the page to which a mobile device should be redirected.

Remarks

Setting Url does not set PageFileName to a consistent value. For example, if Url is set to "\\ServerName\MySite\m\MySpecialPage.aspx", PageFileName is not set to "MySpecialPage.aspx".

However, setting PageFileNamedoes set Url to a consistent value.

Examples

The following example shows the contents of a custom .ascx file (for example, MyMobileControlTemplates.ascx) that defines a control template that directs the runtime to use MyHome.aspx as the home page whenever a mobile device accesses a Web site by using the site definition "MySiteType". For more information about this example, see How to: Customize the Mobile Home Page through Redirection.

<%@ Control Language="C#" %>
<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, 
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="mobile" 
Namespace="System.Web.UI.MobileControls" 
Assembly="System.Web.Mobile, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" %>
<%@ Register TagPrefix="SharePoint" 
Namespace="Microsoft.SharePoint.WebControls" 
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SPMobile" 
Namespace="Microsoft.SharePoint.MobileControls" 
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c" %>

<SharePoint:RenderingTemplate RunAt="Server" 
ID="Mobile_MySiteType_HomePage_Redirect">
  <Template>
    <SPMobile:SPMobileUrlRedirection RunAt="Server" 
    PageFileName="MyHome.aspx" />
  </Template>
</SharePoint:RenderingTemplate>

See Also

Reference

SPMobileUrlRedirection Class

SPMobileUrlRedirection Members

Microsoft.SharePoint.MobileControls Namespace