⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alwaysvisiblecontrol.aspx.cs

📁 AJAX 应用 实现页面的无刷新
💻 CS
字号:
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


using System;
using AjaxControlToolkit;

public partial class AlwaysVisibleControl_AlwaysVisibleControl : CommonPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // Because we use JavaScript to set the time and we're using an update
        // panel, refreshes cause the display to be blank until the next javascript
        // event fires.  To prevent it from not showing up, we'll always set it here
        // as well and let JavaScript overwrite it
        currentTime.InnerText = DateTime.Now.ToString("T");

        // Don't initially hook up the extender
        if (!IsPostBack)
            avce.Enabled = false;
    }

    /// <summary>
    /// Update properties of the extender
    /// </summary>
    protected void OnChange(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(ddlPosition.SelectedValue) || ddlPosition.SelectedValue.Length != 2)
        {
            avce.Enabled = false;
            return;
        }

        avce.Enabled = true;
        switch (ddlPosition.SelectedValue[0])
        {
            case 'T' :
                avce.VerticalSide = VerticalSide.Top;
                break;
            case 'M' :
                avce.VerticalSide = VerticalSide.Middle;
                break;
            case 'B' :
                avce.VerticalSide = VerticalSide.Bottom;
                break;
            default:
                avce.Enabled = false;
                return;
        }

        switch (ddlPosition.SelectedValue[1])
        {
            case 'L':
                avce.HorizontalSide = HorizontalSide.Left;
                break;
            case 'C':
                avce.HorizontalSide = HorizontalSide.Center;
                break;
            case 'R':
                avce.HorizontalSide = HorizontalSide.Right;
                break;
            default:
                avce.Enabled = false;
                return;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -