by pmcgann
8. May 2012 21:58
This is a simple example of showing a loading image while an update panel is waiting to load.
Go to this site and generate a loading image : Ajax Image Generator
Then add an update progress control to your page where the update control is and set the AssociatedUpdatePanelID to that of your update panel.
Inside the update progress add the progress template and then insert the image that you generated at the previous site.
Below is a example of this:
<asp:UpdatePanel ID="up_controls" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="ph_controls" runat="server"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress AssociatedUpdatePanelID="up_controls" ID="up_progress" runat="server">
<ProgressTemplate>
<div class="form-content">
<p>
<img src="images/ajax-loader.gif" alt="Loading" />
</p>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
by pmcgann
8. May 2012 21:36
If you need to validate a site design against Web Content Accesibility Guidelines (WCAG). Visual Studio has a nice feature that you can turn on and it will validate your markup for you.
To enable this right click on the project and go to start options.
In the left panel select 'Build' then check the checkboxes that read:
- include accessibility validation when building page.
- include accessibility validation when building web.
See the image below for an illustration.

by Jeremy Brown
1. May 2012 20:41
You may have noticed in ASP.NET when you do a postback on the page it loses the URL rewriting so something like www.mysite.com/news-article-1 becomes www.mysites.com/news.aspx?id=1
I found a solution to this here http://stackoverflow.com/questions/5191612/asp-net-postbacks-creates-problem-in-url-rewriting
In the Master Page page load event place the following code:
form1.Action = Request.RawUrl;
form1 being the id of your form tag.
by Colin Graham
19. April 2012 00:36
by Gavin
11. April 2012 19:02
by Colin Graham
2. February 2012 02:08
One painful experience we have had this week has been in converting some data from one of our databases into a .csv. This sounds simple doesn't it ?? however there were very specific requirements as the .csv had to be imported into a second system.
We were using the stringbuiler.append method but found that the only way this would work was via the Stringbuilder.appendline method.
anyway hope this can help someone else out there.
C
by Colin Graham
20. January 2012 01:27
Please follow the procedure below to register ASP.NET:
- Open Command Prompt.
- Change directory as follows:
- For 32-bit machines change to:
<WindowsDir>\Microsoft.NET\Framework\<version number>\
- For 64-bit machines change to:
<WindowsDir\Microsoft.NET\Framework64\<version number>\
- Run the command ‘aspnet_regiis.exe -i’ and press enter.
5aff86f8-e5d9-4ab5-8d73-181c5c285e06|0|.0
Tags:
ASP.Net
by Colin Graham
19. December 2011 18:56
by Colin Graham
27. October 2011 21:51
- Basically go to IIS and right click on the Websites then properties.
- select "Custom Errors"
- Scroll down to the error and select the corresponding error number
- select edit
- eneter the path of the file you wish to redirect to.
Do not do an automatic link back to your homepage as this will look like duplicates in SEO
bf4ccc66-dccf-46ec-8455-c7d02b692eeb|0|.0
Tags:
ASP.Net
by Colin Graham
27. October 2011 21:04
Within IIS you need the following lines of code:
Withing the node of web.config section of web.config you need the next 2 lines in the correct order:
<verb="GET" path="/Robots.txt" type="HandlerExample.MyHttpHandler">- this one handles the robots.txt file
<add path="*.txt" verb="GET" type="System.Web.StaticFileHandler" /> - this one handles other .txt files and serves them corectly
Within a class you will need the code to handle the robots file that is written out dynamically.
Getting IIS to Pass .txt Requests to ASP.NET
At the moment, IIS is still serving the txt files instead of letting .NET know about them – the request for a .txt file doesn’t even reach .NET. Lets tell IIS to pass that request through to .NET.
Get the path to the ASPX engine
- Open IIS and right click on your website and bring up the properties screen
- Go to Home Directory > Configuration. You will be on the Mappings Tab.
- Locate the ASPX item and click Edit – Copy the path in the Executable Field and cancel out of that window. We don’t want to change anything there – we just want the path
Create the ISAPI Entry for .txt
You are still on the Mappings Tab for your site in IIS 1. Click “Add” 2. Populate the Executable path with the value you copied in the last section 3. Enter “GET” in the “Limit To” field 4. Untick the box "Verify that file exists". Press OK a million times to save all your changes. You’re done with IIS.
Check the result
When you now try to browse to your text file you should get a blank page. This means IIS is now passing the request to ASP.NET, but ASP.NET doesn’t know what to do with it.