Webpage does not show master page contents, Authentication=forms

Posted by Joggee | ASP.NET Tips, ASp.NET 2005, Web Config | Thursday 11 December 2008 6:21 pm

I was using form authentication in a web config and I have a Login.aspx page that I created based upon a “MasterPage.master” page.  Everything looks okay at design time but when I build the form and see in a broswer It was quit amazed that content of MasterPage were not displayed even no formatting, Even no  MasterPage.master or CSS were effecting.

I done configuration in a web config so If User start with “Default.aspx” It will be taken to the “Login.aspx” page because of below configuration settings.

    <authorization>
        <deny users=”?” />
    </authorization>
 
    <authentication mode=”Forms”>
      <forms loginUrl=”Login.aspx” path=”/” />
    </authentication>

I went into deep and come to know once you use authentication mode is equal to form, CSS or APP_THEME, or any content from master page are LOCKED.

You need to unlocked all the folder to get effect.

<location path=”Path of your CSS and Image file”  allowOverride=”true”> �
            <system.web>
                  <authorization>
                        <allow users=”*” />
                  </authorization>
            </system.web>
      </location>

Note : If you wanted to give more than one folder permission, you need to repeat the same code again and again.

Location tag should be placed properly otherwise It wont work.

Joggee.

How to change default browswer in ASP.NET?

Posted by Joggee | ASP.NET Tips, ASp.NET 2005 | Wednesday 20 August 2008 4:49 am

Its possible and simple, Why do we need to change the default browsewr, sometime when you install firefox or safari or any broswer it ask you to set as default browser which make setting for the complete system, then that becomes your default browser;to avoid this thing be sure when you are setting up or installing any new browser because that will prompt for making it as default.

Now If you would like to change your default broswer few steps and you will get your browser back.

You need to open your visual studio and on .aspx,html pages only.

Right click on a .aspx page/html in your solution explorer and select the “browse with” context menu option as shown below.

Browse With

 

In the dialog box you can select or add a browser.  If you want to add new broswer Safari in the list, click “add” and point to the safari.exe filename,Click the “Set as Default” button to make this the default browser when you run any page on the site.

Note that there is also an optional drop-down at the bottom of the dialog that lets you select the default browser window size when loading.  You can choose 800×600 or 1024×768 or any size which as per your resolutions settting.

Joggee

ASP.NET Useful Keyboard Commands

Posted by Joggee | ASP.NET Tips, ASp.NET 2005 | Thursday 3 July 2008 1:11 pm

Visual studio provide almost the same key combination what microsoft office has.

Some time we need to make all the text or Stored procedure texture in UPPER CASE for more readibility. Sometime in lower case. Visual studio does the same, but most of the developer use Microsoft word for this.

Here are the keys combination

Ctrl + Shift + U for “UPPER CASE”

Ctrl + U for “lower case”

How to create or add a Shortcut Icon to a Web Page,Logo with Address bar

Posted by Joggee | ASP.NET Books, ASp.NET 2005, Shortcut Icon | Monday 30 June 2008 11:03 am

What is shortcut Icon? As word specified shortcut ICON, Adding a website Logo as Icon to a Web page URL is called shortcut Icon. Any graphic can be display as logo to a windows Internet Explorer.

Shortcut icons are supported in Microsoft Internet Explorer 5 and later. Internet Explorer downloads a shortcut icon when a user first visits a Web page that has a valid icon.

For more clear concept It is highlighted in the below Image.

How to associate shortcut Icon with the webpage:
<
head>
<
LINK rel=”SHORTCUT ICON” href=”http://www.joggee.com/favicon.ico” type=”image/x-icon” />
</head>

Note:
In Internet Explorer 5 and 6, a shortcut icon does not display on the address bar unless the user chooses to add the page as a favorite.<script> <!– if ((navigator.appVersion.indexOf(”MSIE”) > 0) && (parseInt(navigator.appVersion) >= 4)) { var sText = “<u><span style=’color:blue;cursor:hand;’”; sText += “onclick=’window.external.AddFavorite(location.href,”; sText += “document.title);’>Add this page to your favorites</span></u>”; document.write(sText); } //–> </script> 

 

Useful link:
http://msdn.microsoft.com/en-us/library/ms537656(VS.85).aspx

URL Rewriting in ASP.NET with Sample Project

Posted by Joggee | ASP.NET Framework, ASP.NET Tips, ASp.NET 2005, Global.asax, URL Rewriting | Wednesday 11 June 2008 6:54 am

URL rewriting is the process of intercepting an incoming Web request and automatically redirecting it to a different URL.

To understand completely follow below link
http://msdn.microsoft.com/en-us/library/ms972974.aspx

In this article I am going make a simple example which will take only few minutes and you will learn how to achieve URL Rewriting.

I believe developer doesn’t have much time to read a complete article of 20 pages.

Here we go

Step 1
Create a table
(
POSTID INT
,
TITLE VARCHAR(255
),
BODY
TEXT
)

CREATE TABLE TESTTABLE

Insert some dummy values

INSERT INTO TESTTABLE (POSTID,TITLE,BODY) VALUES (1,‘ACCORDIAN CONTROL WITH SQL SERVER’,
‘ACCORDIAN CONTROL WITH SQL SERVER CONNECTIVITY JOGGEE
MADE A ARTICLE AND THAT IS THE BEST I THINK SO.’
)
GO
INSERT
INTO TESTTABLE (POSTID,TITLE,BODY) VALUES (2,‘Mouse over effect’
,
‘This is so simple and can found thousand places but I tried to make it more easier who
doesnt know the different between <asp:linked button> or anchor.’
)
GO

SELECT
* FROM
TESTTABLE

STEP – 2
Create a stored procedure
Create PROCEDURE PROC_TEST
AS

BEGIN
SELECT
‘<A HREF=Detail/’+REPLACE(TITLE,‘ ‘,‘_’) +‘~’ + CONVERT(VARCHAR,POSTID) + ‘.ASPX>’ + TITLE + ‘</A>’ AS ‘TITLE’
,
BODY
FROM
TESTTABLE
END

GO

Procedure for Detail Page.
CREATE PROCEDURE PROC_TESTDETAIL
@ID
INT
AS

BEGIN
SELECT
POSTID,
TITLE
,
BODY
FROM
TESTTABLE
WHERE POSTID =
@ID
END
GO

Database work is finished, let move to ASP.NET project means Website Programming.
Create a Website, Ajax Enabled or not its up to you, No matter what you choose.

In a default webpage write below code. I am pasting the complete code for Default page. where i am using DataList direct binding with two field. 

<@ Page Language=”VB” AutoEventWireup=”true” CodeFile=”Default.aspx.vb” Inherits=”_Default” %>

 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
<
html xmlns
=”http://www.w3.org/1999/xhtml”>
<
head runat
=”server”>
<
title>BLOG.JOGGEE</title
>
</
head
>
<
body
>
<
form id=”form1″ runat
=”server”>
<
asp:ScriptManager ID=”ScriptManager1″ runat
=”server” />
<
div
>
<
asp:DataList ID=”DataList1″ runat
=”server”>
<
ItemTemplate
>
<
table width
=”100%”>
<
tr
>
<
td><%# Container.DataItem(“Title”)%></td
>
</
tr
>
<
tr
>
<
td><%#Container.DataItem(“Body”)%></td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
asp:DataList></div
>
</
form
>
</
body
>
</
html>   

In a Code Behind Past below code.

Imports System.Data
Imports System.Data.SqlClientPartial Class _Default
Inherits System.Web.UI.PageProtected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me

 

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me

 

.Load
If IsPostBack = False
Then
Dim
sqlConn As New
SqlConnection
Dim sqlCmd As New SqlCommand(“PROC_TEST”
, sqlConn)
Dim objDA As New
SqlDataAdapter
Dim DT As New
DataTable
‘******************************************************************************************************
‘I have mentioned this connection string in the web.config Change it with appropriate values.
‘<add name=”connString” connectionString=”Data Source=”DATABASE SERVER NAME”;Initial Catalog=”DATABASE NAME”;User=”USER”;Password=”PASWORD”;”/>
‘****************************************************************************************************************
sqlConn.ConnectionString = ConfigurationManager.ConnectionStrings(“connString”
).ConnectionString
‘opening a connection
sqlConn.Open()
sqlCmd.Connection = sqlConn
sqlCmd.CommandType = CommandType.StoredProcedure
objDA.SelectCommand = sqlCmd
‘populate data table
objDA.Fill(DT)
‘bind data
DataList1.DataSource = DT.DefaultView
DataList1.DataBind()
‘disposing all the declared objects.
objDA.Dispose()
objDA =
Nothing
sqlConn.Close()
sqlConn =
Nothing
sqlCmd.Dispose()
sqlCmd.Connection.Close()
sqlCmd =
Nothing
End
If
End
Sub
End
Class  

Code for Detail WebPage. 

Create a folder named “Detail” and add one more Default.aspx webpage. Please follow the instructions.

<% @ Page Language=”VB” AutoEventWireup=”false” CodeFile=”Default.aspx.vb” Inherits=”Detail_Default” %>

<! DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<
html xmlns=”http://www.w3.org/1999/xhtml”
>
<
head runat
=”server”>
<
title>Blog.Joggee</title
>
</
head
>
<
body
>
<
form id=”form1
runat=”server”>
<
div
>
<
asp:HyperLink ID=”HyperLink1
runat=”server” NavigateUrl=”~/Default.aspx”>Back</asp:HyperLink>
<
table width
=”100%”>
<
tr
>
<
td
>
Title
</
td
>
<
td
>
<
asp:Label ID=”lblTitle” runat=”server”></asp:Label
>
</
td
>
</
tr
>
<
tr
>
<
td style=”height: 191px” valign
=”top”>
Body:
</
td
>
<
td style
=”height: 191px”>
<
asp:TextBox ID=”txtBody” runat=”server” Height=”188px” TextMode=”MultiLine” Width=”975px”></asp:TextBox
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
form
>
</
body
>
</
html

In a Code Behind Just Copy Paste
Imports
System.Data
Imports System.Data.SqlClient 

Partial Class Detail_Default
Inherits System.Web.UI.Page

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then 

 Dim sqlConn As New SqlConnection

 Dim sqlCmd As New SqlCommand(“PROC_TESTDETAIL” , sqlConn)
Dim objDA As New SqlDataAdapter

 Dim DT As New DataTable

‘Here you can specify your connection string.

 sqlConn.ConnectionString = ConfigurationManager.ConnectionStrings(

“connString” ).ConnectionString

‘opening a connection

sqlConn.Open()

sqlCmd.Connection = sqlConnsqlCmd.CommandType = CommandType.StoredProcedure

sqlCmd.Parameters.Add(“@ID”, SqlDbType.Int).Value = Request.QueryString(“ID” )
objDA.SelectCommand = sqlCmd

‘populate data table

objDA.Fill(DT)

‘bind data

lblTitle.Text = DT.Rows(0)(“Title”

txtBody.Text = DT.Rows(0)(“Body”

‘disposing all the declared objects.

objDA.Dispose()

objDA =Nothing

sqlConn.Close()

sqlConn =Nothing 

sqlCmd.Dispose()

sqlCmd.Connection.Close() 

sqlCmd =Nothing

End If
End Sub
End Class


Add Global.asax file in the project on the root

<%@ Application Language=”VB” %>

 

<script runat=”server”>

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        ‘ Code that runs on application startup
    End Sub
    Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        ‘ Code that runs on application shutdown
    End Sub
    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        ‘ Code that runs when an unhandled error occurs
    End Sub
    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        ‘ Code that runs when a new session is started
    End Sub
    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        ‘ Code that runs when a session ends.
‘ Note: The Session_End event is raised only when the
‘ sessionstate mode
‘ is set to InProc in the Web.config file. If session
‘mode is set to StateServer�
 ‘ or SQLServer, the event is not raised.
    End Sub

 Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim Old As String
    Dim MovingPath As String
    Dim IncomingURL As HttpContext
    Dim StartingIndex As Integer
    Dim ID As String
IncomingURL = HttpContext.Current
Old = IncomingURL.Request.Path
‘here you can filtered with if condition if you don’t
 want any directory to be caught and redirected some where
  If Regex.IsMatch(Old, “/Detail/”) Then
      Old = Old.Replace(“.ASPX”, “”)
      StartingIndex = Old.IndexOf(“~”)
      ID = Old.Remove(0, StartingIndex + 1)
      MovingPath = “~/Detail/Default.aspx?id=” + ID.ToString
      IncomingURL.RewritePath(MovingPath)
  End If
End Sub
</script>

In a web.config Add this key

<connectionStrings>
<
add name=connString connectionString=Data Source=DATABASE SERVER NAME;Initial Catalog=DATABASE NAME;User=USER;Password=PASWORD;/>
</
connectionStrings>

Detail Page

.

 

 

 

 

CLICK HERE TO DOWNLOAD THE COMPLETE SAMPLE PROJECT

Joggee

How To Use Medium Trust in ASP.NET 2.0

Posted by Joggee | ASP.NET Tips, ASp.NET 2005, Ajax, DataReader | Monday 26 May 2008 6:10 am

Its hard to explain why this is happening to every 2nd developer and he is complaining about medium trust level problem with hosting company.

Microsoft explain step by step but still this problem doenst resolve WHY?

These steps are enough for developer. Why they are still complaining.

SOLUTION:

DONT USE DATAREADER WHEN YOU ARE BINDING YOUR DATA WITH DATAGRID, GRIDVIEW OR ANY CONTROL.

USE DATASET

NO need to follow below steps
NO need to do settings locally for your Application for Medium Trust Level.
Once you will deployed at hosted server, it will automatically inherit as medium trust level.

Microsoft said :

Summary of Steps
To use medium trust in your ASP.NET applications:

Step 1. Configure medium trust.
Step 2. Lock the trust level.
Step 3. Optionally create a custom policy based on medium trust.
Step 1. Configure Medium Trust
To configure an application to run with medium trust, add the following element to either the application’s specific Web.config file in the application’s virtual root directory or to the machine-level Web.config file.

 Copy Code
<trust level=”Medium” originUrl=”" />
  Note   If present, the originUrl attribute can be used by some permissions, such as WebPermission, to restrict connectivity to a defined set of addresses.
To configure all Web applications on a server to run with medium trust, add this element to the machine-level Web.config file located in the following folder: %windir%\Microsoft.NET\Framework\{version}\CONFIG.

By default, Web applications are configured to run with full trust as shown in the following default configuration from the machine-level Web.config file.

 Copy Code
<location allowOverride=”true”>
 <system.web>
   <securityPolicy>
     <trustLevel name=”Full” policyFile=”internal” />
     <trustLevel name=”High” policyFile=”web_hightrust.config” />
     <trustLevel name=”Medium”
                 policyFile=”web_mediumtrust.config” />
     <trustLevel name=”Low”  policyFile=”web_lowtrust.config” />
     <trustLevel name=”Minimal”
                 policyFile=”web_minimaltrust.config” />�
   </securityPolicy>
   <trust level=”Full” originUrl=”" />
 </system.web>
</location>
  To review the full set of permissions available to medium trust applications, view the Web_mediumtrust.config file.

Step 2. Lock the Trust Level
Application service providers or anyone responsible for running multiple Web applications on the same server should apply the medium trust policy setting in the machine-level Web.config file and then lock the trust level for all Web applications.

To do this, set the allowOverride attribute to false in the machine-level Web.config file, as shown in the following code example.

 Copy Code
<location allowOverride=”false”>
 <system.web>
   <securityPolicy>
     <trustLevel name=”Full” policyFile=”internal” />
     <trustLevel name=”High” policyFile=”web_hightrust.config” />
     <trustLevel name=”Medium”
                 policyFile=”web_mediumtrust.config” />
     <trustLevel name=”Low”�
                 policyFile=”web_lowtrust.config” />
     <trustLevel name=”Minimal”
                 policyFile=”web_minimaltrust.config” />�
   </securityPolicy>
   <trust level=”Medium” originUrl=”" />
 </system.web>
</location>
  By setting allowOverride=”false”, an individual developer is unable to override the medium trust policy setting in their application’s Web.config file.

Yours comments are valuable for me

Joggee

ASP.NET Accordion control with SQL Server Connectivity

Posted by Joggee | ASp.NET 2005, Ajax, Database Programming | Wednesday 14 May 2008 9:33 am

The Accordion is a web control that allows you to provide multiple panes and display them one at a time. It is like having several CollapsiblePanels where only one can be expanded at a time.

How to populate data from the SQL SERVER database and integrate with Accordion Control

 

I tried from the internet but hardly found something good which is so friendly.


I decided to make a code for this.
 

First create tables in the database 


CREATE
TABLE [dbo].[Category](

      [CategoryId] [int] IDENTITY(1,1) NOT NULL,

      [CatName] [nvarchar](50) NULL,

      [CatDesc] [nvarchar](255) NULL

)

 

CREATE TABLE [dbo].[SubCategory](

      [SubCategoryID] [int] IDENTITY(1,1) NOT NULL,

      [CategoryID] [int] NOT NULL,

      [SubCategoryName] [varchar](30) NULL

)

Inserting values for Main Category Table

 

Insert Into Category (CatName,CatDesc) Values (‘Hospital’,‘Hospital’)

Go

Insert Into Category (CatName,CatDesc) Values (‘School’,‘School’)

Go

Insert Into Category (CatName,CatDesc) Values (‘Hotel’,‘Hotel’)

 

Select * from Category

 

Result: 

 Category

 

Some values for Sub Category Table

 

Insert Into SubCategory (CategoryID,SubCategoryName) Values (1,‘Hospital 1′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (1,‘Hospital 2′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (1,‘Hospital 3′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (2,‘School 1′)

Go

Insert Into SubCategory (CategoryID,SubCategoryName) Values (2,‘School 2′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 1′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 2′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 3′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 4′)

Go

Select * from SubCategory

 

Result:

Sub Cateogry

 

Now we have two tables, let’s create a stored procedure.

 

CREATE PROCEDURE [dbo].[PROC_CATEGORY_GETALL]    

AS      

BEGIN 

 SELECT      

     DISTINCT CATEGORY.CATEGORYID,

     ISNULL(CATEGORY.CATNAME,) AS CATNAME     

 FROM

    CATEGORY

      

 SELECT      

      CATEGORY.CATEGORYID,
     
ISNULL(CATEGORY.CATNAME,) AS CATNAME,     

      ISNULL(SUBCATEGORY.SUBCATEGORYNAME,) AS SUBNAME

 FROM

      CATEGORY INNER JOIN SUBCATEGORY

      ON CATEGORY.CategoryID=SubCategory.CategoryID     

 ORDER BY CATEGORY.CATNAME ASC     

END 

 

GO

 

In the above stored procedure I am returning two tables, Main and Sub Category both, So I don’t need to go and touch database for each Category.

I don’t want for each Category it will go back and forth toward server.

 

Create any Webpage in your AJAX Enabled web application

 

In a Webpage ASPX write below code

 

<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”98%”>

  <tr>

      <td>

       <cc1:Accordion ID=”MyAccordion” runat=”Server” SelectedIndex=”0″ HeaderCssClass=”accordionHeader”HeaderSelectedCssClass=”accordionHeaderSelected” ContentCssClass=”accordionContent”AutoSize=”None” FadeTransitions=”true” TransitionDuration=”250″ FramesPerSecond=”40″ 

RequireOpenedPane=”false” SuppressHeaderPostbacks=”true”>

            </cc1:Accordion>

          </td>

        </tr>

 </table>

 

Now CODE Behind.


Private
Sub PopulateGrid()


   Dim sqlConn As New SqlConnection

   Dim sqlCmd As New SqlCommand(“PROC_CATEGORY_GETALL”, sqlConn)

 

   Dim DA As New SqlDataAdapter

   Dim ds As New DataSet

 

   Dim intRow As Integer

   Dim intRowPenal As Integer

 

   Dim acpPane As AjaxControlToolkit.AccordionPane

   Dim lblHeader As Label

 

   sqlConn = “Opened Connection”e.g.”openConnection()returns me a connection object”

   sqlCmd.Connection = sqlConn

   sqlCmd.CommandType = CommandType.StoredProcedure

   DA.SelectCommand = sqlCmd

   DA.Fill(ds)


  For intRow = 0 To ds.Tables(0).Rows.Count – 1

       lblHeader = New Label

       lblHeader.Text = ds.Tables(0).Rows(intRow)(“CatName”)

 

       acpPane = New AjaxControlToolkit.AccordionPane

       acpPane.HeaderContainer.Controls.Add(lblHeader)


      
Dim dv As DataView = ds.Tables(1).DefaultView
      
dv.RowFilter = “CATEGORYID=’” + ds.Tables(0).Rows(intRow)(“CATEGORYID”).ToString + “‘”

       Dim lblContent As New Label

       For intRowPenal = 0 To dv.Count – 1

            lblContent.Text = lblContent.Text & “<div style=’padding-top: 5px; padding-left: 10px;’><a href=’” & ResolveUrl(dv.Item(intRowPenal)(“SUBCATEGORYNAME”)) & “‘>” + dv.Item(intRowPenal)(“SUBNAME”) + “</a>” & “</div>”

      Next

      acpPane.ContentContainer.Controls.Add(lblContent)

      MyAccordion.Panes.Add(acpPane)

    Next

 

    DA.Dispose()

    DA = Nothing

    sqlCmd.Dispose()

    sqlCmd.Connection.Close()

    sqlCmd = Nothing

    sqlConn.Close()

    sqlConn = Nothing


  End Sub

 

Note : Change Sub Category Hyperlink as per your wish.

Leave your message if it solve your problem.

Joggee

kick it on DotNetKicks.com

Visual Studio 2005 , Web Project Deployment, Website DLL

Posted by Joggee | ASP.NET Tips, ASp.NET 2005, Visual Studio ASP.NET | Saturday 3 May 2008 12:13 pm

In Visual Studio 2005, they make it so simple to deploy a web site at hosting or any server.
In Visuaa Studio 2003, You need to create your different project and then take .DLL and .ASPX files CSS except code behind files. Look tiring work.
Microsoft work wonderful and make a executable file and in few steps you can deploy your website.

Here is the link to download
http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx

1.Download it and Install.
2.Open your visual studio if it is open already just restart it.
3.Right click on your web project solution.
4.Choose “Add Web Development Project”
5.Specify name and location for your web project.
6.It will be automatically added to your project.
7.Right click on it and choose property pages and do your required configuration if required otherwise default also work.
8.Choose Release from debug mode.
9.Right click on the webproject again and Build.
10.You are done. Your project is done and ready to deply. It will automatically add .aspx, css and all required files and folder for the project EXCEPT CODE “BEHIND SOURCE CODE”.


Assigning Session to nothing or Session.Abandon

Posted by Joggee | ASP.NET Tips, ASp.NET 2005 | Wednesday 16 April 2008 11:37 am

I have seen so many developers once they wanted to destroy session, they used

Session(”A”) = Nothing

Its not a good practice to assign nothing object.

Correct Way:

Session.Abandon

The Session.Abandon method basically destroys a user session.

One thing I would add the current Session object will not delete untill the script on the current page have been processed completely.

Best Way:

FormsAuthentication.SignOut()
Session.Abandon()

Use Forms Authentication.Signout which will removes the forms-authentication ticket from the browser.

TODO Comments

Posted by Joggee | ASP.NET Tips, ASp.NET 2005, Visual Studio ASP.NET | Monday 14 April 2008 1:09 pm

Follow these images one by one that will guide properly how to do this.

This article related to todo comments which I have already wrote long time back
Here are the steps which will help to achieve this. for more detail please check here my

old post

Write some comments and then select option as comments in the task list.
You can also choose your keyword with the different priority level.
Task list can be created same way comments created.

Next Page »