Forms Authentication Ignoring Default Document

This was my solution: In Global.asax, method: Application_BeginRequest, place the following: if (Request.AppRelativeCurrentExecutionFilePath == “~/”) HttpContext.Current.RewritePath(“HomePage.aspx”); Nice and simple, and you have a chance to build logic around what home page you want to use if your website uses multiple home pages based on configuration variables. Dmitry.Alk

SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified [closed]

If you are connecting from Windows machine A to Windows machine B (server with SQL Server installed), and are getting this error, you need to do the following: On machine B: 1.) turn on the Windows service called “SQL Server Browser” and start the service 2.) in the Windows firewall, enable incoming port UDP 1434 … Read more

Change Text Box Color using Required Field Validator. No Extender Controls Please

What you can do is register a Javascript function that will iterate through the global Page_Validators array after submission and you can set the background appropriately. The nice thing about this is that you can use it on all of your controls on the page. The function looks like this: function fnOnUpdateValidators() { for (var … Read more

HTTP Error 500.22 – Internal Server Error (An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.)

This issue is caused by the pipeline mode in your Application Pool setting that your web site is set to. Short Simple way Change the Application Pool mode to one that has Classic pipeline enabled. Correct way Your web.config / web app will need to be altered to support Integrated pipelines. Normally this is as … Read more

How to add a RequiredFieldValidator to DropDownList control?

For the most part you treat it as if you are validating any other kind of control but use the InitialValue property of the required field validator. <asp:RequiredFieldValidator ID=”rfv1″ runat=”server” ControlToValidate=”your-dropdownlist” InitialValue=”Please select” ErrorMessage=”Please select something” /> Basically what it’s saying is that validation will succeed if any other value than the 1 set in … Read more

Escape quote in web.config connection string

Use &quot; instead of ” to escape it. web.config is an XML file so you should use XML escaping. connectionString=”Server=dbsrv;User ID=myDbUser;Password=somepass&quot;word” See this forum thread. Update: &quot; should work, but as it doesn’t, have you tried some of the other string escape sequences for .NET? \” and “”? Update 2: Try single quotes for the … Read more

How do I fix the “compilerVersion” IIS error?

I had a similar problem and had to tell ASP.NET in configuration to use the 3.5 compiler as follows by modifying Web.config. I’ve copied and pasted the following from my code. You have to change value=”v3.5″ to value=”v4.0″. The compiler type strings might also change. <configuration> <!– … other configuraiton stuff … –> <system.codedom> <compilers> … Read more

Get a list of all active sessions in ASP.NET

I didn’t try rangitatanz solution, but I used another method and it worked just fine for me. private List<String> getOnlineUsers() { List<String> activeSessions = new List<String>(); object obj = typeof(HttpRuntime).GetProperty(“CacheInternal”, BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null); object[] obj2 = (object[])obj.GetType().GetField(“_caches”, BindingFlags.NonPublic | BindingFlags.Instance).GetValue(obj); for (int i = 0; i < obj2.Length; i++) { Hashtable c2 = (Hashtable)obj2[i].GetType().GetField(“_entries”, … Read more