How can I trigger a submit on my form when the enter key is pressed

Add this to the body element: <body MS_POSITIONING=’GridLayout’ onkeypress=’if(window.event.keyCode==13){ document.Form1.submit();}’> … </body> Also check out Andy Smith’s DefaultButton Control which triggers submit selectively on one of many buttons based on the context.

Why do some of the events on my page fire twice

This is probably because you explicitly subscribed to the events in code and also specified the AutoEventWireUp of Page to true (it’s true by default). If so, the Page_Load, for example, will be fired once for your event subscription and once because the Page subscribed it for you (by looking for a specific event handler method signature). To avoid this turn off AutoEventWireUp or remove your subscription code.

How to get list of all files in the directory

To get the list of aspx files under your app directory: Use namespace System.IO VB.NET Dim dirInfo As New DirectoryInfo(Server.MapPath(”)) DataGrid1.DataSource = dirInfo.GetFiles(‘*.aspx’) DataGrid1.DataBind() C# DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath(”)); DataGrid1.DataSource = dirInfo.GetFiles(‘*.aspx’); DataGrid1.DataBind(); The following aspx code will display the resultant files list in the DataGrid in a proper format: <asp:DataGrid runat=’server’ id=’DataGrid1′ AutoGenerateColumns=’False’> <Columns> <asp:HyperLinkColumn DataNavigateUrlField=’Name’ DataTextField=’Name’ HeaderText=’File Name’></asp:HyperLinkColumn> <asp:BoundColumn DataField=’LastWriteTime’ HeaderText=’Last Write Time’ DataFormatString='{0:d}’></asp:BoundColumn> <asp:BoundColumn DataField=’Length’ HeaderText=’File Size’ DataFormatString='{0:#,### bytes}’></asp:BoundColumn> </Columns> </asp:DataGrid>

How to specify a line break in a Label’s Text?

Use the ‘<br>’ tag to specify line breaks. For example: VB.NET Label1.Text = ‘<sometag1>’ + ‘<br>’ + ‘<sometag1>’ C# Label1.Text = ‘<sometag1>’ + ‘<br>’ + ‘<sometag1>’;