次の方法で共有


MOSS : How to get the credentails management URL

SingleSignonLocator.GetCredentialEntryUrl Method (Microsoft.SharePoint.Portal) is reserved method. You can verify at link <https://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.portal.singlesignonlocator.getcredentialentryurl.aspx> . To Get the Credentials entry URL following resolution is available.

Code Snippet

============

using Microsoft.SharePoint.Portal;

using Microsoft.SharePoint.Portal.SingleSignon;

SpsSsoProvider sso = new SpsSsoProvider();

Application.ApplicationInfo MyApp = null;

//Change the "TestingSSO" to your Application Name.

Application.GetApplication("TestingSSO", ref MyApp);

Uri returnValue = sso.GetCredentialManagementURL(MyApp.ApplicationName);

writer.Write(returnValue.OriginalString);

writer.Write("<a href=" + returnValue.OriginalString + "> Click here to save your credentials for ", "SSOServerCode</a>");

if (ControlMode == SPControlMode.Display)

{

return;

}

cblHospitals = TemplateContainer.FindControl("cblHospitals") as CheckBoxList;

if (cblHospitals == null)

{

throw new ArgumentException("cblHospitals could not be found");

}

cblHospitals.TabIndex = TabIndex;

cblHospitals.CssClass = CssClass;

SPSite site = SPContext.GetContext(this.Context).Site;

SPDataSource dataSource = new SPDataSource();

dataSource.List = site.RootWeb.Lists["Hospitals"];

this.cblHospitals.DataSource = dataSource;

this.cblHospitals.DataTextField = "Title";

this.cblHospitals.DataValueField = "Title";

this.cblHospitals.DataBind();

}

public override object Value

{

get

{

EnsureChildControls();

PublishColumnValue fieldValue = new PublishColumnValue();

foreach (ListItem item in cblHospitals.Items)

{

if (item.Selected)

{

fieldValue.Add(item.Value);

}

}

return fieldValue;

}

set

{

EnsureChildControls();

cblHospitals.ClearSelection();

PublishColumnValue fieldValue = (PublishColumnValue)value;

for (int i = 0; i < fieldValue.Count; i++)

{

string s = fieldValue[i];

if (cblHospitals.Items.FindByValue(s) != null)

{

cblHospitals.Items.FindByValue(s).Selected = true;

}

}

}

}

public override void UpdateFieldValueInItem()

{

base.UpdateFieldValueInItem();

}

}

}

acsx file

======

<%@ Control Language="C#" Debug="true" %>

<%@Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>

Comments