BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in .NET XML, System.XML

 
 
Page 2354 of 18325

MOSS : How to pass the FBA authenticated user to a PageViewer Web Part?

Blogger : MSDN Blogs
All posts : All posts by MSDN Blogs
Category : .NET XML, System.XML
Blogged date : 2008 May 04

f you creates a Form based authenticated site and you were not able to get the authenticated login user token at client site. You can user the following resolution when you are working with PageViwer Web Part.

using System;

using System.Runtime.InteropServices;

using System.Web.UI;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Serialization;

using System.Xml;

using Microsoft.SharePoint;

using Microsoft.SharePoint.WebControls;

using Microsoft.SharePoint.WebPartPages;

using System.ComponentModel;

namespace FBALoginUser

{

[Guid("2ea076de-3536-4d20-b5d2-365dfd098da6")]

 

public class FBALoginUser : System.Web.UI.WebControls.WebParts.WebPart

{

public FBALoginUser()

{

this.ExportMode = WebPartExportMode.All;

}

 

protected override void Render(HtmlTextWriter writer)

{

 

SPWeb web = SPContext.GetContext(this.Context).Web ;

web.AllowUnsafeUpdates = true;

SPUser user = web.CurrentUser;

SPWebPartCollection collection = web.GetWebPartCollection ("default.aspx", Storage.Personal);

writer.Write(user.LoginName);

PageViewerWebPart lobjWebPArt = new PageViewerWebPart();

//Change to the JSP URL or youe web Application

lobjWebPArt.ContentLink = "http://localhost:4000/loginpage1.aspx?SID="+ user.LoginName.ToString() +"&VIEW=domain";

collection.Add(lobjWebPArt);

 

}

}

}


Read comments or post a reply to : MOSS : How to pass the FBA authenticated user to a PageViewer Web Part?
Page 2354 of 18325

Newest posts
 

    Email TopXML