PageFileName Property
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

SPMobileUrlRedirection.PageFileName Property

Windows SharePoint Services 3

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)

public string PageFileName { get; set; }

Property Value

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

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.

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>
Show:
© 2016 Microsoft