Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8070595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:26:06+00:00 2026-06-05T13:26:06+00:00

I have a situation: I upload user controls in a webapp and then load

  • 0

I have a situation:

I upload user controls in a webapp and then load them when needed. Sometimes I dont want some of them. So I would want to DELETE them from my web application.

Here is the hierarchy where the controls are found.

/controls
/controls/uc/
/controls/uc/ctrl1/ctrl1.ascx (with ctrl.ascx.cs)
/controls/uc/ctrl2/ctrl2.ascx (with ctrl.ascx.cs)

Now from a delete.aspx, I have this code from where I pick the directory structure. and pick up the control directory “ctrl1(n)” and delete the directory with delete recursive.

When the deletion is over, I redirect the page using asp.net’s redirect function. But as soon as the web page is redirected, the session is over and it asks me to login (as the only logged in users can delete the controls)

Why is that strange behaviour?

Remember, none of the code is found in app_code, all controls are put under website root as shown in the above.

Edit: Of course its not PRECOMPILED!

Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:26:07+00:00Added an answer on June 5, 2026 at 1:26 pm

    Ok, I spent some time on solving this issue… It sounds like it may not be a solution but so far what I wanted has been achieved.

    What I did was that I defined session state as "StateServer" and when I deleted the folders it restarts the application pool but the session remains alive. Since the application pool recycling is dependent upon several factors including the deletion of website’s subfolders so you cant happen to stop it but can actually retain the session. If you delete folders, it wont cause loss of session but of course application will be restarted that you have to accept at any cost!

    Anyway,

    I used following config node in my web.config on my hosting:

    <system.web>
        <sessionState mode="StateServer"  cookieless="false" timeout="20" />
    </system.web>
    

    And of course did this on my localhost:

    <system.web>
        <sessionState mode="StateServer"  stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="20" />
    </system.web>
    

    Note: On localhost you must start your ASP.NET State Management Service

    Summary:

    1. You must define SessionState as StateServer or SqlServer in order to retain sessions. That is least you can do.

    2. When developing such applications you MUST give them a way out to cope with the application restart cycles.

    3. You must keep session variables as simple as possibles, do not put large objects or objects that depend upon many other objects. Serialization and deserialization takes lot of time to get them back and fro.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where user upload a new file when file successful submitted
We have a situation where users are allowed to upload content, and then separately
I have situation where a user can manipulate a large set of data (presented
I have situation like this: user submits form with action='/pay' in '/pay' I have
I have a situation in which a managed DLL calls some unmanaged DLL. I
I have a feature on my site where a user can upload a background
I have a situation where I need to write some unit tests for some
I have a weird situation, client does't want their application to support multitasking so
If I have situation like below, where I success. handle image upload and store
I have a situation here where I need to upload an Excel sheet on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.