Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 24, 2010 02:36 AM by Bober Song - MSFT
Jul 02, 2010 02:59 PM|LINK
I am using the asp.net membership.
On my site I have a Profile.aspx page.
In the code behind of this page, i get the logged in UserId (Guid) and pass
this to a method in my DAL. GetUserByUserId()
In my database I have a Table called Member which the method gets the data from
and displays details on the page about the user.
What I want to happen is when they have logged in and are diverted to Profile.aspx,
the page URL shows www.MyWebSite/Profile/UsersName
is this possible. In my Member table I have FirstName and LastName columns or do I get the
name from the membership table.
even better would be they go straight to
thank you for any help
Jul 07, 2010 09:03 AM|LINK
Hi prontonet ,
From your description, I think you want to rewrite the user profile page.
You can create one Profile.aspx page, the page needs one parameter for getting user profile.
so you need to rewrite the Profile.aspx?username=JohnSmith to
Please double check the following links which guide you to rewrite the Profile page url.
I hope it is helpful to you.
Jul 08, 2010 12:47 PM|LINK
thanks for the response.
here is my code behind that sends the user to a profile page on clicking linkbutton on aspx.
protected void LinkButton2_Click(object sender, EventArgs e)
Guid MemberlId = (Guid)Membership.GetUser().ProviderUserKey;
string url = Request.ApplicationPath + "/Profile.aspx?Id=" + MemberId;
On profile aspx, I have a data controls that show the Members profile by getting the GUID in the
query String and passing this to a method in my DAL such as GetMemberProfileByUserId(parmeter)
Instead of the page showing
the members GUID string I would rather the page shows
Jul 08, 2010 01:11 PM|LINK
A great article by Scott Mitchel on URL Rewriting might come to your help. Please check the "Creating Truly "Hackable" URLs" section in this
Aug 23, 2010 05:13 PM|LINK
I am using the article you advised and it works but just have one question.
My web config is below
<!-- Rules for Product Lister -->
It only works if I put the full URL in like below with ".aspx extension"
what I want to happen is it to work as below
Could you advise on this please?
Aug 24, 2010 02:36 AM|LINK
From your description, I think you need to use ne extension url rewriting. you need to configure the IIS. please double check the following links.
URL rewriting and no extentsion