NEWBIE needs helps about creating links

Discussion in 'ASP .Net' started by Enes Kabacaoglu, Dec 25, 2005.

  1. From: "Enes Kabacaoglu" <>
    To: "Community of ASP.NET 2.0" <>
    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
     
    Enes Kabacaoglu, Dec 25, 2005
    #1
    1. Advertising

  2. 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!
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Enes Kabacaoglu" <> wrote in message
    news:...
    > From: "Enes Kabacaoglu" <>
    > To: "Community of ASP.NET 2.0" <>
    > 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
    >
     
    Nathan Sokalski, Dec 30, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oliver
    Replies:
    2
    Views:
    1,101
    Imran Koradia
    Nov 22, 2004
  2. =?Utf-8?B?RWR3YXJkIFNtaXQ=?=
    Replies:
    1
    Views:
    325
    =?Utf-8?B?RWR3YXJkIFNtaXQ=?=
    May 21, 2004
  3. Bengt Richter
    Replies:
    0
    Views:
    305
    Bengt Richter
    Aug 7, 2003
  4. Ilias Lazaridis
    Replies:
    24
    Views:
    638
  5. zhfs
    Replies:
    4
    Views:
    774
    JohnDuq
    Apr 17, 2009
Loading...

Share This Page