Solved

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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

756 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