Solved

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

Posted on 2006-10-25
3
382 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 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

Independent Software Vendors: 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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

751 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