The perennial problem of exporting to Excel from an ASP.NET application: Excel has been uninstalled, upgraded or the web app has been removed to a new virtual instance with no Excel. So to get around I have started using openXML and imported the excellent class developed and provided by Mike Gledhill. It has worked first time and all of the time on any app I have deployed.
|If zip files are being downloaded without .zip extension in VB.NET use the following:
Response.ContentType = "application/x-zip-compressed";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName );
|The most irritating and unpredictable error message I have encountered in ASP.NET has to be
BC30456: ‘InitializeCulture’ is not a member of…
Thankfully there is a fix here, the one that worked for me was switching off Debug in Web.config
Simply add return false; to OnClick as shown below:
<button onclick=’doTest();return false;’>Click me</button>
|This article is very useful for looking at ways of “Ajaxifying” (has to be a word? if it isn’t Copyright jhunter 2012) your asp.net web app when retrieving data from backend.
Personal favourite has to be handler (.ashx) pages!
Simple, elegant, effective way of validating email addresses in VB.NET, on VB forums: http://www.vbforums.com/showthread.php?t=407441
Function EmailAddressCheck(ByVal emailAddress As String) As Boolean
Dim pattern As String = “^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$”
Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)
If emailAddressMatch.Success Then
EmailAddressCheck = True
EmailAddressCheck = False
Hold down the ALT key and type 02217
Full list available here: http://tlt.its.psu.edu/suggestions/international/accents/codealt.html#math
Very simple: OnClientClick=“aspnetForm.target =’_blank’;”
Great article on 4guysfromrolla explaining how to create a tag cloud in ASP.net. Read it here