第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

ASP.NET簡(jiǎn)化編輯界面 V3

標(biāo)簽:
JavaScript

近时间的开发专案中,再次对ASP.NET的编辑界面进行简化。从这里可以看到以前的两个版本简化:ASP.NET简化编辑界面ASP.NET简化编辑界面 V2

首先看看本次效果,本效果是在Microsoft Visual Studio 11 Beta 和 Microsoft SQL Server 2012 环境之下实现:


 

 编辑工具条写成为一个用户控件(UserControl):

5acf07270001405b00110016.jpgView Code <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Operation.ascx.cs" Inherits="SubscriptionControl_Operation" %>
<div style="position: absolute; top: 84.5px; left: 3px;">
<asp:Button ID="ButtonCreate" runat="server" Text="新建" OnClick="ButtonCreate_Click"  />&nbsp;<asp:Button
    ID="ButtonEdit" runat="server" Text="编辑" OnClick="ButtonEdit_Click"  Enabled="false" />&nbsp;<asp:Button ID="ButtonDelete"
            runat="server" Text="删除" OnClick="ButtonDelete_Click"  Enabled="false" />&nbsp;<asp:Button ID="ButtonCancel"
        runat="server" Text="取消" OnClick="ButtonCancel_Click"  Enabled="false" />&nbsp;<asp:Button ID="ButtonSave" runat="server"
                Text="保存" OnClick="ButtonSave_Click"  Enabled="false" />
</div>

 

Operation.ascx.cs:

5acf07270001405b00110016.jpgView Code using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Insus.NET;

public partial class SubscriptionControl_Operation : System.Web.UI.UserControl 
{
    public delegate void EventHandler(object sender, EventArgs e);

    public event EventHandler InsusCreate;
    public event EventHandler InsusCancel;
    public event EventHandler InsusEdit;
    public event EventHandler InsusDelete;
    public event EventHandler InsusSave;

    public Button CreateButton
    {
        get
        {
            return this.ButtonCreate;
        }
    }

    public Button EditButton
    {
        get
        {
            return this.ButtonEdit;
        }
    }

    public Button CancelButton
    {
        get
        {
            return this.ButtonCancel;
        }
    }

    public Button DeleteButton
    {
        get
        {
            return this.ButtonDelete;
        }
    }

    public Button SaveButton
    {
        get
        {
            return this.ButtonSave;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ButtonCreate_Click(object sender, EventArgs e)
    {
        if (InsusCreate != null)
        {
            this.ButtonEdit.Enabled = false;
            this.ButtonDelete.Enabled = false;
            this.ButtonCancel.Enabled = true;
            this.ButtonSave.Enabled = true;
            InsusCreate(this, e);
        }
    }

    protected void ButtonEdit_Click(object sender, EventArgs e)
    {
        if (InsusEdit != null)
            InsusEdit(this, e);
    }

    protected void ButtonCancel_Click(object sender, EventArgs e)
    {
        if (InsusCancel != null)
        {
            this.ButtonEdit.Enabled = false;
            this.ButtonCancel.Enabled = false;
            this.ButtonDelete.Enabled = false;
            this.ButtonSave.Enabled = false;
            InsusCancel(this, e);
        }
    }

    protected void ButtonDelete_Click(object sender, EventArgs e)
    {
        if (InsusDelete != null)
            InsusDelete(this, e);
    }

    protected void ButtonSave_Click(object sender, EventArgs e)
    {
        if (InsusSave != null)
        {
            this.ButtonEdit.Enabled = false;
            this.ButtonDelete.Enabled = false;
            this.ButtonCancel.Enabled = false;
            this.ButtonSave.Enabled = false;
            InsusSave(this, e);
        }
    }
}

 

页面实现的代码,由于没有使用到Javascript和JQuery,全是asp.net实现。因此代码就在此略了。

如果以后有时间或是把.NET实现的代码改为Javascript或是JQuery,一定会帖出来分享给大家。

 

 

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消