顯示具有 程式設計、asp.net、c# 標籤的文章。 顯示所有文章
顯示具有 程式設計、asp.net、c# 標籤的文章。 顯示所有文章

2011年11月3日 星期四

FileHelper C# 好用的Text file 讀寫 Library

http://filehelpers.sourceforge.net/
The FileHelpers are a free and easy to use .NET library to import/export data from fixed length or delimited records in files, strings or streams.

The idea is pretty simple:

You can strong type your flat file (fixed or delimited) simply describing a class that maps to each record and later read/write your file as an strong typed .NET array

The Library also has support for import/export data from differents storages like Excel, Access, SqlServer, etc.

2007年7月6日 星期五

在網頁按Enter時如何觸發button click event (asp.net)

今天在測試時意外發現,當User在網頁按Enter時,是不會觸發button click event 的,google 了一下,發現這個網頁
http://www.beansoftware.com/ASP.NET-Tutorials/Accept-Enter-Key.aspx

重點就是在ASP.NET 2.0 form or panel 有提供一個 defaultbutton 這個屬性,只要設定 defaultbutton ="buttonYouWant" ,當User在網頁按Enter時,就會觸發button click event 。





 <form defaultbutton="button1" runat="server">
    <asp:textbox id="textbox1" runat="server"/>
    <asp:textbox id="textbox2" runat="server"/>
    <asp:button id="button1" text="Button1" runat="server"/>

    <asp:panel defaultbutton="button2" runat="server">
        <asp:textbox id="textbox3" runat="server"/>
        <asp:button id="button2" runat="server"/>
    </asp:panel>

</form>