21Apr
Posted by admin as .Net, Asp.Net, IIS7, Microsoft, Visual Studio, Web
It is very simple to get the name of the application pool current worker process is associated with in Asp.NET. You can simple use the server variables for that. For example, to display the app pool name on your web page you can simply use the below code snippet.
<%= Request.ServerVariables("APP_POOL_ID") %>
This is usually helpful when [...]
21Apr
Posted by admin as ATL, C#, MFC, Microsoft, Technology, VS 2010, VisualC, Windows
When you create a new ATL project in Visual Studio 2010, IDE generated StdAfx.h does not include the ATL namespace by default. Because of this behavior, when you try to use any ATL API (Like CComBstr for example) in your main cpp file, the build will fail with several “Undeclared Identifier” errors. Any existing project [...]
17Mar
Posted by admin as .Net, Asp.Net, Microsoft, Technology, Training
I just got this email from Microsoft. Hope this helps some one waiting to get certified for .Net Framework 4 Development. It seems slots are very limit, register asap.
You are invited to take part in one or more beta exams for Visual Studio 2010 and the Microsoft .NET Framework 4.
If you pass one of the [...]
You can use Microsoft.Web.Administration namespace to create a binding and set the certificate hash. Let us say you are trying to add a new binding to a website “MySite” with a new SSL certificate hash “MyCertHash”, here is what you have to do to achieve this
ServerManager serverManager = new ServerManager();
serverManager.Sites["MySite"].Bindings.Add("*.443:", MyCertHash, "MyCert");
The bindings member configures [...]
18Dec
Posted by admin as .Net, Asp.Net, Technology, Visual Studio, Web
On some occasions you might want to deploy the Asp.Net MVC application to avoid compiling it yourself etc. You can achieve this by following the below steps
Create an ASP.NET website project in Visual Studio
Add a reference to the System.Web.Mvc.dll (and any other DLLs that your application might need)
Copy the web.config from regular ASP.NET MVC project [...]
17Sep
Posted by admin as .Net, Asp.Net, Microsoft, Technology, Web
On some occasions you would want to run some code for every change in the configuration file, like reload the cache etc.. A change in web.config prompts the app domain to reload. So one should be able to look for application domain shutdown reason to verify a configuration change. Here is how you do can [...]
15Sep
Posted by admin as .Net, Asp.Net, HTML, Microsoft, Technology, Web
On some occasions, you wish to initialize your Asp.net application even before it receives its first hit to get rid of any over heads like creating application domain, initializing the .net runtime environment etc.. To achieve this you can use aspnet_compiler to pre-compile ‘in-place’, so that in effect the application is primed. Compiling ‘in-place’ the [...]
15Sep
Posted by admin as .Net, Asp.Net, Microsoft, Technology, Web
For the starters, Adaptive control behavior is control behavior that is customized for target devices. ASP.NET provides an adaptive architecture that allows key life cycle stages of a control to be intercepted and substituted with custom behavior. A common example of adaptive control behavior is adaptive rendering where an ASP.NET Web page is rendered specific [...]
In a code behind file (like .cs file), one can use aliases for the namespaces like
using myAlias = System.MyNamespace;
But to achieve the same functionality in an .aspx page you can use something like this
<%@ Import Namespace="myAlias=System.MyNamespace" %>
Note: There should not be any spaces in the namespace value. For example you cannot use something like Namespce=”myalias [...]
14Jul
Posted by admin as Microsoft, Technology, Windows
Windows SDK installation fails with following error
A problem occurred while installing selected Windows SDK components.
Installation of the "Microsoft Windows SDK for Windows 7" product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm document for further information.
Please attempt to resolve the problem and then start Windows SDK setup again. If you continue to have problems [...]