Reputation: 811
Can anyone provide a simple way to get mys asp.net datagridview to open in a new window? 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.
Many Thanks
Upvotes: 0
Views: 1145
Reputation: 2689
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. So use the textbox value, read data and populate the 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);
Upvotes: 0
Reputation: 5727
1) Put the GridView in other page
2) Call window.open on button click that will display 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.
Upvotes: 0