I have an ASP.NET MVC app that opens a "Request" view in a new browser window. When the user submits the form, I'd like the window to close. What should my RequestController code look like to close the window after saving the request information? I'm not sure what the controller action should be returning.
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- How to dynamically load partial view Via jquery aj
- parameters in routing do not work MVC 3
- There is no ViewData item with the key 'taskTy
- TextBoxFor decimal
相关文章
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- Forward request from servlet to jsp
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
This worked for me:
It sounds like you could return an almost empty View template that simply had some javascript in the header that just ran "window.close()".
You could return a View that has the following javascript (or you could return a JavaScript result) but I prefer the former.
View for Close:
Here is a way to do it directly in your Controller but I advise against it
Like such:
The view:
Using this you can close the window like this:
This worked for me to close the window.
Controller:
View: