[EDITED]NEP User Homepage
LnZ
Member Posts: 37
Maybe it is not a NEP related question but I need to have differente homepages for different user/groups so when a user logon can see its own webpart page.
Is there a way to do this?
Thank You
As promised here is my simple code:
You should put this webpart on the homepage.
Hope it helps you
LnZ
Is there a way to do this?
Thank You
As promised here is my simple code:
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 Class
As you can see the code is very simple it just check the user name and redirect it to a page with the same name.You should put this webpart on the homepage.
Hope it helps you
LnZ
0
Answers
-
I Have used I simple .NET WebPart that automatically redirect a user to a predefined homepage.
LnZ0 -
Hi Lnz,
can you post a link for this webpart - trying to solve the same problem.
Cheers from Downunder.
Matthias.0 -
Yes plz, i am interested too.
I want that a user do logon and directly enter to his site and not to the main site.
Thx0 -
Me too =D>0
-
Since LnZ is not around it seems, anyone else please help.
Thanks in anticipation!0 -
Hi all,
sorry but I have been very busy lately.
In the next days will post a reply with the webpart code
LnZ0 -
Cool - thanks LnZ!
I thought this one was blackholed .............0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 324 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions