asp.net 2.0:ObjectDataSource 控件生成严格意义上的多层 Web 应用程序


WaitU@...(52748176) 11:47:36
ASP.NET 2.0 Framework 并利用 ObjectDataSource 控件生成严格意义上的多层 Web 应用程序。

做什么的,没有看明白
willsun(11757173) 11:48:34
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string mode = Request.Params["Mode"];
            if (!string.IsNullOrEmpty(mode) && mode == "Insert")
            {
                labStatus.Text = "增加";
                dvRole.ChangeMode(DetailsViewMode.Insert);
            }
            if (!string.IsNullOrEmpty(mode) && mode == "Update")
            {
                labStatus.Text = "修改";
                dvRole.ChangeMode(DetailsViewMode.Edit);
            }
            if (!string.IsNullOrEmpty(mode) && mode == "Browse")
            {
                labStatus.Text = "查看";
                dvRole.ChangeMode(DetailsViewMode.ReadOnly);
            }
        }
    }

    protected void ibOK_Click(object sender, ImageClickEventArgs e)
    {
        string mode = Request.Params["Mode"];
        if (!string.IsNullOrEmpty(mode) && mode == "Insert")
        {
            dvRole.InsertItem(true);
        }
        if (!string.IsNullOrEmpty(mode) && mode == "Update")
        {
            dvRole.UpdateItem(true);
        }
        Response.Redirect("~/RoleManager.aspx");
    }

    protected void ibCancel_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("~/RoleManager.aspx");
    }

    protected void dvRole_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        e.Values["RoleId"] = Guid.NewGuid();
    }
闲人(99282890) 11:48:38
ObjectDataSource 这个东西很好用
willsun(11757173) 11:49:10
这个是,添加修改查看的代码,少吧
WaitU@...(52748176) 11:49:34
添加和查看不需要新的页码?
WaitU@...(52748176) 11:49:49
也用2005,可是看来哦已经落伍了
willsun(11757173) 11:50:04
我用gridview和detailsview做,2个页面
╓jeky↓(7331756) 11:50:12
willsun这个真棒!
willsun(11757173) 11:50:18
呵呵
╓jeky↓(7331756) 11:50:32
ObjectDataSource 是.net2.0自带的?
willsun(11757173) 11:50:33
配上codesmith更棒
willsun(11757173) 11:50:36

╓jeky↓(7331756) 11:50:57
好!学学!
willsun(11757173) 11:51:06
我现在是用data application+codesmith+objectdatasource
willsun(11757173) 11:51:13
做东西很快
闲人(99282890) 11:51:15
ibatis

转载于:https://www.cnblogs.com/duliang/archive/2006/09/08/498721.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值