After logout, back button in browser should not open the secured page visited earlier.

7. March 2013

Solution to this problem is
We have to add these four lines in every page ( which you want to make not cacheable ) . I have added these lines in Masterpage on OnInit() function.

protected override void OnInit(EventArgs e)
{
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
Response.Cache.SetNoStore();
base.OnInit(e);
}

ASP.NET ,

Login failed for user 'IIS APPPOOL Classic .NET AppPool' when trying to connect to a SQL SERVER using Windows Authentication

5. March 2013

The solution i found for this problem is on this blog post .

 

http://stackoverflow.com/questions/4736140/login-failed-for-user-iis-apppool-classic-net-apppool

 

  • Go into IIS Manager
  • On the node with your computer name, select "Application Pools"
  • Click "Classic .NET AppPool" and select "Advanced Settings..."
  • Select "Identity" property and change its value to "LocalSystem"

IIS

Query to verify case sensitive columns in SQL SERVER having Case insensitive Collation

2. March 2013

How to to verify case sensitive columns in SQL SERVER having Case insensitive Collation.

Use this query

SELECT * FROM LoginData WHERE username ='something' AND password COLLATE SQL_Latin1_General_CP1_CS_AS LIKE 'askjashAA';
OR

SELECT * FROM LoginData WHERE username LIKE 'something' AND password COLLATE SQL_Latin1_General_CP1_CS_AS LIKE 'askjashAA';

 

SQL ,

How to disable default click of a hyperlink in html

2. March 2013

How to disable default click of a hyperlink in html

We can use below statement in href of any hyperlink tag .

<a href='javascript:;' >something</a>

Javascript

Suddenly my controls stop working and postback was fired when clicking buttons

1. March 2013

Suddenly my controls stop working and no postback was fired when buttons clicked . This problem occurred because i added  by mistake some html code in my form which included its own form hence my already working controls stopped .

ASP.NET

Query for getting the childtable no of rows related to one single row in parent table

28. February 2013
SELECT TOP 5 temp.totalcomments,NewsLetter.title,NewsLetter.nID 
FROM
(SELECT NewsLetter.nID,NewsLetter.title ,COUNT(a.nID) AS TotalComments
FROM NewsLetter LEFT OUTER JOIN (select nID from Comments where approved='true') as a
ON a.nID=NewsLetter.nID
GROUP BY NewsLetter.nID,NewsLetter.title) AS temp,Newsletter
WHERE scID=10 AND temp.nID=NewsLetter.nID AND trash='false'
ORDER BY totalcomments DESC;

SQL

How can I sort List<T> based on properties of T ?

28. February 2013

A very good answer to this problem is provided on this blog post .

http://stackoverflow.com/questions/605189/how-can-i-sort-listt-based-on-properties-of-t

 

_list.Sort((a,b)=> String.Compare(a.Name,b.Name));

 

_list.Sort((a,b)=> a.SomethingInteger.CompareTo(b.SomethingInteger));

C# ,

System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client

27. February 2013

This error comes when you try to get user input in raw html through a textbox control in order to resolve this you will have to include ValidateRequest="false"

in

<%@ Page Title="" ValidateRequest="false" Language="C#" MasterPageFile="" AutoEventWireup="true" CodeBehind="" Inherits="" %>

and also you will have to include this

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime requestValidationMode="2.0"/>
</system.web>
</configuration> 

in your web.config file

ASP.NET

Migrate TFS 2010 Project Collection to another TFS 2010 server

27. February 2013

This is a nice blog post for migrating TFS 2010 Project Collection to another TFS 2010 server

http://rmlinar.net/blog/2011/12/27/migrate-tfs-2010-project-collection-to-another-tfs-2010-server/

Team Foundation Server 2010

TFS 2010 Error : TF255374 The default collation is set to Latin1_General_CI_AI

23. February 2013

[Configuration Database] TF255374: The following SQL Server instance is not compatible with Team Foundation Server: VBXW2008\SQLSVR08. The default collation is set to Latin1_General_CI_AI. Team Foundation Server requires that the default collation be case insensitive and accent sensitive. You must choose a SQL Server instance whose default collation settings match these requirements

 

The best option i found out was either i re-install the SQL SERVER 2008 again fresh or create a new instance with collation settings defined properly at the time of installation . 

Team Foundation Server 2010 ,