脚本语言未运行..........请帮助任何人
问题描述:
<%@ 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