postbackUrl querystring

Discussion in 'ASP .Net' started by James Page, Jul 16, 2009.

  1. James Page

    James Page Guest

    Hi all

    I have a gridview linked to a sql database. When send querystring parameters
    to the details page I usually use the following format:

    Eval("id", "~/detailspage.aspx?id={0}")

    which works perfectly. However..
    I need to pass two parameters to a particular details page:

    "~/detailspage.aspx?id={0}&dt={0}

    Having problems in trying to write the appropriate "Eval" statement.

    Can anyone point me in the right direction?

    Thanks
     
    James Page, Jul 16, 2009
    #1
    1. Advertising

  2. =?Utf-8?B?SmFtZXMgUGFnZQ==?= <> wrote
    in news::

    > Hi all
    >
    > I have a gridview linked to a sql database. When send querystring
    > parameters to the details page I usually use the following format:
    >
    > Eval("id", "~/detailspage.aspx?id={0}")
    >
    > which works perfectly. However..
    > I need to pass two parameters to a particular details page:
    >
    > "~/detailspage.aspx?id={0}&dt={0}
    >
    > Having problems in trying to write the appropriate "Eval" statement.
    >
    > Can anyone point me in the right direction?
    >


    Just off the top of my head (although I am not sure the tilde will work
    like this:

    <%# string.Format("~/detailspage/aspx?id={0}&id2={1}", DataBinder.Eval
    (Container.DataItem, "id"), DataBinder.Eval(Container.DataItem,"id2") %>

    It can also be solved by using the row data binding event, but that is
    coding, not just tags.

    You can alter the above slightly to fit other formats.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    ******************************************
    | Think outside the box! |
    ******************************************
     
    Gregory A. Beamer, Jul 16, 2009
    #2
    1. Advertising

  3. James Page

    James Page Guest

    Thanks again Gregory - just what I needed to get going

    "Gregory A. Beamer" wrote:

    > =?Utf-8?B?SmFtZXMgUGFnZQ==?= <> wrote
    > in news::
    >
    > > Hi all
    > >
    > > I have a gridview linked to a sql database. When send querystring
    > > parameters to the details page I usually use the following format:
    > >
    > > Eval("id", "~/detailspage.aspx?id={0}")
    > >
    > > which works perfectly. However..
    > > I need to pass two parameters to a particular details page:
    > >
    > > "~/detailspage.aspx?id={0}&dt={0}
    > >
    > > Having problems in trying to write the appropriate "Eval" statement.
    > >
    > > Can anyone point me in the right direction?
    > >

    >
    > Just off the top of my head (although I am not sure the tilde will work
    > like this:
    >
    > <%# string.Format("~/detailspage/aspx?id={0}&id2={1}", DataBinder.Eval
    > (Container.DataItem, "id"), DataBinder.Eval(Container.DataItem,"id2") %>
    >
    > It can also be solved by using the row data binding event, but that is
    > coding, not just tags.
    >
    > You can alter the above slightly to fit other formats.
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > Twitter: @gbworld
    > Blog: http://gregorybeamer.spaces.live.com
    >
    > ******************************************
    > | Think outside the box! |
    > ******************************************
    >
     
    James Page, Jul 16, 2009
    #3
    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. ABC
    Replies:
    6
    Views:
    4,034
    Bruce Barker
    Oct 7, 2005
  2. Rob Meade

    ImageButon: PostBackURL

    Rob Meade, Dec 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,538
    Teemu Keiski
    Dec 4, 2005
  3. Mehdi
    Replies:
    6
    Views:
    36,127
    sloan
    Apr 6, 2006
  4. Fabio Mastria
    Replies:
    2
    Views:
    2,561
  5. Adeel Ahmad
    Replies:
    1
    Views:
    527
    Anthony Jones
    Mar 7, 2006
Loading...

Share This Page