从Asp.Net的代码控制控件灯箱(模式) [英] Control Lightbox (Modal) From Code-Behind Of Asp.Net

查看:78
本文介绍了从Asp.Net的代码控制控件灯箱(模式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在与Ajax和Jquery会面之前,在我的项目中,我具有如下功能.

Before meeting with Ajax and Jquery, in my projects I had a function like below.

Public Sub Raise_Alarm(ByVal p_Page As Page, ByVal p_Message As String, Optional ByVal p_IsError As Boolean = True)

strScript = "<script language= ""javascript""> alert('" & p_Message.Replace("'", "") & "')</script>"
    Dim t As Type = p_Page.GetType()
    p_Page.ClientScript.RegisterStartupScript(t, "alert", strScript)
    Dim mylabel As Label

end sub

现在我想要一个函数而不是上面的函数,该函数将消息显示为灯箱(模式框).

For now I want to a function instead of function above, which show message as a lightbox (modal box).

我该怎么办?

推荐答案

如果您要按照以上(+1;)的cxfx的建议使用jqModal,这应该可以:

If you want to use jqModal as suggested by cxfx above (+1;), this should work:

strScript = "$('<div>" & p_Message.Replace("'", "\'") & "</div>').jqm();";
ClientScriptManager.RegisterStartupScript(p_Page.GetType(), "alert", strScript, true);

这篇关于从Asp.Net的代码控制控件灯箱(模式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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