1.Windows 2003 R2 + ASP.NET 4.0
有問題請參考保哥的說明來做喔
http://blog.miniasp.com/post/2010/06/IIS-6-ASPNET-4-Installation-Notes.aspx
2.Crystal report runtime無法正常執行嗎?
請參考(重點是rpt檔及安裝目錄)
http://www.langyuweb.com/a/wangluokaifa/2011/0901/4984.html
3.發佈時要注意所有DLL及Image是否有打包進去
http://www.dotblogs.com.tw/neil/archive/2012/02/11/68874.aspx
經過一番耍笨的動作..還是成功的將Web Form部署到Win2003 R2及Win2008兩個Server上了..
不過單鍵發行還是做不起來...:繼續努力吧!
2012年5月31日 星期四
2012年5月22日 星期二
Webform's GridView使用DropDownList時, 如何不用隱藏欄位來傳遞原值呢?
ASP的程式片段
asp.cs的程式片段
1.先定義Class變數
string Group;
<asp:TemplateField HeaderText="業務組"> <ItemTemplate> <asp:Label ID="Lab_Department" runat="server" Text='<%# Eval("Department") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddl_Department2" runat="server" Width="10em"></asp:DropDownList> </EditItemTemplate> <ItemStyle HorizontalAlign="Left" Wrap="False" /> </asp:TemplateField>
asp.cs的程式片段
1.先定義Class變數
string Group;
2.在GridView CaseLists的RowEditing的事件中把ItemTemplate中的原值存到Group.
protected void CaseLists_RowEditing(object sender, GridViewEditEventArgs e) { CaseLists.EditIndex = e.NewEditIndex; Group = ((Label)CaseLists.Rows[e.NewEditIndex].FindControl("Lab_Department")).Text.Trim(); BindOrder2(); }3.將SelectedValue設為Group即可....}}protected void CaseLists_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow)//判定当前的行是否属于datarow类型的行 { if ((e.Row.RowState & DataControlRowState.Edit) != 0) { if (e.Row.FindControl("ddl_Department2") != null) { //綁定業務組下拉選單 ((DropDownList)e.Row.FindControl("ddl_Department2")).DataSource = CreateDataTable(); ((DropDownList)e.Row.FindControl("ddl_Department2")).DataTextField = "Items"; ((DropDownList)e.Row.FindControl("ddl_Department2")).DataValueField = "Items"; ((DropDownList)e.Row.FindControl("ddl_Department2")).SelectedValue = Group; ((DropDownList)e.Row.FindControl("ddl_Department2")).DataBind(); } }
訂閱:
文章 (Atom)