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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:46:39+00:00 2026-06-04T22:46:39+00:00

I am allowing a user to check the checkboxes associated with nodes in my

  • 0

I am allowing a user to check the checkboxes associated with nodes in my treeview.

I would like to prompt the user for their input as soon as a specific node is checked.
For Example:

if node#2 is checked then get user input
  1. how do i do this? is the best way c# with javascript?
    if so , then how?

  2. how would i get a list of selected notes after submit button is clicked?

  • 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-04T22:46:40+00:00Added an answer on June 4, 2026 at 10:46 pm
    //get a list of selected nodes after submit button is clicked
     protected void submitBtn_Click(object sender, EventArgs e)
     {
               if (this.tree.CheckedNodes.Count > 0)
                {
                    // Iterate through the CheckedNodes collection and display the selected nodes.
                    foreach (TreeNode node in tree.CheckedNodes)
                    {
                       Response.Write(node.Value + "<br />"); 
                    }
                }
    
                else
                {
                    Response.Write("No node selected.");
    
                }
    }
    

    To get the selected node when user check a node you have to fire postback in javascript in head tag
    Like

    <script language="javascript" type="text/javascript">
            function postBackByObject() {
                var o = window.event.srcElement;
                if (o.tagName == "INPUT" && o.type == "checkbox") {
                    __doPostBack("", "");
                }
            }
    
    </script>
    

    and put above code inside TreeNodeCheckChanged event of Treeview
    like

    protected void tree_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
    {
    
            if (tree.CheckedNodes.Count > 0)
            {
                // Iterate through the CheckedNodes collection and display the selected nodes.
                foreach (TreeNode node in tree.CheckedNodes)
                {
                    Response.Write (node.Value + "<br />");
    
                }
            }
    
            else
            {
                Response.Write("No items selected.");
    
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm allowing user css. I'm taking their css input, creating a style, and just
What would be best practice for allowing the user to store data for my
I have an input form with two textareas allowing a user to type in
I'm trying to get user input and allowing them to only input a whole
ive got 5 buttons that user can check. for a moment the code allowing
I'm looking for a solution allowing me to check periodically if the user session
I have a form allowing a user to signup for a news letter which
We made the mistake of allowing .csproj.user files to be checked in to TFS
I'm retrieving a file from a database server and allowing the user to download
I'm trying to do a UIWebView , but not allowing the user to visit

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.