2012年8月29日 星期三

Sharepoint Foundation Server 上的Office Web Apps無法啟動?

今天架了一個Sharepoint Foundation Server 2010 + SQL 2008 R2 Express with Reporting Service + Office Web Apps 在 不加入網域的獨立Server 2008 R2上, 安裝過程一切順利. 但是Word檔一直無法用網頁編輯. 明明已經啟動Office Web Apps但編輯時一直說我沒有啟動.

突然想起我因為是獨立Server, 所以是用內部IP來設定使用的. 所以馬上改成在hosts中增加一個電腦名對照, 再改用電腦名來設定並使用就一切OK啦!

Sharepoint Foundation Server 2010 + Office Web Apps 的使用心得如下 :
1.線上預覽編輯僅限Word.(免費果然不是好事)
2.我用1顆4核 + 4G Ram的VM來跑, 編輯一個Word時, 開網頁就要將近兩分鐘. 怪不得微軟建議要雙4核CPU + 16G的RAM來供10個人同時編輯. 真是個坑爹的貨啊.

2012年5月31日 星期四

第一次部署ASP.NET網站(耍笨全記錄)

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月22日 星期二

Webform's GridView使用DropDownList時, 如何不用隱藏欄位來傳遞原值呢?

ASP的程式片段


                       <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();                   
                    }
                }
....}}