?
Solved

Passing additional (non-data bound) parameters from a GridView hyperlink.

Posted on 2006-10-25
3
Medium Priority
?
384 Views
Last Modified: 2012-05-05
Hello gurus. I am in need of passing an additional parameter from a GridView hyperlink.  The value I need to pass is not in the data bound to the GridView control; so I can't do it by simply adding paramters to DataNavigateUrlFields and DataNavigateUrlFormatString. I used to accomplish this with the old DataGrid control like so:

private void dg1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
      if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
      {
            ((HyperLink)e.Item.Cells[0].Controls[0]).NavigateUrl += "&PgIndex=" + curPgIndex;
            ((HyperLink)e.Item.Cells[0].Controls[0]).NavigateUrl += "&XName=" + Request.QueryString["XName"];
            ((HyperLink)e.Item.Cells[0].Controls[0]).NavigateUrl += "&strSQL=" + strSQL;
            ((HyperLink)e.Item.Cells[0].Controls[0]).NavigateUrl += "&XState=" + Request.QueryString["XState"];
      }
}

... but, of course, the new GridView control is different.
How do I accomplish this?
I am in an urgent time crunch.
Thank you in advance for your advise.
0
Comment
Question by:jaerob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
Pra4444 earned 2000 total points
ID: 17804780
can you not use a helper function to catch the values?? I havent  used gridview much..but just a suggestion...

http://www.eggheadcafe.com/community/aspnet/6/10004766/passing-parameters-from-g.aspx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

719 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