显示来自vbcode的消息框不起作用 [英] Display message box from vbcode not working

查看:79
本文介绍了显示来自vbcode的消息框不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码,并且需要确认弹出框来显示何时存在某种特定条件.


这是代码:


I have the following code and need a confirm popup box to show when a certain condition exists.


Here is the code:


Protected Sub InvestigationStatusDDLIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) ' Root Cause
    Dim script As ClientScriptManager = Page.ClientScript
    If ddlImplementationStatus.SelectedValue = "Completed" And ddlInvestigationStatus.SelectedValue <> "Completed" Then
        If Session("seesionShow") = "yes" Then
            If Not script.IsClientScriptBlockRegistered(Me.[GetType](), "SubmitScript") Then
                script.RegisterOnSubmitStatement(Me.[GetType](), "SubmitScript", "return confirm(This will reset dates, Proceed?, NOTE all dates will be cleared!)")
            End If
        End If
    End If



End Sub




以上无效.我只能在页面加载事件中使它起作用,而不能从下拉列表中选择的索引更改事件中起作用.




The above doesn''t work. I can get it only to work from the page load event, but not from the dropdownlist selected index change event.

推荐答案

您是否尝试过在页面加载时注册脚本?

您上面发布的代码似乎正在检查状态更改中的脚本注册.
Have you tried registering the script while page loads?

The code which you have posted above looks like you are checking for the script registration inside the status change.


这篇关于显示来自vbcode的消息框不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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