Solved

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

Posted on 2006-10-25
3
375 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
3 Comments
 
LVL 12

Accepted Solution

by:
Pra4444 earned 500 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now