Click here to Skip to main content
11,490,973 members (62,727 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET HTML
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 16-Feb-13 12:19pm
Comments
source.compiler at 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
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 521
1 Andy Lanng 288
2 Sascha Lefèvre 240
3 Maciej Los 195
4 OriginalGriff 163
0 Sergey Alexandrovich Kryukov 9,829
1 OriginalGriff 8,520
2 Sascha Lefèvre 3,574
3 Maciej Los 3,151
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2015
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