Tuesday, April 21, 2009

Using App_Offline feature when updating your web site

Hi Guys,
Here's the convenient way to bring down an ASP.NET web site while we update it. Just create an App_Offline.htm file and place it to the root directory of the web site. Whenever the ASP.NET engine finds this file in the root directory, it will render App_Offline.htm for any request that is directed towards the web site.

Here is the sample listing for App_Offline.htm:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html
xmlns="http://www.w3.org/1999/xhtml" >

<head>
<title>Site Under Construction</title>
</head>
<body>
<h1>Under
Construction</h1>

<h2>This site will be up
again from 9:00 pm...We regret for
the inconvinience</h2>
<!--
Adding additional hidden content so that IE Friendly Errors
don't
prevent
this message from displaying (note: it will show a
"friendly" 404
error if the content isn't of a certain size. Best if the
size is
>= 512 bytes. Thanking scott for pointing this workaround
tip).
<span>We regret for the inconvinience. We regret for the
inconvinience.
We regret for the inconvinience. We regret for the
inconvinience. We regret for
the inconvinience. We regret for the
inconvinience. We regret for the inconvinience.
We regret for the
inconvinience. We regret for the inconvinience. We regret for
the
inconvinience. We regret for the inconvinience. We regret for the inconvinience.
We regret for the inconvinience. We regret for the inconvinience. We regret
for
the inconvinience. We regret for the inconvinience. We regret for the
inconvinience.
We regret for the inconvinience. </span>
-->
</body>
</html>
That's it.

Monday, March 23, 2009

Unrecognized tag prefix or device filter 'asp'

The solution to this error can be found here.
The short version – if you’re using (nested) master pages and you’re seeing all of your tags underlined and complaining with “Unrecognized tag prefix or device filter ‘asp’.”, the solution is to keep your (nested) master page open in Visual Studio. That’s right – it sounds ugly – but that’s the fix.
So, if you have a Page that references a master page called ChildMaster.master which references ParentMaster.master, you should open ChildMaster.master (even if you don’t plan to make any changes to it) and leave it open in the VS IDE while you work on pages that refer to it.
Hopefully this will be fixed in the upcoming update.

Tuesday, March 17, 2009

How to Optimize Scalability for ASP.NET Web Applications

Web applications based on Microsoft ASP.NET technology are increasingly being used in high-transaction environments with thousands of users. As a result, these applications are being hosted in Web farms consisting of multiple Web servers with a load balancer.
With this increased load, many applications are experiencing major performance and scalability bottlenecks. Enterprise managers are either already grappling with these issues or are unknowingly on a fast track to crash right into those troubled areas. Scalability means keeping the same performance even during peak usage times or while supporting a higher number of users in general. More...

Thursday, July 31, 2008

This is a marker file generated by the precompilation tool, and should not be deleted!

We precompiled our aspx files without problem. The precompilation process work fine. After the precompilation process finsihed, We move all the file to the IIS and when we run the aspx file in the browser we see: "This is a marker file generated by the precompilation tool, and should not be deleted!" and not the original file rendered.

The following are the ways I would use to overcome this problem:

1. Make sure you have also uploaded the PrecompiledApp.config file and check if its not containing any illegal characters in it. Remove if it has.

2. This also occurs when IIS has lost its mappings to ASP.NET. Then try this...

a. Open a command prompt
b. Change to the following directory (or whatever version of the .NET Framework you are using): C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
c. Run the command "aspnet_regiis.exe -i". This may take several minutes and will report the success/failure of the process.

Try now....worked? Yes (Cool)...or no (well sometimes it does not work, then reinstall IIS.)

Monday, May 26, 2008

Cannot convert from 'anonymous method' to 'System.Predicate'

List<MyClass> list = // get list

outputList = list.FindAll(delegate(MyClass item)
{
if (condition)
{
return true;
}

}
);

When compiling, we get a strange error message:
"cannot convert from 'anonymous method' to 'System.Predicate'".

Only when we tried to explicitly cast the anonymous delegate to a Predicate we get a proper compiler error:
'System.Predicate': not all code paths return a value'

Hope this helps

Thanks and Regards,

Hemant

Wednesday, June 20, 2007

Using the PayPal Payment System in ASP.NET

Those who create commercial sites are faced with the question: "How do I receive payments?" One of the most popular payment systems in the world is PayPal. This system is often chosen because it is reliable, easy to use, and allows an account to be opened easily. Click title to learn more...