Click here to Skip to main content
13,145,464 members (49,754 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Friends,

I am working on a web application having all the records of user. There is a problem in profile management. I want to create a single page which shows all the read-only information about the selected user from the database. And I don't want to assign each member a unique URL. See the following example:

haseeb is working with john

In the above example, haseeb and john should be the hyper-links on which the 3rd user will able to click. When the user click, the page will be redirected to the profile viewer page (say profile.aspx) which shows all the details. In other words, I want to create a generic page.

How can I get hyperlink as text so that I retrieve data w.r.t username.

Please help me to solve this problem, I will be very thankful to you.

Posted 16-Feb-13 11:19am
source.compiler 16-Feb-13 21:19pm
well you can use querystring for showing any user profile,then use Server.Transfer,this permit you to transfer user to any page without showing its adress and querystrings !

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is a pretty simple answer actually. There are many ways to cut the bread on this, but the most simple is you have to have pulled the John & Haseeb names from somewhere. You form or write out your hyper link so that it looks something like this
Profile.aspx?usr=John>John In this case when the user clicks on John they will be be redirected to the Profile Page, with the querstring usr=John, so that your profile page, can read that value and pull up Johns Profile.

Your other option is to place "link" button controls <asp:linkbutton xmlns:asp="#unknown">
You can then populate, John & Haseeb or whatever name from the server side. When the user clicks on either name the whole page will post back to itself. Then in your "Onclick" event you can do a Server.Transfer or an Response.Redirect to whatever page passing in whatever information you'd like.

When dealing with QueryStrings etc. remember to sanitize your inputs.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100