Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What does AspCompat="true" mean and when should I use it?

Answer Posted / swapna

AspCompat is an aid in migrating ASP pages to ASPX pages.
It defaults to false but should be set to true in any ASPX
file that creates apartment-threaded COM objects--that is,
COM objects registered ThreadingModel=Apartment.

That includes all COM objects written with Visual Basic
6.0. AspCompat should also be set to true (regardless of
threading model) if the page creates COM objects that
access intrinsic ASP objects such as Request and Response.
The following directive sets AspCompat to true:


<%@ Page AspCompat="true" %>
Setting AspCompat to true does two things. First, it makes
intrinsic ASP objects available to the COM components
by placing unmanaged wrappers around the equivalent ASP.NET
objects.

Second, it improves the performance of calls that the page
places to apartment- threaded COM objects by ensuring that
the page (actually, the thread that processes the request
for the page) and the COM objects it creates share an
apartment.

AspCompat="true" forces ASP.NET request threads into single-
threaded apartments (STAs). If those threads create COM
objects marked ThreadingModel=Apartment, then the objects
are created in the same STAs as the threads that created
them. Without AspCompat="true," request threads run in a
multithreaded apartment (MTA) and each call to an STA-based
COM object incurs a performance hit when it's marshaled
across apartment boundaries.

Do not set AspCompat to true if your page uses no COM
objects or if it uses COM objects that don't access ASP
intrinsic objects and that are registered
ThreadingModel=Free or ThreadingModel=Both.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which method do you use to kill explicitly a users session?

1001


What are Caching techniques in .NET

992


How can we inherit a static member?

1012


What are the contents of cookie?

1055


Out of ASP or ASP.NET which one is stateless?

1161


Why session is more secure than cookies?

856


How is a session stored and maintained in asp.net?

945


Do I need to have the latest version of windows media player installed?

917


What is Dynamic Web and discuss its usage with the help of real life examples?

991


Can you change a Master Page dynamically at runtime?

923


What is viewstate parameter?

891


What is authentication in asp.net?

1020


Which is an advantage of application service providers?

849


Explain difference betn dataset and recordset?

885


Explain the difference between an exe and a dll?

957