我想通过单击超链接将网格视图中的值传递给带有查询字符串的另一页 [英] i want to pass values in grid view to another page with query string by clicking on hyperlink
本文介绍了我想通过单击超链接将网格视图中的值传递给带有查询字符串的另一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用查询字符串将网格视图中的值传递给另一页
通过单击列的超链接,整个行值需要传递到另一页.
i want to pass values in grid view to another page with query string
by clicking on hyperlink of a column the entire row values need to pass to another page
推荐答案
在onClientClick函数的按钮上,提供以下代码..
On a button onClientClick function give the following code..
OnClientClick='<%# String.Format("jSFunctionName(""{0}"");",DataBinder.Eval(Container.DataItem,"ColumnName")) %>'
可以吗?
Is it OK???
尝试一下..
在RowDataBound事件上,将属性添加到超链接.
例如:
1.将HYPERLINK设为Dim HYPERLINK = DirectCast(e.Row.FindControl("lnkButReport"),LinkButton)
2. HYPERLINK.Attributes.Add("onclick","window.open(" ../AnotherPage.aspx?Querystrin1 =&Convert.ToString(DataBinder.Eval(e.Row.DataItem," ColumnName1))& &Querystrin1 ="&Convert.ToString(DataBinder.Eval(e.Row.DataItem,"ColumnName2"))&'',``CustomPopUp'',''width = 900,height = 650,left = 50,top = 20,resizable = 1,scrollbars = 1'',``info'');返回false;)
我在查询字符串中仅显示了两列,您可以添加尽可能多的内容...
希望这对您有帮助...
try this..
On RowDataBound event add attributes to the hyperlink..
for Ex:
1. Dim HYPERLINK As LinkButton = DirectCast(e.Row.FindControl("lnkButReport"), LinkButton)
2. HYPERLINK.Attributes.Add("onclick", "window.open(''../AnotherPage.aspx?Querystrin1=" & Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ColumnName1"))& "&Querystrin1="& Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ColumnName2"))&"'',''CustomPopUp'',''width=900, height=650,left=50,top=20,resizable=1,scrollbars=1'',''info'');return false;")
i have shown only two columns in the query string, you can add as many as you can...
hope this will help you...
这篇关于我想通过单击超链接将网格视图中的值传递给带有查询字符串的另一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文