code_junkie

pass “calendar.selectedvalue” in querystring from gridview

Nov 12th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <asp:HyperLinkField DataNavigateUrlFields="LocalIP"
  2. DataNavigateUrlFormatString="DailyResults.aspx?
  3. Terms={0}&column=LocalIP&
  4. startdate=Calendar1.SelectedDate.Date.Date.ToShortDateString()
  5. DataTextField="LocalIP" HeaderText="User" />
  6.  
  7. protected override gv1_RowDataBound(object sender, GridViewRowEventArgs e)
  8. {
  9. HyperLink hl = new Hyperlink();
  10. hl.NavigateUrl = string.Format("DailyResults.aspx?Terms={0}&column=LocalIP&startdate={1}", localIp, Calendar1.SelectedDate.Date.Date.ToShortDateString());
  11. .. set other hyperlink fields ..
  12. e.Row.Cells[1].Controls.Add(hl);
  13. }
  14.  
  15. <asp:HyperLinkField DataNavigateUrlFormatString="<%=GetSelectedDate()%>....
  16.  
  17. <asp:HyperLinkField DataNavigateUrlFields="LocalIP"
  18. DataNavigateUrlFormatString='<%# "DailyResults.aspx?Terms={0}&column=LocalIP&startdate=" + Calendar1.SelectedDate.Date.Date.ToShortDateString() %> DataTextField="LocalIP" HeaderText="User" />
Add Comment
Please, Sign In to add comment