I want to open a new aspx page when a button pressed by the user that use the app.
until now I used Response.Redirect but now I want that the previous page will stay in the background, and that the new popup will present only table data, without postback.
Does it possible?
thanks.
Does it have to be a button? If it’s just a link then you can set its
targetattribute to open the URL in a new window (or tab, it’s up to the browser). Something like this:If it has to be a button, then you can open the new window with JavaScript.
But there’s really no way for the server-side code to tell the browser to open a new window. It all has to translate on the client-side in the end because the browser is the part that’s opening the window.
On a side note, for better UX you might want to consider using something like the jQuery UI Dialog instead of a pop-up. It’s not only nicer from the user’s perspective but I find that it’s easier from a development perspective because it allows you to keep your pop-ups for a page on the page itself, so you don’t have to worry about the exact issue you’re facing now.
Essentially you’d load your pop-up’s data (either on page load or by AJAX when it’s called) into a hidden
divand just show thatdivto the user when they click a button. The jQuery UI plugin just styles it nicely for you and handles modality and things like that.