Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 21st, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. GridView pass parameter in url and use in another page
  2. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  3. {
  4.     if (e.Row.RowType == DataControlRowType.DataRow)
  5.     {
  6.         e.Row.Attributes["onmouseover"] = "this.style.color='Black';this.style.cursor='hand';";
  7.         e.Row.Attributes["onmouseout"] = "this.style.color='Black';";
  8.         e.Row.Attributes["onclick"] = "window.navigate('NavigatedPage.aspx?id=" + e.Row.Cells[0].Text.ToString().Trim() + "')";
  9.     }
  10. }
  11.        
  12. string id =Request.QueryString["id"];
  13.        
  14. Request.QueryString["name"]
  15.        
  16. string GetQueryStringVarible(string name, string defaultValue)
  17. {
  18.   if(!string.IsNullOrEmpty(Request.QueryString[name])
  19.   {
  20.     return Request.QueryString[name];
  21.   }
  22.   else
  23.   {
  24.     return defaultValue;
  25.   }
  26. }