在网页中显示消息 [英] Displaying message in web page

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

问题描述





我正在使用主页和子页面。在子页面中,我正在使用与页面相关的更新面板内的更新面板和控件。插入或编辑记录时,我希望在页面顶部显示一条消息。消息应该保持几秒钟然后不可见。滚动页面时,消息应始终位于内容页面的顶部。请帮帮我。

解决方案

UISettings.ShowMessage(警报警报 - 成功,Buzz已成功删除,divMessage,ltlMessage);

< br>

第1步:

 Default.aspx 

< asp:ScriptManager ID = ScriptManager1 runat = server >
< / asp:ScriptManager >
< asp:UpdatePanel ID = UpdatePanel1 runat = server >
< ContentTemplate >
< asp:标签 ID = Label1 runat = 服务器 > 60 < / asp:标签 > ;
< asp:Timer ID = Timer1 runat = server Interval = 1000

ontick = Timer1_Tick >
< / asp:计时器 >
< / ContentTemplate >
< / asp:UpdatePanel >
Default.aspx.cs

protected void Timer1_Tick(object sender,EventArgs e)
{
int seconds = int.Parse(Label1 。文本);
if(seconds> 0)
Label1.Text =(seconds - 1).ToString();
else
Timer1.Enabled = false;
lblMessge.Visible = False;
}



在上面的代码中,代码标签可见= False

lblMessage: - 参考步骤2.





第2步:为你的信息换一个新的标签,给它如下



< asp:label id =lblMessagerunat =serverstyle =text-align:Centerauto =>< br mode =hold =/>你的Mesage<


Hi,

I am using master and child page. In child page, i am using update panel and controls inside the update panel relating to the page. When a record is inserted or edited, i want a message to be displayed at the top of the page. The message should stay for few seconds and then be invisible. When the page is scrolled, the message should always reside at the top of the content page. Please help me on this.

解决方案

UISettings.ShowMessage("alert alert-success", "Buzz Deleted Successfully", divMessage, ltlMessage);


Step 1:

Default.aspx

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
    <asp:Label ID="Label1" runat="server">60</asp:Label>
    <asp:Timer ID="Timer1" runat="server" Interval="1000"

        ontick="Timer1_Tick">
    </asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
Default.aspx.cs

protected void Timer1_Tick(object sender, EventArgs e)
{
    int seconds = int.Parse(Label1.Text);
    if (seconds > 0)
        Label1.Text = (seconds - 1).ToString();
    else
        Timer1.Enabled = false;
        lblMessge.Visible=False;
}


In the Above code let the Code Label be Visible=False
lblMessage :- refer to Step 2.


Step 2: Take a new Label for your message, Give its as follows

<asp:label id="lblMessage" runat="server" style=" text-align:Center" auto="><br mode=" hold=" />Your Mesage<


这篇关于在网页中显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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