2013年4月23日
摘要: mvc4,DropDownList 阅读全文
posted @ 2013-04-23 19:30 DearBug 阅读(2040) 评论(0) 推荐(0) 编辑
  2013年1月12日
摘要: 在Sql Manage Studio中,按住Ctrl键,再右键选择小钥匙,就可以设置多个主键(比两个多多少?不懂) 阅读全文
posted @ 2013-01-12 12:29 DearBug 阅读(518) 评论(0) 推荐(0) 编辑
摘要: select ID,Name,Description,max(TheRight) as TheRight from( SELECTdbo.b_ApplicationModule.ID, dbo.b_ApplicationModule.Name,dbo.b_ApplicationModule.Description, dbo.b_RoleRight.TheRight AS TheRight FROMdbo.b_ApplicationModule LEFT OUTER JOIN dbo.b_RoleRight ON dbo.b_ApplicationModule.ID = dbo.b_RoleRi 阅读全文
posted @ 2013-01-12 00:40 DearBug 阅读(178) 评论(0) 推荐(0) 编辑
  2013年1月10日
摘要: GridView绑定SqlDataSource以后,我们做了增加和修改不会立即在看到,需要刷新页面,这时候只需要在后台添加 GridView1.DataBind();protected void saveButton_Click(object sender, EventArgs e) { GridView1.DataBind(); //重新绑定数据源 } 阅读全文
posted @ 2013-01-10 21:16 DearBug 阅读(701) 评论(1) 推荐(0) 编辑
  2013年1月4日
摘要: 1 数据库中保存图片名称 在gridview 中展示图片 (1)前台代码 <asp:GridView ID="gvwattaxhmentlist" runat="server" AutoGenerateColumns="False" SkinID="GvList" GridLines="None" OnRowCommand="gvwattaxhmentlist_RowCommand" OnRowDataBound="gvwattaxhmentlist_RowD 阅读全文
posted @ 2013-01-04 21:52 DearBug 阅读(265) 评论(0) 推荐(0) 编辑
摘要: <asp:DropDownList ID="nationDDL" runat="server"> <asp:ListItem Value="汉族" Selected="True">汉族</asp:ListItem> <asp:ListItem Value="壮族">壮族</asp:ListItem> <asp:ListItem Value="瑶族">瑶族</asp:ListItem> < 阅读全文
posted @ 2013-01-04 14:38 DearBug 阅读(262) 评论(0) 推荐(0) 编辑
  2013年1月3日
摘要: //遍历下拉列表,如果下拉列表有与数据库存放对应的值就选中,没有就添加并选中 for (int i = 0; i < housetypeDDL.Items.Count; i++) { if (housetypeDDL.Items[i].Value == housetype) {housetypeDDL.SelectedIndex = i; break; } else { index++;} } if (index == housetypeDDL.Items.Count) { ListItem li = new ListItem(housetype, housetype); housety 阅读全文
posted @ 2013-01-03 21:17 DearBug 阅读(251) 评论(0) 推荐(0) 编辑
摘要: protected void Page_Load(object sender, EventArgs e) { Int32 id = Convert.ToInt32(Session["houseID"].ToString()); DataClassesDataContext dcdc = new DataClassesDataContext(); b_house BHouse = dcdc.b_house.Single(p => p.ID == id);//获取需要更新的房源信息 xnameTXB.Text = BHouse.xname; } 阅读全文
posted @ 2013-01-03 16:57 DearBug 阅读(400) 评论(0) 推荐(0) 编辑
  2013年1月2日
摘要: protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate) { ((LinkButton)e.Row.Cells[4].Controls[0]).Attributes.Add("onclic 阅读全文
posted @ 2013-01-02 19:00 DearBug 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 在GridView中使用ImageField绑定图片,然后加入这句控制图片大小<ControlStyle Height="120px" Width="150px" /><asp:ImageField ShowHeader="True" DataImageUrlField="layout" HeaderText="图"> <ControlStyle Height="120px" Width="150px" /> </ 阅读全文
posted @ 2013-01-02 13:31 DearBug 阅读(3942) 评论(0) 推荐(0) 编辑