Monday, December 13, 2010

Disable the Back button in Browser

You can use either server side solution or client side (javascript solution)

Server side
After logging out use this code,

Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)


client side
include the following text in the head portion of each page.

<script>
  history.forward();
</script>

Thursday, December 9, 2010

Query to get All Column names of a table in Sql server

Solution

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tablename'