2012/04/19

2012/04/17

Gridview 跨欄置中


GridViewRow head = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);

TableCell header = new TableCell();
header.Text = "最新10筆";
header.HorizontalAlign = HorizontalAlign.Center;
header.ColumnSpan = 3;
header.BorderWidth = 0;
header.Font.Bold = true;
header.BackColor = System.Drawing.Color.Aqua;
head.Cells.Add(header);
GridViewTop10.Controls[0].Controls.AddAt(0, head);

必須要使用程式控制才行 = = 控件用選的沒得選


2012/04/10

jQuery jCalendar



http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/
inlineDatePicker.html


http://tedserbinski.com/jcalendar/index.html


拿來取代掉ASP.Net貧弱的日曆控件....

如果是要用下拉版可以選 jQuery UI-Datepicker

http://docs.jquery.com/UI/Datepicker
http://jqueryui.com/demos/datepicker/

http://my-web-design.blogspot.com/2010/10/jquery-ui-datepicker.html


--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 114.36.52.65

C# 非同步 vs 跨執行緒問題

直接跑 IAsyncResult 在 Debug Mode 下時會產生跨執行緒問題

原因似乎是 IAsyncResult 企圖存取UI的主執行緒

但不用偵錯模式跑就沒事了 = =

http://www.dotblogs.com.tw/yc421206/archive/2011/01/03/20540.aspx

網路上找到的解法似乎是必須建立委派事件才行

但我不會啊 ~"~

http://social.msdn.microsoft.com/forums/zh-TW/233/thread/47d4b39e-7af0-4875-a6
9b-e36e0a932b87





http://msdn.microsoft.com/zh-tw/library/ms228969%28v=vs.80%29.aspx

Memo著等之後教到再來看吧



--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 114.36.52.65

2012/04/05

Visual Studio .config 加解密


http://msdn.microsoft.com/zh-tw/library/ms254494.aspx
http://www.dotblogs.com.tw/yc421206/archive/2009/04/15/8010.aspx

WinForm:

    // Takes the executable file name without the
    // .config extension.
    try
    {
        // Open the configuration file and retrieve
        // the connectionStrings section.
        Configuration config = ConfigurationManager.
            OpenExeConfiguration(ConfigurationUserLevel.None);

        ConnectionStringsSection section =
            config.GetSection("connectionStrings")
            as ConnectionStringsSection;

        if (section.SectionInformation.IsProtected)
        {
            // Remove encryption.
            section.SectionInformation.UnprotectSection();
        }
        else
        {
            // Encrypt the section.
            section.SectionInformation.ProtectSection(
                "DataProtectionConfigurationProvider");
        }
        // Save the current configuration.
        config.Save();
        MessageBox.Show(String.Format("Protected={0}",
section.SectionInformation.IsProtected));
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }



WebConfig:

    // Open the Web.config file.
    Configuration config = WebConfigurationManager.
        OpenWebConfiguration("~");

    // Get the connectionStrings section.
    ConnectionStringsSection section =
        config.GetSection("connectionStrings")
        as ConnectionStringsSection;

    // Toggle encryption.
    if (section.SectionInformation.IsProtected)
    {
        section.SectionInformation.UnprotectSection();
    }
    else
    {
        section.SectionInformation.ProtectSection(
            "DataProtectionConfigurationProvider");
    }

    // Save changes to the Web.config file.
    config.Save();    // Open the Web.config file.
    Configuration config = WebConfigurationManager.
        OpenWebConfiguration("~");

    // Get the connectionStrings section.
    ConnectionStringsSection section =
        config.GetSection("connectionStrings")
        as ConnectionStringsSection;

    // Toggle encryption.
    if (section.SectionInformation.IsProtected)
    {
        section.SectionInformation.UnprotectSection();
    }
    else
    {
        section.SectionInformation.ProtectSection(
            "DataProtectionConfigurationProvider");
    }

    // Save changes to the Web.config file.
    config.Save();

--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 111.248.107.123

2012/04/03

Web.Config vs Bin

要放在同一層才有用 0rz

把web.config 放在wwwroot/web下面  可是bin放在wwwroot下面這樣會讀不到....

搞半天讀不到FCKeditor的問題竟然是這種蠢包

--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 61.224.48.4