Wednesday, August 12, 2009

Get a Filename from a Path in Javascript

Here's a quick Javascript function that will parse the filename from a path using regex. It looks for any letter or digit, hyphen, or underscore followed by a dot (.) followed by a letters or numbers for the extension.

function getFileName(path) {
return path.match(/[-_\w]+[.][\w]+$/i)[0];
}

Tuesday, August 4, 2009

Way to get Email Value from web.config in asp text box

<asp:TextBox ID="txtReportTo" runat="server" CssClass="inputbox" Text='<%# System.Configuration.ConfigurationManager.AppSettings["FromMailID"].ToString()%&rt;'
ReadOnly="true"&rt;</asp:TextBox&rt;