Master Pages and service reference

A

Alex

I created a web service in my web application that needs to update a session
variable. I call the web service from a master page using java script. My
Script Manager is defined as

<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Services>
<asp:ServiceReference Path="~/Web Services/e2WS.asmx"
InlineScript="True" />
</Services>
</asp:ScriptManager>


In my webmethod, I do a simple Session["Culture"] = culture;, but I get the
following error: Object reference not set to an instance of an object.

If I pass the value to a class that inherits from System.Web.UI.Page and I
try to set the session variable, I get the following error:
Session state can only be used when enableSessionState is set to true,
either in a configuration file or in the Page directive. Please also make
sure that System.Web.SessionStateModule or a custom session state module is
included in the <configuration>\<system.web>\<httpModules> section in the
application configuration.

Now, I made sure that enableSessionState and the
System.Web.SessionStateModule is included in m,y config file, but still no
luck.

Is this something to do with the fact that the java script started off in
the master page which inherits from System.Web.UI.MasterPage?

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top