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 6729307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:16:26+00:00 2026-05-26T10:16:26+00:00

I did a file system like, with a tree view, and when I click

  • 0

I did a file system like, with a tree view, and when I click on a node I can see the files inside this node.

I have a problem now … When I click on a node I display the files but when I click on this same node , the files disapear .

This is a part of my code, PageLoad and also TreeViewLoad .

   protected void Page_Load(object sender, EventArgs e)
    {
        if ((Request.Cookies["UserSettings"] == null))
        {
            Response.Redirect("Logon.aspx");
        }
    }

    #region TreeView

    protected void MyTreeView_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int userid = Convert.ToInt32(Request.Cookies["UserSettings"]["Id"]);
            DbHelper Db = new DbHelper();

            root = Db.GetFoldersForUser(userid);

            TreeNode rootTreeView = new TreeNode("Projects");
            rootTreeView = LoadNodes(root.TopFolders, rootTreeView);

            MyTreeView.Nodes.Add(rootTreeView);
            MyTreeView.CollapseAll();

        }
    }

    #endregion

I’m fed up because I really can’t find the solution . Is it a problem of !Postback ? If someone has the solution please help me .

KR

  • 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-05-26T10:16:27+00:00Added an answer on May 26, 2026 at 10:16 am

    it because of you are populating the tree view dynamically .
    and on post back you are not instantiating it
    what else you can do is.

    1)put above code in page_init .
    2) fill the tree view in the way your doing.

    Or

    reomve the

        if (!IsPostBack) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem: I am choosing a file from JFileChooser and if i
I'd like to poll the file system for any changed, added or removed files
I have a JTree implementation for directories in the file system. The problem I
Did not have luck with these examples: Javascript File remove Javascript FSO DeleteFile Method
Did anyone try to read programmatically an Alibre Design CAD file? I see that
Does file_get_contents maintain line breaks? I thought it did but I have tried this:
I did it before... But I forgot. I have a file with some data:
I am interested in writing utf-8 encoded strings to a file. I did this
Acttualy this is my assignment.I have three-four file,related by student record.Every file have two-three
I have a strange file in my file system without the extension part. The

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.