Multiple elements within a datagrid querystring

Discussion in 'ASP .Net' started by Carl Howarth, Jul 24, 2003.

  1. Carl Howarth

    Carl Howarth Guest

    Hi,

    I need to bind data to a datagrid and have a custom hyperlink column that
    has multiple elements in the querystring:

    Page.aspx?1=Hello&2=Goodbye...

    The query string needs to be populated from different values in the
    database. How can I therefore allow for this in the template rather than
    having to create a custom field in my stored procedure as the following will
    not work!:

    NavigateUrl='SelectCriteria.aspx?Database=<%# DataBinder.Eval(Container,
    "DataItem.lsID") %>&Table=<%# DataBinder.Eval(Container, "DataItem.tblID")
    %>&QueryID=<%# DataBinder.Eval(Container, "DataItem.QueryID") %>'

    Many thanks in anticipation,

    Carl
    Carl Howarth, Jul 24, 2003
    #1
    1. Advertising

  2. Carl Howarth

    Saravana Guest

    It is possible try this,
    <asp:DataGrid id="DataGrid1" AutoGenerateColumns="False" style="Z-INDEX:
    101; LEFT: 66px; POSITION: absolute; TOP: 79px" runat="server">

    <Columns>

    <asp:TemplateColumn HeaderText="Order">

    <ItemTemplate>

    <asp:Hyperlink runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem,"OrderID")%>' NavigateUrl='<%#
    "page.aspx?Orderid=" + DataBinder.Eval(Container.DataItem,"Orderid") +
    "&ProductID=" + DataBinder.Eval(Container.DataItem,"ProductID")%>'
    ID="Hyperlink1" NAME="Hyperlink1"/>

    </ItemTemplate>

    </asp:TemplateColumn>

    </Columns>

    </asp:DataGrid>


    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "Carl Howarth" <> wrote in message
    news:...
    > Hi,
    >
    > I need to bind data to a datagrid and have a custom hyperlink column that
    > has multiple elements in the querystring:
    >
    > Page.aspx?1=Hello&2=Goodbye...
    >
    > The query string needs to be populated from different values in the
    > database. How can I therefore allow for this in the template rather than
    > having to create a custom field in my stored procedure as the following

    will
    > not work!:
    >
    > NavigateUrl='SelectCriteria.aspx?Database=<%# DataBinder.Eval(Container,
    > "DataItem.lsID") %>&Table=<%# DataBinder.Eval(Container, "DataItem.tblID")
    > %>&QueryID=<%# DataBinder.Eval(Container, "DataItem.QueryID") %>'
    >
    > Many thanks in anticipation,
    >
    > Carl
    >
    >
    >
    Saravana, Jul 24, 2003
    #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. Mehdi
    Replies:
    6
    Views:
    36,060
    sloan
    Apr 6, 2006
  2. Jyrki Keisala

    Elements within elements

    Jyrki Keisala, Jun 8, 2005, in forum: XML
    Replies:
    5
    Views:
    416
    William Park
    Jun 15, 2005
  3. Replies:
    1
    Views:
    1,087
    Teemu Keiski
    May 12, 2007
  4. Adeel Ahmad
    Replies:
    1
    Views:
    329
    Anthony Jones
    Mar 7, 2006
  5. Daz
    Replies:
    2
    Views:
    73
Loading...

Share This Page