SPMobileUtility.GetViewUrl method (SPList, SPView)
Retorna o URL da exibição de lista especificado em um aplicativo da Web móvel.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaração
Public Shared Function GetViewUrl ( _
list As SPList, _
view As SPView _
) As String
'Uso
Dim list As SPList
Dim view As SPView
Dim returnValue As String
returnValue = SPMobileUtility.GetViewUrl(list, _
view)
public static string GetViewUrl(
SPList list,
SPView view
)
Parâmetros
list
Type: Microsoft.SharePoint.SPListUm objeto SPList que representa uma lista em um site.
view
Type: Microsoft.SharePoint.SPViewUm objeto SPView que representa um modo de exibição dos dados contidos na lista.
Valor retornado
Type: System.String
Uma seqüência de caracteres que contém o URL.
Examples
O código a seguir mostra GetViewUrl() usado para definir a propriedade NavigateUrl de um controle Link . Para o contexto completo do exemplo, consulte How to: Create a Mobile Adapter.
protected override void CreateControlsForDetailView()
{
Image iconImage = this.CreateWebPartIcon(WebPartIconLink.LinkToDetailView);
iconImage.BreakAfter = false;
this.Controls.Add(iconImage);
Label titleLabel = this.CreateWebPartLabel();
this.Controls.Add(titleLabel);
Int16 itemCount = 1;
foreach (SPListItem item in this.CurrentListItems)
{
SPMobileTemplateContainer container =
new SPMobileTemplateContainer { List = this.CurrentList, View = this.CurrentView, Item = item};
ITemplate template = SPControlTemplateManager.GetTemplateByName("MobileSimpleViewListItemIterator");
template.InstantiateIn(container);
this.Controls.Add(container);
// Start new line.
this.Controls.Add(new LiteralText());
if (itemCount++ >= 3)
{
Link moreItemLink = new Link
{ Text = "more",
NavigateUrl = SPMobileUtility. GetViewUrl(this.CurrentList, this.CurrentView) };
this.Controls.Add(moreItemLink);
break;
} // end if limit has been reached
}// end for each item
}