Click here to Skip to main content
14,383,185 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello,
I am developing a project in ASP.NET for my own just like codeproject.com. In my website when a user asks a question then that question is saved in the database table. When i am fetching that question from database then it should come back as a hyperlink on my webpage which will reference to another page. How can i do it. Just help me in this. I am not getting any idea how to implement this in my project.

Code project people please help in.

Thanx in advance.
Rakesh Sharma
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

First add one hyperlink into your page but make visible=false. while reading the question back from database, assign, navigate uRL to the hyperlink like this..

hyperlink1.NavigateUrl = "yourpage.aspx";


so, you read the data from databse, pass the data to the referred page through any of the data transfer techniques.

check here[^] for more on passing data between pages.

hope it helps..
   
Comments
kanha.460 10-Jan-12 11:51am
   
When i am fetching data from database then that data should work as a hyperlink to another page. How to make that data as a hyperlink. All hyperlinks will refer to same page. I want to know how to make that hyperlink.
Rate this:
Please Sign up or sign in to vote.

Solution 2

create a question page i.e, Question.aspx and viewquestion.aspx


when user create a question save it in your db as a link

i.e

string quesno=string.empty;
viewquestion.aspx\+"quesno";

save it in your db.

fetch your all question in Question.aspx page as a link.

when user click on a link open another page by quesno.

i.e

viewquestion.aspx\123 //here 123 is questionid or quesno.

hope you have got samoe idea.

Thanks
   
Comments
kanha.460 11-Jan-12 4:21am
   
string quesno=string.empty;
viewquestion.aspx\+"quesno"

what does it mean
devbtl 11-Jan-12 7:00am
   
when user create a ques give it an id and save quesid to database.

when user click on question or click on a view button redirect user to a new page via querystring.

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




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