简体   繁体   English

telerik RadNotification 在更新面板中显示警报客户端

[英]telerik RadNotification show alert client side in update panel

I am trying to show alert message using RadNotification instead of regular web alert from javascript. Its not working for me not sure why.我正在尝试使用 RadNotification 而不是来自 javascript 的常规 web 警报来显示警报消息。它对我不起作用,不知道为什么。 Any input is appreciated.任何输入表示赞赏。

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
    <telerik:RadNotification ID="RadNotificationAlert" runat="server" Position="TopCenter" Width="500"
        Height="125" OnCallbackUpdate="RadNotificationAlert_CallbackUpdate" OnClientShowing="OnClientShowing"
        LoadContentOn="EveryShow" AutoCloseDelay="120000" RenderMode="Lightweight" Title="Error" 
        Skin="MetroTouch" EnableRoundedCorners="true" VisibleOnPageLoad="false"  
        ShowCloseButton="false" KeepOnMouseOver="false" CssClass="timeoutNotification" ShowSound="info"  Style="z-index: 300000">
        <ContentTemplate>
            <div class="notificationContent">
                <asp:Literal ID="lblRadNotificationAlert" ClientIDMode="Static" runat="server"></asp:Literal>
                <telerik:RadButton Skin="MetroTouch" ID="continueSession" runat="server" Text="Continue Your Session"
                    Style="margin-top: 10px;" AutoPostBack="false" OnClientClicked="RadNotificationAlertClientClose" Width="190px">
                </telerik:RadButton>
            </div>
        </ContentTemplate>
    </telerik:RadNotification>
    < More code here >   
</ContentTemplate>
</asp:UpdatePanel>   

In area here I have written Mode code here..one of which is a submit button.在这里的区域我在这里写了模式代码..其中一个是提交按钮。 on submit I do validation and if anything missing then show alert...that method I can see is getting called.在提交时,我会进行验证,如果有任何遗漏,则会显示警报...我看到的那个方法正在被调用。 Below is the javascript code:以下是 javascript 代码:

var radAlert = $('#<%=RadNotificationAlert.ClientID %>');
$('#lblRadNotificationAlert').text('select default template');
radAlert.show();
// alert('select default template');
return false;

In the commented code, I can see that alert.在注释代码中,我可以看到该警报。 When I put break point, I can see my code step through each line above.当我放置断点时,我可以看到我的代码逐步执行上面的每一行。 Why is the radAlert not showing then?为什么 radAlert 没有显示呢?

.notificationContent {
  width: 160px;
  vertical-align: bottom;
  text-align: center
}

RadWindowManager should be used if you want an "alert".如果你想要一个“警报”,应该使用 RadWindowManager。 I was using the incorrect control!我使用了不正确的控件!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM