aspx Tutorial

.NET Articles,jQuery demo, with jQuery, online tutorial,Jquery, SilverLight, Javascript,,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT, Building Your First Web Application Project
Advertise Here


Get our toolbar!


Posted by Aamir Hasan   on Sunday, February 27, 2011 Total Views:  

Web services have not any mechanism by which can maintain state. But web services  can access objects like Session, Application and so on if they are inherit from web services bass class.

In this article, I would demonstrate how Session and Application Object can maintain by Web Services. I have created a web form called Session-Application.aspx, which only includes a buttons named. If you click on a button, an event is triggered, and the Web service calls:

Session Object

Session objects store information between HTTP request for a particular user.


<html xmlns="">

<head runat="server">




    <form id="form1" runat="server">



            <asp:Button ID="BtSession" runat="server" Text="Session"
 OnClick="BtSession_Click" />








    protected void BtSession_Click(object sender, EventArgs e)


        Session["Session"] = "";


        MyWebServices WS = new MyWebServices();

        Object T = WS.getSessionValue();






    Protected Sub BtSession_Click(sender As Object, e As EventArgs)      

        Session("Session") = ""      

        Dim WS As New MyWebServices()

        Dim T As [Object] = WS.getSessionValue()


    End Sub


Here is a preview of the Object that will be returned.


Application Object

Application object can be used in situation where we want data to be shared across users globally.


Session-Application.rar (2.36 kb)

See Live Demo

Protected by Copyscape Online Plagiarism Tool

Comments (3) -

hogan scarpe
hogan scarpe People's Republic of China
7/12/2012 11:34:02 PM #

Though facilitating payment program, these outlets <a href="">hogan scarpe</a> helps you to access broad array of collections at sensible  rates.

GATE coaching in Bangalore
GATE coaching in Bangalore India
2/5/2013 11:33:06 PM #

GATE coaching in Bangalore, GATE coaching center in bangalore, IES coaching  in Bangalore, PGCET coaching in Bangalore, GATE coaching bangalore at global academy.

Shila Commendatore
Shila Commendatore United States
9/20/2013 3:06:39 AM #

Hi there, I discovered your web site by means of Google while searching for a comparable subject, your website got here up, it appears great. I have bookmarked it in my google bookmarks. United States
3/8/2014 8:20:23 PM #

I constantly emailed this webpage post page to all my associates, because if like to read it next my friends will too.|

Chinese Restaurant Supplies
Chinese Restaurant Supplies United States
3/22/2014 1:49:32 PM #

I like it whenever people come together and share thoughts. Great website, keep it up!|

Add comment

  Country flag

  • Comment
  • Preview

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5