简体   繁体   English

在新窗口中打开datagridview ... asp.net

[英]Open datagridview in a new window…asp.net

Can anyone provide a simple way to get mys asp.net datagridview to open in a new window? 谁能提供一种简单的方法来使mys asp.net datagridview在新窗口中打开? Or even have a datagrid in it's own page but callable from any other page on my site. 甚至在自己的页面中有一个数据网格,但可以从我网站上的任何其他页面调用。

I basically want to have the effect of setting parameters in a text box, clicking a button and have the datagrid page open with relevent data displayed. 我基本上希望具有在文本框中设置参数,单击按钮并打开datagrid页面并显示相关数据的效果。

Many Thanks 非常感谢

1) Put the GridView in other page 1)将GridView放在其他页面
2) Call window.open on button click that will display GridView 2)调用window.open在按钮上单击将显示GridView
3) Pass the textbox setting parameter to other page via QueryString and on the other page - fetch the query string value, run the query to fill datatable and bind the GridView. 3)通过QueryString将文本框设置参数传递到另一页,并在另一页上-获取查询字符串值,运行查询以填充数据表并绑定GridView。

You have many options to achieve this: One way can be hiding the textbox and the button. 您可以通过多种选择来实现此目的:一种方法是隐藏文本框和按钮。 Infact gridView is hidden when no data is presented. 当没有数据提供时,实际的GridView将被隐藏。 So use the textbox value, read data and populate the gridView. 因此,请使用文本框值,读取数据并填充gridView。

The other way is to pass the textbox value in a querystring set on the button click event 另一种方法是在按钮单击事件上设置的查询字符串中传递文本框值

  Response.Redirect("~/GridPage.aspx?Param=" + textbox1.Text);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM