?
Solved

How to set Querystring values in <asp:HyperLinkField > in GridView

Posted on 2009-04-27
3
Medium Priority
?
752 Views
Last Modified: 2012-05-06
<Columns>
<asp:HyperLinkField NavigateUrl="~/test.aspx" ShowHeader="False" Text="View/Edit" />
</Columns>

<%# Eval("product_id") %>
0
Comment
Question by:kengkit
  • 2
3 Comments
 
LVL 9

Expert Comment

by:tetorvik
ID: 24244178
0
 

Author Comment

by:kengkit
ID: 24247185
i got the following error:

Error Creating Control - GridView
Databinding expressions are only supported on objects that have a DataBinding vent. System.Web.UI.WebControls.HyperLinkField does not have a DataBinding event.
<Columns>
<asp:BoundField DataField="code" HeaderText="Product Code" />
<asp:HyperLinkField 
NavigateUrl='<%# String.Concat("product_spec.aspx?action=edit&ID=", Eval("product_ID")) %>' ShowHeader="False" Text="View/Edit" />
</Columns>

Open in new window

0
 
LVL 9

Accepted Solution

by:
tetorvik earned 90 total points
ID: 24247831
I'm sorry, my pointer really did fit to hyperlinkfiels. try following instead:

<Columns>
<asp:BoundField DataField="code" HeaderText="Product Code" />
<asp:HyperLinkField DataNavigateUrlFields="product_ID" DataNavigateUrlFormatString="product_spec.aspx?action=edit&ID={0}" ShowHeader="False" Text="View/Edit" />
</Columns>

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question