zoukankan      html  css  js  c++  java
  • RadToolTip (点击按钮,弹出ToolTip)

    View Code
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Demo.aspx.cs" Inherits="WebApplication.Demo" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
    .toolTipStyle
    {
    background
    -color: #ECEDE5;
    }
    </style>
    <script type="text/javascript" src="../Common/Js/My97DatePicker/WdatePicker.js"></script>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">

    /************************弹出ToolTip*************************/
    var toHide
    = false;

    function OnClientBeforeHide(sender, args) {
    if (!toHide) args.set_cancel(true);
    }

    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest
    (
    function (sender, args) {
    toHide
    = false;
    if (args.get_postBackElement().id == "btnAdd") {
    var tooltip
    = $find("<%=RadToolTip1.ClientID%>");
    tooltip.show();
    }
    var tooltip
    = $find("<%=RadToolTip1.ClientID%>");
    tooltip.show();
    }
    );
    function GetActiveToolTip() {
    var tooltip
    = Telerik.Web.UI.RadToolTip.getCurrent();
    return tooltip;
    }
    //关闭ToolTip
    function CloseToolTip() {
    var tooltip
    = GetActiveToolTip();
    if (tooltip != null && tooltip.get_id() == "RadToolTip1") {
    toHide
    = true;
    tooltip.hide();
    }
    }
    </script>
    <div style="text-align: center">
    <asp:Button ID="btnAdd" runat="server" Text="新增" ToolTip="新增" />
    </div>
    <telerik:RadToolTip ID="RadToolTip1" runat="server" Modal="true" ShowEvent="FromCode"
    Position
    ="Center" RelativeTo="BrowserWindow" OnClientBeforeHide="OnClientBeforeHide"
    EnableShadow
    ="true" HideEvent="FromCode" Width="400" Height="200" Animation="Resize"
    CssClass
    ="toolTipStyle">
    <asp:UpdatePanel runat="server" ID="UpdatePanel2">
    <ContentTemplate>
    <asp:Panel ID="pStopCusTrack" runat="server" Style="padding-left: 5px;" CssClass="toolTipStyle"
    Height
    ="200">
    <center>
    <table>
    <tr>
    <th colspan="3">
    学生信息
    </th>
    </tr>
    <tr style="height: 10px">
    <td>
    </td>
    <td>
    </td>
    <td>
    </td>
    </tr>
    <tr>
    <td align="right">
    <asp:Literal ID="lStuName" runat="server" Text="学生姓名:"></asp:Literal>
    </td>
    <td align="left">
    <asp:TextBox ID="txtStuName" runat="server" Width="90%"></asp:TextBox>
    </td>
    <td>
    <b style="color: Red; text-align: center;">*</b>
    <asp:RequiredFieldValidator ID="rfvStuName" runat="server" Display="None" ControlToValidate="txtStuName"
    ValidationGroup
    ="Save" ErrorMessage="学生姓名不能为空!"></asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td align="right">
    <asp:Literal ID="lStuSex" runat="server" Text="性别:"></asp:Literal>
    </td>
    <td align="left">
    <asp:RadioButtonList ID="rblStuSex" runat="server" RepeatColumns="2" Width="90%">
    <asp:ListItem Text="" Value="1" Selected="True"></asp:ListItem>
    <asp:ListItem Text="" Value="0"></asp:ListItem>
    </asp:RadioButtonList>
    </td>
    <td>
    </td>
    </tr>
    <tr>
    <td align="right">
    <asp:Literal ID="lStuAge" runat="server" Text="年龄:"></asp:Literal>
    </td>
    <td align="left">
    <telerik:RadNumericTextBox ID="rntbStuAge" runat="server" MinValue="0" MaxValue="100"
    EmptyMessage
    ="请输入年龄!" NumberFormat-DecimalDigits="0" Width="90%">
    </telerik:RadNumericTextBox>
    </td>
    <td align="left">
    <b style="color: Red;">*</b>
    <asp:RequiredFieldValidator ID="rfvStuAge" runat="server" Display="None" ControlToValidate="rntbStuAge"
    ValidationGroup
    ="Save" ErrorMessage="年龄不能为空!"></asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td align="right">
    <asp:Literal ID="lBirthday" runat="server" Text="出生日期:"></asp:Literal>
    </td>
    <td align="left">
    <asp:TextBox ID="txtBirthday" runat="server" onfocus="WdatePicker({isShowClear:true,readOnly:true})"
    Width
    ="90%"></asp:TextBox>
    </td>
    <td>
    <b style="color: Red;">*</b>
    <asp:RequiredFieldValidator ID="rfvBirthday" runat="server" Display="None" ControlToValidate="txtBirthday"
    ValidationGroup
    ="Save" ErrorMessage="出生日期不能为空!"></asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td align="right">
    <asp:Literal ID="lAddress" runat="server" Text="家庭住址:"></asp:Literal>
    </td>
    <td align="left">
    <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" Width="90%"></asp:TextBox>
    </td>
    <td>
    </td>
    </tr>
    <tr>
    <td colspan="3">
    <asp:Button ID="btnSave" runat="server" Text="保存" ToolTip="保存" ValidationGroup="Save" />
    &nbsp;
    <input type="button" onclick="CloseToolTip()" title="关闭" value="关闭" />
    </td>
    </tr>
    </table>
    </center>
    </asp:Panel>
    </ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
    </Triggers>
    </asp:UpdatePanel>
    </telerik:RadToolTip>
    <asp:ValidationSummary ID="vsValidation" ValidationGroup="Save" runat="server" ShowMessageBox="true"
    ShowSummary
    ="false"></asp:ValidationSummary>
    </form>
    </body>
    </html>

  • 相关阅读:
    【3006】统计数字
    【5001】n皇后问题
    【7001】n阶法雷序列
    【9402】倒序数
    【9705】&&【a801】细胞
    【9802】闭合曲线面积
    【a803】营救
    【9112】求2的n次方的精确值
    V8引擎实现标准ECMA-262(三)
    仔细看看Javascript中的逻辑与(&&)和逻辑或(||)
  • 原文地址:https://www.cnblogs.com/ywblog/p/2176252.html
Copyright © 2011-2022 走看看