您的位置:首页 > 移动开发 > Objective-C

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

2006-09-08 13:35 531 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐