如何在灯箱弹出之前在控制器中调用ActionResult方法? [英] How to call a ActionResult method in controller before light box pops up?

查看:84
本文介绍了如何在灯箱弹出之前在控制器中调用ActionResult方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在单击@ html.ActionLink.so时,在弹出灯箱之前,我必须调用ActionResult Index()方法.

谢谢
Eber yusuf

I have to call ActionResult Index() method before the light box pops up on the click of the @html.ActionLink.so is there any way to achieve this.

Thanks
Eber yusuf

推荐答案

因此,您要在新页面打开后打开灯箱吗?在这种情况下,您需要具有一些隐藏值以指示应显示灯箱,并将其绑定到模型,然后在
So, do you want light box to open after the new page opens? In that case, you need to have some hidden value to indicate that the light box should be shown, bind it to a model, and on


(文档)上.准备好打开灯箱.或者,您可以使用
(document).ready open the light box. Or you can use


.ajax在服务器上执行一些操作,然后在成功时显示灯箱.

查看这个小提琴作为示例:

http://jsfiddle.net/6sV8K/ [ ^ ]

如果不使用这两种方法中的任何一种,纯锚标记只能将您重定向到url.

万一我遗漏了一些东西,请将您的评论发布到我的答案或更新您的问题!
.ajax to perform some action on the server and then on success display the light box.

Check out this fiddle for an example:

http://jsfiddle.net/6sV8K/[^]

Without using either of these 2 methods, a plain anchor tag could only redirect you to an url.

In case I am missing something post your comments to my answer or update your question!


这篇关于如何在灯箱弹出之前在控制器中调用ActionResult方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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