GridView Hyperlink Field Append URL?

B

barkster

I'm trying to create a link in my gridview that will include th
existing url parameters plus the ID of the field. I've trie
everything I can think of to get it to work but this was my lates
attempt below. I'm new to using asp.net and I'm just used t
building my own url's in php and this is just so different the wa
they go about it. I've tried about 5 different processes

<asp:HyperLinkField DataNavigateUrlFields="WONo
DataNavigateUrlFormatString="Detail.aspx?StartDate=<%
Request.QueryString("StartDate"
%>&amp;EndDate=<%
Request.QueryString("EndDate"
%>&amp;WO={0}"DataTextField="WONo
/
 
S

Siva M

You can try TemplateField instead:

....
<Columns>
<asp:TemplateField>
<ItemTemplate>
<a href='<%# "default.aspx?StartDate=" +
Request.QueryString["StartDate"] + "&EndDate=" +
Request.QueryString["EndDate"] + "&wo=" +
DataBinder.Eval(Container.DataItem, "WONo") %>'>
<%# DataBinder.Eval(Container.DataItem, "WONo") %>
</a>
</ItemTemplate>
</asp:TemplateField>
....
</Columns>

I'm trying to create a link in my gridview that will include the
existing url parameters plus the ID of the field. I've tried
everything I can think of to get it to work but this was my latest
attempt below. I'm new to using asp.net and I'm just used to
building my own url's in php and this is just so different the way
they go about it. I've tried about 5 different processes.


<asp:HyperLinkField DataNavigateUrlFields="WONo"
DataNavigateUrlFormatString="Detail.aspx?StartDate=<%#
Request.QueryString("StartDate")
%>&amp;EndDate=<%#
Request.QueryString("EndDate")
%>&amp;WO={0}"DataTextField="WONo"
/>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top