Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
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.

Regards,
Posted
Comments
ali_heidari_ 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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900