actionresult之后的Bootstrap弹出框 [英] Bootstrap popup box after actionresult

查看:106
本文介绍了actionresult之后的Bootstrap弹出框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,我是MVC的新手,我只想在actionresult成功执行后显示一个引导POPup框(使用一些运行时字符串成功保存)。但是首先弹出显示而不是goto控制器

i已经在视图和控制器中尝试了以下代码:



我尝试过:



< div Class =form-group> 
< div Class =col-md-10>
< input type =submitdata-toggle =modaldata-target =。bootstarpmodal value =Submitclass =btn btn-info/>
@ Html.ActionLink (返回首页,索引)
< / div>
< / div>

< div class =modal fade bootstarpmodal>
< div class =modal-dialog>
< div class =modal-content>
< div class =modal-header>
< button data-dissmiss =modalclass =close>< span>×< / span>< / button>
< div class =modal-title>记录保存成功< / div>
< / div>
< div class =modal-body>
(((@运行时显示某些字符串))) )
< / div>
< div class =modal-页脚>
< button class =btn btn-defaultdata-dissmiss =modal>关闭< / button>
< / div>
< / div>
< / div>
< / div>





- 并且在控制器中

< httppost>

< allowanonymous>

< validateantiforgerytoken>

公共异步函数ServiceRequest(模型为ServiceRequest,文件为HttpPostedFileBase(),returnUrl As String)作为任务(Of ActionResult)





functionforDBaction(型号)







返回RedirectToAction(ServiceRequest,Home)

结束函数

解决方案

Google搜索提供了许多解决方案供您选择: mvc bootstrap popup [ ^ ]。解决方案如:



* 使用ASP.NET MVC的Bootstrap模式弹出窗口 [ ^ ]

* c# - MVC 5编辑Bootstrap模态弹出 - 堆栈溢出 [ ^ ]

* javascript - 如何在ASP.NET MVC中创建一个简单的bootstrap模式对话框 - Stack Overflow [ ^ ]

* 第15部分 - 如何使用JQuery在Asp.net MVC中创建引导弹出窗口(模态)和插入数据 - YouTube [ ^ ]

* Bootstrap教程 - #6在Asp.Net MVC中创建弹出窗口(Bootstrap模式) - YouTube [ ^ ]

* 还有更多! [ ^ ]

HI, i am New to MVC, i just want to show a bootstrap POPup box ("Record saved successfully " with some runtime string) after actionresult successfully executed. but popup display first and than goto controller
i have tried following code in view and controller:

What I have tried:

  <div Class="form-group">
                <div Class="col-md-10">
                    <input type = "submit"  data-toggle="modal" data-target=".bootstarpmodal   value="Submit"class="btn btn-info"  />
                    @Html.ActionLink("Back to Home", "Index")
                 </div>
</div>

<div class="modal fade bootstarpmodal">
                <div class="modal-dialog ">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button data-dissmiss="modal" class="close" ><span >×</span></button>
                           <div class="modal-title  "> Record saved successfully </div>
                        </div>
                        <div class="modal-body">
                           ((( @ run time display of some string ))))
                        </div>
                        <div class="modal-footer">
                            <button class="btn btn-default " data-dissmiss="modal" >Close</button>
                        </div>
                    </div>
                </div>
            </div>



--and in controller
<httppost>
<allowanonymous>
<validateantiforgerytoken>
Public Async Function ServiceRequest(model As ServiceRequest, files As HttpPostedFileBase(), returnUrl As String) As Task(Of ActionResult)


functionforDBaction(model)



Return RedirectToAction("ServiceRequest", "Home")
End Function

解决方案

Google Search has lots of solutions for you to pick from: mvc bootstrap popup[^]. Solutions like:

* Bootstrap Modal PopUp Using ASP.NET MVC[^]
* c# - MVC 5 Edit Bootstrap Modal Popup - Stack Overflow[^]
* javascript - How to create a simple bootstrap modal dialog in ASP.NET MVC - Stack Overflow[^]
* Part 15 - How to create a bootstrap popup (modal) and insert data using JQuery in Asp.net MVC - YouTube[^]
* Bootstrap Tutorial - #6 Create Popup in Asp.Net MVC (Bootstrap Modal ) - YouTube[^]
* and lots more![^]


这篇关于actionresult之后的Bootstrap弹出框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆