开发者

Open a new browser window via C# Button click

Here's a little background info on what I'm trying to do:

  • I have a Customer View page; on that page, there's a button to log a new call note. Clicking this button redirects to the new call page.
  • On the new call page, there's a few checkboxes that the user could select that triggers an additional action (i.e. there was a problem with their order, they have a product recommendation, etc)
  • When the call note is submitted, the user is brought back to the customer view page via a Response.Redirect

Now, what I'm trying to do here, is that if the user selects one of the additional action checkboxes, I stil开发者_运维问答l want the call page to redirect back to the customer view page; however, i also want to open the corresponding additional action page in its own window.

So, the resulting flow would look something like this:

  • User opens the customer page, and clicks new call. Browser redirects to the call page
  • User selects "Problem with order" and saves the call note. The call note page redirects back to the customer view page
  • The quality report page (used for issues with their order) then pops in a new window.

Googling tells me to use ClientScript.RegisterStartupScript, but all those examples don't have a redirect involved in there. Any ideas on how I could get this to work?


You can use OnClientClick and some javascript to show the popup window.

<asp:Button ID="Button1" OnClick="Button1_Click" OnClientClick="showPopup()" />

and use the OnClick server side event handler to do the redirection.


You will either need to determine that a popup in needed via javascript, and pop-up the page before the POST occurs or you will need to popup the page after the redirect.

To pop-up after the redirect, store some information (using SessionState for example) that the CustomerViewPage can check to see if a pop-up is required. If so, have the CustomerViewPage call ClientScript.RegisterStartupScript to invoke the pop-up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜