Back in classic ASP.NET I’d persist data extract from a web service in base class property as follows: private string m_stringData; public string _stringData { get { if (m_stringData==null) { //fetch data from my web service m_stringData = ws.FetchData() } return m_stringData; } } This way I could always simple use _stringData and know that... Continue Reading →
C# Reading content from text files
This is something I do frequently, and I always forget the streaming syntax, so here it is. There are couple of ways to do this. Firstly, from an application: From the properties panel, set the Build Action as Resource and the Copy to Output Directory as Copy Always From code this can then be accessed... Continue Reading →
Using ASPNET_RegSQL.exe with SQL Express databases in APP_DATA
As discussed at Lance's Whiteboard, a really easy way to hook up an ASPNET membership provider database to an application ... perfect for rapid prototyping... "Creating a new DB in VisualStudio.NET 2005 is as simple as "Select APP_DATA node -> Add New Item -> Sql Database" and wah-lah you have a new aspnet.mdf file located... Continue Reading →
App_Offline.htm
Cracking informational post from Scott Guthrie - and I can't believe I'd never heard of this before!! Original post from Scott: http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx: Basically, if you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shut-down the application, unload the application domain from the server, and stop processing... Continue Reading →
ASP.NET Write Permissions
When writing a file from ASP.NET application, the target directory needs to have write permissions set for both the logged in account (maybe IUSER_[name]) and also the IIS_WPG account.For example, writing a file to http://localhost/app/results, where the application root (http://localhost/app/) maps to C:\Inetpub\wwwroot\app\The permissions on the root folder (C:\Inetpub\wwwroot\app\) can be readonly, but the permission... Continue Reading →