Imports System Imports System.ComponentModel Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Xml.Serialization Imports Microsoft.SharePoint Imports Microsoft.SharePoint.Utilities Imports Microsoft.SharePoint.WebPartPages 'WebPart To Automatically Redirect User To Their Personal Pages <DefaultProperty("Text"), ToolboxData("<{0}:UserRedirect runat=server></{0}:UserRedirect>"), XmlRoot(Namespace:="UserRedirect")> _ Public Class UserRedirect Inherits Microsoft.SharePoint.WebPartPages.WebPart Private Const _defaultText As String = "" Dim _text As String = _defaultText <Browsable(True), Category("Miscellaneous"), DefaultValue(_defaultText), WebPartStorage(Storage.Personal), FriendlyName("Text"), Description("Text Property")> _ Property [Text]() As String Get Return _text End Get Set(ByVal Value As String) _text = Value End Set End Property 'Render this Web Part to the output parameter specified. Protected Overrides Sub RenderWebPart(ByVal output As System.Web.UI.HtmlTextWriter) GetContent() End Sub Function GetContent() Dim UserName On Error Resume Next UserName = Page.Request.ServerVariables("Logon_User") If Len(UserName) = 0 Then UserName = "Anonymous" End If UserName = Split(UserName, "\") 'Do not redirect if the domain administrator is accessing the page for admin purposes If RTrim(UCase(UserName(1))) <> RTrim("ADMINISTRATOR") Then 'Redirect the user to their personal page. Page.Response.Redirect("http://localhost/Shared%20Documents/" & UserName & ".aspx") End If End Function End ClassAs you can see the code is very simple it just check the user name and redirect it to a page with the same name.
Answers
LnZ
can you post a link for this webpart - trying to solve the same problem.
Cheers from Downunder.
Matthias.
I want that a user do logon and directly enter to his site and not to the main site.
Thx
Thanks in anticipation!
sorry but I have been very busy lately.
In the next days will post a reply with the webpart code
LnZ
I thought this one was blackholed .............