NEWBIE needs helps about creating links

E

Enes Kabacaoglu

From: "Enes Kabacaoglu" <[email protected]>
To: "Community of ASP.NET 2.0" <[email protected]>
Subject: NEWBIE needs help for creating links
Date: Sat, 24 Dec 2005 17:42:34 -0800

Hi :
Firstly, i am sorry for stealing your time for this easy problem of
mine, but i crashed.

I have a datalist, and i show a small pic and a little about the news,
in it. There is a details link at bottom. I want to carry the news_id
and news_category informations to details page, but i could not ! As a
summary i need this kind of thing :

http://www.mysite.com/newsdetails.aspx?news_id=145&news_category=health

I have used an 'asp :Hyperlink' but for databound method of this item,
i could only carry news_id. How can i carry more? Which tool to choose,
and how?

By the way i am an VisualStudio 2005 (Rel.Can) user.

Thanks for your helps.
Best Regards
 
N

Nathan Sokalski

Try either one of the following, either one should work:

<asp:HyperLink id="lnknewsdetails" runat="server" Text="Details For This
Article" NavigateUrl='<%# "http://www.mysite.com/newsdetails.aspx?news_id="
& Server.UrlEncode(Container.DataItem.news_id) & "&news_category=" &
Server.UrlEncode(Container.DataItem.news_category) %>'>

<asp:HyperLink id="lnknewsdetails" runat="server" Text="Details For This
Article" NavigateUrl='<%#
String.Format("http://www.mysite.com/newsdetails.aspx?news_id={0}&news_category={1}",
Server.UrlEncode(Container.DataItem.news_id),
Server.UrlEncode(Container.DataItem.news_category)) %>'>

Good Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top