Wednesday, March 21, 2012

Passing variables in query string in the HyperLinkColumn of a datagrid

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..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
<aparnasinha26@.yahoo.com> wrote in message
news:1116325678.716477.36020@.z14g2000cwz.googlegroups.com...
> 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..
>
Hi,
Thanks..
To continue with ur question..
No '<%=ADstrProduct%>' 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

0 comments:

Post a Comment