ASP Web Forms Error: Session state can only be used when enableSessionState is set to true

Hello,
I am developing a custom application page for a custom Web Forms I am creating, which I plan on using for custom task form into SharePoint 2010 Foundation.
Currently, I am trying to test it in Debug Mode using Visual Studio 2010 but when I am trying to use Sessions I get the 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
I've already done this on trying to fix:
On my page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestForm.aspx.cs" Inherits="TestForm" EnableSessionState="True" %>
And on my web.config
<pages enableSessionState="true">..<httpModules>
<remove name="Session" />
  <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</httpModules>
Note: I am getting an error when I try to add <module> into web.config
ASP .NET State Service is currently running.
And the part where it keeps error is when in PageLoad, I try to set a List object something like this:
List<object> myobject
get
if (Session["object"] == null)
Session["object"] = new List<object>();
return Session["object"] as List<object>;
set
Session["object"] = value;
protected void Page_Load(object sender, EventArgs e)
myobject= new List<object>();
BUT the error still persists! I also try to restart IIS but still the error still happens.
I am running out of ideas so can you help me out?
Thank you!

Could be your skype intercepting your requests at 80 port, in Skype options uncheck
Or Your IE has connection checked for Proxy when there is no proxy
Or your fiddler could intercept and act as proxy, uncheck it!
Solves the above problem, It solved mine!
HydTechie
HydPhani

Similar Messages

  • Session state can only be used when enablesessionstate is set to true.

    When I try to open up a certain webpage it says; Session state can only be used when enablesessionstate is set to true. What does it mean and what should I do?

    Contact the webmaster for that site and report the problem.

  • AIR 3.8.0.440 / iOS: build fails with "ld: -pie can only be used when targeting iOS 4.2 or later"

    With AIR 3.8.0.440, iOS build with "adt -package -target ipa-ad-hoc" fails with a linker error:
    ld: -pie can only be used when targeting iOS 4.2 or later
    What's the correct option to suppress this error or does it need a fix for adt?
    In the app.xml,
    <key>MinimumOSVersion</key>
                <string>5.0</string>
    is already present in the iPhone InfoAdditions section.
    (Building the same app with AIR 3.8.0.370 is fine)

    Hi,
    Can you make sure that both your old ane and new ane are not present in your extensions directory.
    Also, how are you zipping/unzipping the ANE?
    If you are on a Mac, try these steps on the terminal:
    1) Create a new temp directory, say temp (mkdir temp)
    2) cd temp
    3) Copy the ane you need to make changes to into this directory.
    4) unzip nameofane.ane
    5) rm nameofane.ane
    6) Make changes to the platform.xml file using a text editor or vim
    7) cd to the temp directory again, (if you are now elsewhere)
    8) zip -r nameofane.ane .
    9) Copy the ane file created into your extensions directory, where you have placed the other extensions and then, package the IPA using adt.
    If you are on Win,
    1) Rename the .ane to .zip
    2) Extract the contents of .zip
    3) Make changes to platform.xml and save it.
    4) Go back to the directory where you extracted the files, select all the folders/files and right click to zip them back.
    5) Rename the .zip to .ane and then, package the IPA.
    It should work.

  • Error : Array constants can only be used in initializers

    Hello All,
    I am using tableview model and declared two-dimensional array.
    Getting error Array constants can only be used in initializers in the line retVal<i>[j] =  {  {  createBy,desc,dispName }  };
    String[][] retVal;
    retVal = new String[20][20]
    //Fetching IResorce propeties here
    int resourceCounter = 0;
    for (int i = 0; i < list.size(); i++) {
       for (int j = 0; j < i; j++) {
          IResource ir = list.get(i);
          createBy = ir.getCreatedBy();
          desc = ir.getDescription();
            dispName = ir.getDisplayName();
         retVal<i>[j] =  {  {  createBy,desc,dispName }  };
         resourceCounter++;
    return retVal;
    Please help me out.
    Thanks
    Risha                              }

    I created ArrayList 
    static public String[] colnames =
                   "News Title",
                   "Short Description",
                   "Published",
                   "Valid To",
                   "Read Count",
                   "Users Details",
                   "Reply" };
         public ArrayList createData() {
               ArrayList rowArrList = new ArrayList();
              ArrayList tableArrList = new ArrayList();
              String createBy = null;
              String desc = null;
              String dispName = null;
              String lastMod = null;
              String name = null;
              String resType = null;
              try {
                   com.sapportals.portal.security.usermanagement.IUser user = null;
                   user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
                   IResourceContext resourceContext = new ResourceContext(user);
                   String path = "/documents/Australia/News";
                   RID rid = RID.getRID(path);
                   com.sapportals.wcm.repository.IResource res =
                        ResourceFactory.getInstance().getResource(rid, resourceContext);
                   IProperty prop = null;
                   String propValue = null;
                   PropertyName propName = null;
                   if (res != null) {
                        if (res.isCollection()) {
                             ICollection collection = (ICollection) res;
                             IResourceList list = collection.getChildren();
                             int resourceCounter = 0;
                             for (int i = 0; i < list.size(); i++) {                              
    //                              for (int j = 0; j < i; j++) {
                                       IResource ir = list.get(i);
                                       createBy = ir.getCreatedBy();
                                       desc = ir.getDescription();
                                       dispName = ir.getDisplayName();
                                       lastMod = ir.getLastModifiedBy();
                                       name = ir.getName();
                                       resType = ir.getResourceType();
                                       rowArrList.add(createBy);
                                       rowArrList.add(desc);
                                       rowArrList.add(dispName);
                                       rowArrList.add(lastMod);
                                       rowArrList.add(name);
                                       rowArrList.add(resType);
                                       tableArrList.add(i,rowArrList);
                                  //}//Inside for loop
                             }//First for loop
                        }//Inside If
              } catch (ResourceException e) {
                   // TODO Auto-generated catch block
                   response.write("Error " + e.getMessage());
              } catch (UserManagementException ex) {
                   ex.printStackTrace();
                   response.write("Error " + ex.getMessage());
              return tableArrList;
          * Constructor.
         public TableViewBean() {
              ArrayList tabArr = createData();
              String[][] data = (String[][])tabArr.toArray();          
              model = new DefaultTableViewModel(data, colnames);
    Edited by: Risha on May 26, 2011 8:52 AM

  • Problem with ANE - "ld: -pie can only be used when targeting iOS 4.2 or later"

    I'm trying to compile a simple AIR Mobile app for iOS, incorporating an ANE to support Localytics
    http://flashsimulations.com/2012/06/18/localytics-adobe-air-native-extension/
    Compilation fails with the message "ld: -pie can only be used when targeting iOS 4.2 or later"
    Surely 7.0 is later than 4.2! (I'm using Flex 4.6 - AIR 3.9 SDKS). Tried building with FDT and with Flash CC, and against earlier versions of the iOS SDK (6.0, 5.0).
    Any suggestions?

    thanks, but can you be more specific? Presumably I add something in this part:
        <iPhone>
            <InfoAdditions><![CDATA[<key>UIDeviceFamily</key>
                                                  <array>
                                                      <string>1</string>
                                                      <string>2</string>
                                                  </array>
                                                  <key>UIStatusBarStyle</key>
                                                  <string>UIStatusBarStyleBlackOpaque</string>
                                                  <key>UIRequiresPersistentWiFi</key>
                                                  <string>YES</string>]]></InfoAdditions>
            <requestedDisplayResolution>high</requestedDisplayResolution>
        </iPhone>

  • Web service error: WS Security can only be applied on a SOAP document

    Hello,
    I am facing the problem that when calling a web service I got this error message:
    005056B855B2002A0000013B000032C70005105EF7348C38 : WS Security can only be applied on a SOAP document.
    Some information about the webservice:
    Transport Binding: HTTP SOAP with Attachments
    Authentication: Basic
    Netweaver version: 7.01.06
    The webservice is based on EJB. Basically I want to add two operations in the webservice: one to accept attachment as input. the other one returns a file as attachment.
    Does anyone knows why this happens and how to resolve it? Thanks in advance!
    Regards,
    Grant

    Grant,
    Please refer this SNote, it may help you...
    1319507 - Overview: Analysis of ABAP Web Service
    Configuration
    Warm Regards,
    Agustuss

  • Problem since upgrade to 2.0 "Error: Session state protection violation"

    I've upgraded to 2.0. Everything fine except one particular page when I submit it I get "Error: Session state protection violation". I have read up about session state protection, and it is turned off in my application. There are no items, pages or URLs that have any session state protection. There is nothing particularly different about this screen when compared to other screens that work. What can be causing this?
    Steve

    Steve - Thanks for putting that test case out there. This is an odd bug. It happens when you apply the read-only attribute to a "Display as Text (does not save state)" item. Normally, these items are not HTML input items on the page (you see only the value rendered). However, because of a bug, applying the read-only attribute causes an INPUT item to be created. This leads to the problem that you saw -- when an item that should never be POSTed because it is: a) an application item, b) a page item that has the Session State Protection attribute "Restricted - May not be set from browser", or c) a page item of display type "Display as Text (does not save state)", is POSTed, the Session State Protection violation is detected and reported. These checks are performed whether the Session State Protection feature is enabled for the application or not. The reason for that is that checking for cases(a) and (c) is always legitimate and checking for case (b) is always necessary because the Restricted attribute for page items of qualifying display types is always in effect.
    So the workaround in your case is not to use the read-only attribute for the display-only items. They are read-only anyway.
    Thanks again for pointing this out.
    Scott

  • Web form Error Number:-2147467259

    Dears,
    i'm facing the below error when running a web form
    Error Number:-2147467259
    Error Description:Unspecified error
    Error Source:msxml6.dll
    Page On which Error Occurred:/hfm/data/webformgenerated.asp
    would you please adivse.
    Thanks.

    The response buffer size of IIS Server has to be increased. Execute the below steps in HFM Web server:
    - Go to Start > All Programs > Oracle EPM System > Foundation Services > EPM system Configuration.
    - Select Configure Web Server under Financial Management > Configure IIS for Financial management Web Application > Click on Advanced Options.
    - Change the "Response Buffer Size to 1073741824 > OK > Next > Finish the configuration.

  • Cannot add Connected Service in asp.web form project in vs 2012

    Hi All,
    I m trying to add  Connected Service in asp.web form project in vs 2012 as shown below image. But my VS 2012 doesn't has that option as shown second image. Any help please.
    First image
    Second image 
    d.n weerasinghe

    Hi,
    If this is not a SharePoint related question, I would suggest you post it to Visual C# forum, you will get more help and confirmed answers from there.
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=csharpgeneral
    Best regards
    Patrick Liang
    TechNet Community Support

  • PowerView Errors in the metadata manager. The current model can only be expressed when the client is requesting tabular view metadata with VERSION restriction of 2.0 or later

    SQL 2012 SP 1 CU4 applied. Now getting " Errors in the metadata manager. The current model can only be expressed when the client is requesting tabular view metadata with VERSION restriction of 2.0 or later"
    Any ideas what could be causing it to send the incorrect version?

    amaltsev1,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Cannot submit app update - "Error The submission can only contain one appx or one appxbundle."

    I'm trying to submit my app update to the store and I get the following error:
    Error
    The submission can only contain one appx or one appxbundle.
    So I thought I should maybe utilize the "Delete" option to allow me to submit an updated appx or appxbundle (since these are the only file types that App Studio allows us to build). However, when I do, I get the
    following message:
    Can't delete this package
    You must have at least one 8.1 package in your submission.
    ... So I'm basically stuck. Can't delete to upload a new one. Can't upload a new one because there's one already there. It would be nice if you could automatically sunset the old appx/appxbundle package in favor of the new
    one.
    Update: Solved! Solution below.

    Since this is still an issue, shouldn't it be escalated for a fix so that the page works on any modern browser?
    I see two independent problems here:
    - Hitting Delete should work, not bash the user with a "You must have at least one 8.1 package in your submission." message (i.e. allow the developer to delete and then add a new file, if so desired). After all, when making the initial submission
    we are in the same situation (no file yet), so it can't be that bad, as long as this is checked for at a later stage.
    - Show that Replace button which seems to be hiding! If it is a Silverlight issue, why require Silverlight in the first place?
    P.S.: I am experiencing this with IE (no Replace button, Windows 8.1 x64 and latest updates).

  • Dep Error:AA687-You can only post in new year after closing the previous year.

    Hi Experts,
    I need solution on error while posting dep. we have new co cd started operative from Jan -14 . So while doing dep posting run we are getting error "AA687-You can only post in new year after closing the previous year".
    I searched and got that Note 144441 need to implement.
    Let me know whether is it fine to go ahead or Is there any alternative solution.
    Also i want to know what need to to be done after implementing this note.
    please reply , its bit urgent.
    Regards
    Atul

    Hi Deepanshu,
    Also the FI period is also closed 2013 so in this case do i need to open the same , correct? for running dep posting along with OAAQ opening for AA.
    Or the note implementation will take care all. instead of running dep , opening closed period.
    pls suggest.
    Regards
    Atul

  • Re:  "Item category K can only be used without account assignment"

    Hi,
    while creating PO from PR the following error is coming.
    "Item category K can only be used without account assignment"
    How to solve this
    Regards,

    Hello,
    Item category K cannot be used with an account assignment as the goods are not physically used in the company. The stock is stilla consignment stock and belongs to vendor. Using an account assignment will book the cost in the company's expenses.
    use an account assignment if required when you transfer from consignment to own stock.
    Hope this helps,
    Regards,
    VS

  • Condition type PR00 can only be used once

    Hi Experts,
    Im faced with a strange problem. Request your help in resolving it.
    I tried to create my own pricing procedure by copying from RVAA01. Then i deleted all the steps and created my own steps. But when im trying to save the document, it says PR00 can only be used once. I deleted this condition type and tried to save it, it again says K004 can only be used once. Even after deleting all the earlier conditions which i copied from RVAA01, why am i getting this error.
    Your help is most appreciated.
    Warm regards,
    Sarat.

    You have deleted a row (i.e. condition type, say PR00).
    After that click icon "Save".
    Then when you create condition type PR00, system shall accept it.
    Currently, you are deleting a condition type (PR00) but it is still "in memory" of the pricing procedure. You can not create the same condition type more than once in a pricing procedure. Therefore you can not create PR00 again & you are getting the error message.
    First remove PR00 from the memory of the pricing procedure by clicking "Save", & then you can re-enter the same cond type.

  • Can getGeneratedKeys() be used when executing batches of statements?

    Hi all,
    this question was posted in this thread:
    Can getGeneratedKeys() be used when executing batches of statements?
    but unfortunately I didn't find the answered appropriate.
    That thread is now locked, so I would like to start it again here.
    This is a summary of the other thread:
    Can you retrieve keys generated by a batch of insert statements? The following code produces an ArrayIndexOutOfBoundsException from the Oracle T4CNumberAccessor.unmarshalOneRow() method (see stack trace at the bottom of this message).
    The code is:
    String sql = "INSERT INTO FOO (ID, NAME) VALUES (FOO_SEQ.NEXTVAL, ?)";
    String generatedColumns[] = {"ID"};
    PreparedStatement pstmt = connection.prepareStatement(sql, generatedColumns);
    pstmt.setString(1, "A");
    pstmt.addBatch();
    pstmt.setString(1, "B");
    pstmt.addBatch();
    pstmt.setString(1, "C");
    pstmt.addBatch();
    //EXCEPTION OCCURS HERE
    pstmt.executeBatch();
    The exception is:
    java.lang.ArrayIndexOutOfBoundsException: 22
    at oracle.jdbc.driver.T4CNumberAccessor.unmarshalOneRow(T4CNumberAccessor.java:190)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:610)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10580)
    The only answer given was:
    "You should directly specify how big your batching is. For that reason you may use ExecutionContext where you can set setBatchingLimit(int) and setBatching(bool). This operation will tell execution context the size of supposed batching and also should be batching performed at all or not. You can add batching jobs but you can not execute the jobs without proper initialization of batching job size - it will fail with out of bounds."
    ExecutionContext is not something I found in jdbc drivers, so I'm a bit confused about this answer.
    Did anyone solve the problem?
    Thanks,
    Michele

    >
    We have the same problem. No solution so far.
    >
    I never found a definitive solution but testing seems to show that this is not possible.
    There is no code that can be written to get the generated keys if batching is used.
    This is because the 'getGeneratedKeys' method must be called on the prepared statement and would return the generated keys as a ResultSet object. But when batching there is only one prepared statement but multple sets of parameters, one for each batch entry.
    Thus there could only be one call to 'getGeneratedKeys' since there is only one prepared statement. This strongly implies that it is not possible to use 'getGeneratedKeys' when batching.
    See Retrieval of Auto-Generated Keys in the JDBC Dev guide
    http://docs.oracle.com/cd/B19306_01/java.102/b14355/jdbcvers.htm#CHDEGDHJ

Maybe you are looking for