Monday, November 30, 2009

Application page with UnsecuredLayoutsPageBase

Sharepoint site with secure socket layer (Https) requires to be inherited with "UnsecuredLayoutsPageBase"

See the code sample given below:


public class Class1 :UnsecuredLayoutsPageBase
{
protected Label lblSiteTitle;
protected Label lblSiteID;
protected DropDownList DropDownList1;
protected override void OnLoad(EventArgs e)
{
SPWeb site = this.Web;
lblSiteTitle.Text = site.Title;
lblSiteID.Text = site.ID.ToString().ToUpper();
}
protected void Button_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.SelectedValue);
}
}

No comments: