Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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..

C#
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..
 
Share this answer
 
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.
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
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900