6月 23, 2010

「由於不支援指定的通訊協定,Windows Media Player 無法播放檔案。」

1. 點『開始』→『執行』,輸入『regsvr32 wmnetmgr.dll』,按『確定』。

2. 按『確定』後,再重新開啟廣播收聽。

6月 17, 2010

CSS 置底浮動footer


#bottombar { 


 background-color: #efefec; 


 position: fixed; !important; 


 width: 100%; 


 bottom: 0; 


 z-index: 5; 


 height: 34px; 


 border: 1px solid #999999; 


 background-repeat:repeat-x; 


 color:#FFFFFF; 


 _position:absolute; 


 _top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight); 


 }


6月 13, 2010

GridView 輸出成Excel


    Protected Sub bt_excel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bt_excel.Click
        Response.Clear()


        Response.AddHeader("content-disposition", "attachment;filename=Export.xls")
        Response.ContentType = "application/vnd.ms-excel"
        Dim sw As New System.IO.StringWriter()
        Dim htw As New HtmlTextWriter(sw)
        GridView1.HeaderStyle.BackColor = Color.White
        GridView1.HeaderStyle.ForeColor = Color.Black
        GridView1.AlternatingRowStyle.BackColor = Color.White
        GridView1.RowStyle.BackColor = Color.White
        '關閉換頁跟排序
        'GridView1.AllowSorting = false;
        'GridView1.AllowPaging = false;


        '//移去不要的欄位
        'GridView1.Columns.RemoveAt(GridView1.Columns.Count - 1);
        'GridView1.DataBind();


        '//建立假HtmlForm避免以下錯誤
        '//Control 'GridView1' of type 'GridView' must be placed inside
        '//a form tag with runat=server.
        '//另一種做法是override VerifyRenderingInServerForm後不做任何事
        '//這樣就可以直接GridView1.RenderControl(htw);
        Response.Write("<meta http-equiv=Content-Type content=text/html;charset=utf-8>")
        GridView1.RenderControl(htw)
        'Dim hf As New HtmlForm()
        'Controls.Add(hf)
        'hf.Controls.Add(GridView1)
        'hf.RenderControl(htw)


        Response.Write(sw.ToString())
        Response.End()
    End Sub


6月 10, 2010

Calendar有資料的日期標示其他顏色


Dim year, month, day As Integer
    Protected Sub ca1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles ca1.DayRender
        year = e.Day.Date.Year
        month = e.Day.Date.Month
        day = e.Day.Date.Day
        sds_count.SelectParameters("year").DefaultValue = year
        sds_count.SelectParameters("month").DefaultValue = month
        sds_count.SelectParameters("day").DefaultValue = day
        Dim dv As Data.DataView = sds_count.Select(DataSourceSelectArguments.Empty)
        If dv.Count <> 0 Then
            e.Cell.ForeColor = Drawing.Color.Peru
            'Response.Write(dv.Table.Rows(0)(0))
        End If