脚本语言未运行..........请帮助任何人 [英] script language is not running..........plz help anyone

查看:89
本文介绍了脚本语言未运行..........请帮助任何人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<%@ Control Language="VB" AutoEventWireup="true" CodeFile="messagebox.ascx.vb" Inherits="messagebox" %>
<asp:Literal ID="Literal1" runat="server" Text="messagebox"></asp:Literal>



-------------编码----------------------------



-------------Coding----------------------------

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       Literal1.Visible = False
       Literal1.Text = ""
   End Sub
   Public Sub show(ByVal msg As String)
       Literal1.Text = "<div style='width=1px;height=1px' onresize=\"this.style.display='none';alert('" + msg + "');\"/>" +
           "<script language='javascript'> alert('" + msg + "');</script>";
   End Sub

推荐答案



请在页面加载事件中添加以下代码.

如果不是IsPostBack,则
Hi,

Please add the following code in page load event.

If not IsPostBack then
Literal1.Visible = False
      Literal1.Text = ""



如果结束

希望对您有帮助.

问候,
Kiran.



End if

Hope it will help you.

Regards,
Kiran.


我刚刚写了它对我有用的
I just wrote this it worked for me
Literal1.Text="<div style='width=1px;height=1px' onresize=\"this.style.display='none';alert('" + msg + "');\"/>" +
   "<script language='javascript'> alert('" + msg + "');</script>";




您的报价出现问题




Some Problem in your Quotes


这篇关于脚本语言未运行..........请帮助任何人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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