Passing variables in query string in the HyperLinkColumn of a datagrid

Discussion in 'ASP .Net' started by aparnasinha26@yahoo.com, May 17, 2005.

  1. Guest

    Hi All,
    I have to pass variable in a query string.
    The query string is in the hyperlink coloumn of a datgrid.

    The code appears like this
    <asp:HyperLinkColumn DataNavigateUrlField="ProductID"
    DataNavigateUrlFormatString="ViewProduct.aspx?qProductID='<%strProduct%>'"
    DataTextField="ProductID" HeaderText="Product ID">
    <HeaderStyle Width="10%"></HeaderStyle>
    </asp:HyperLinkColumn>


    this does not work..
    Can any one help..
    , May 17, 2005
    #1
    1. Advertising

  2. TDAVISJR Guest

    Where is <%strProduct%>' coming from. Is this a column in your datasource.
    If so then you need to sue the binding synthax '<%# strProduct%>'

    --
    TDAVISJR
    aka - Tampa.NET Koder


    <> wrote in message
    news:...
    > Hi All,
    > I have to pass variable in a query string.
    > The query string is in the hyperlink coloumn of a datgrid.
    >
    > The code appears like this
    > <asp:HyperLinkColumn DataNavigateUrlField="ProductID"
    > DataNavigateUrlFormatString="ViewProduct.aspx?qProductID='<%strProduct%>'"
    > DataTextField="ProductID" HeaderText="Product ID">
    > <HeaderStyle Width="10%"></HeaderStyle>
    > </asp:HyperLinkColumn>
    >
    >
    > this does not work..
    > Can any one help..
    >
    TDAVISJR, May 17, 2005
    #2
    1. Advertising

  3. Guest

    Hi,
    Thanks..
    To continue with ur question..
    No '<%­strProduct%>' is a variable which stores the value from a query
    string.
    The page is accepting a query string which is stored in query string
    'qProduct'
    I assign qProduct to the public variable strProduct on form load in my
    code behind file of asp.net.
    the code behind is VB ie I am working on VB.Net.

    I hope this clears your question
    , May 18, 2005
    #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. vtreddy
    Replies:
    0
    Views:
    2,062
    vtreddy
    Nov 6, 2003
  2. Replies:
    0
    Views:
    423
  3. Roy
    Replies:
    1
    Views:
    1,292
  4. Jl_G_0
    Replies:
    3
    Views:
    4,687
    Jl_G_0
    Sep 13, 2006
  5. nick
    Replies:
    1
    Views:
    452
    David Mark
    Feb 13, 2011
Loading...

Share This Page