Click here to Skip to main content
15,908,166 members
Home / Discussions / C#
   

C#

 
GeneralRe: Compiling the codes Pin
harold aptroot18-Feb-14 6:43
harold aptroot18-Feb-14 6:43 
GeneralRe: Compiling the codes Pin
Blubbo18-Feb-14 7:03
Blubbo18-Feb-14 7:03 
GeneralRe: Compiling the codes Pin
Blubbo18-Feb-14 7:48
Blubbo18-Feb-14 7:48 
AnswerRe: Compiling the codes Pin
Richard Andrew x6418-Feb-14 6:48
professionalRichard Andrew x6418-Feb-14 6:48 
Questionlooking for code to logout in multiple browser tab Pin
umesh lade18-Feb-14 4:56
umesh lade18-Feb-14 4:56 
AnswerRe: looking for code to logout in multiple browser tab Pin
Mycroft Holmes18-Feb-14 11:49
professionalMycroft Holmes18-Feb-14 11:49 
GeneralRe: looking for code to logout in multiple browser tab Pin
Ramug1018-Feb-14 22:08
Ramug1018-Feb-14 22:08 
QuestionHow to load a function first? Pin
Member 776638518-Feb-14 0:28
Member 776638518-Feb-14 0:28 
Hello,

I have written the code below. How do I get the "public List<tbl_objecten_tbl_nen2634> TheList" loaded first?
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Bouwgegevens.Gebouwen
{
    public partial class Plan : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ScriptManager.GetCurrent(this).IsInAsyncPostBack)
            {
                PopulateMenu();
            }
            else
            {
                //code when it is an async postback
            }
        }
        private void PopulateMenu()
        {
            List<tbl_NEN2634> allMenu = new List<tbl_NEN2634>();

            using (DBBouwgegevensEntities dc = new DBBouwgegevensEntities())
            {
                allMenu = dc.tbl_NEN2634.ToList();
            }
            // Call function here for bind treeview
            CreateTreeView(allMenu, 0, null);
        }

        public List<tbl_Objecten_tbl_NEN2634> TheList
        {
            get;set;
        }

        private void CreateTreeView(List<tbl_NEN2634> source, int parentID, TreeNode parentNode)
        {

            int objectID = Convert.ToInt32(Request.QueryString["ObjectID"]);

            List<tbl_NEN2634> newSource = (from b in source
                                           join c in TheList
                                           on b.NEN2634ID equals c.NEN2634ID
                                           where b.ParentID == parentID
                                           select b).ToList();

            //List<tbl_NEN2634> newSource = source.Where(a => a.ParentID.Equals(parentID)).ToList();

            foreach (var i in newSource)
            {
                TreeNode newnode = new TreeNode("" + i.NEN2634_Code + "" + " " + i.NEN2634_Titel, i.NEN2634ID.ToString());
                if (parentNode == null)
                {
                    trvPlan.Nodes.Add(newnode);
                }
                else
                {
                    parentNode.ChildNodes.Add(newnode);
                }
                CreateTreeView(source, i.NEN2634ID, newnode);
            }
        }
    }
}


Please help,

Kind regards

Mark
AnswerRe: How to load a function first? Pin
Keith Barrow18-Feb-14 2:32
professionalKeith Barrow18-Feb-14 2:32 
GeneralRe: How to load a function first? Pin
Member 776638518-Feb-14 9:07
Member 776638518-Feb-14 9:07 
QuestionGetting rid of extra click... Pin
Danish Samil18-Feb-14 0:08
Danish Samil18-Feb-14 0:08 
AnswerRe: Getting rid of extra click... Pin
Shameel18-Feb-14 2:47
professionalShameel18-Feb-14 2:47 
GeneralRe: Getting rid of extra click... Pin
Danish Samil18-Feb-14 10:41
Danish Samil18-Feb-14 10:41 
AnswerRe: Getting rid of extra click... Pin
TnTinMn18-Feb-14 12:52
TnTinMn18-Feb-14 12:52 
GeneralRe: Getting rid of extra click... Pin
Danish Samil18-Feb-14 19:15
Danish Samil18-Feb-14 19:15 
QuestionHow to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Anand Gunasekaran17-Feb-14 20:49
professionalAnand Gunasekaran17-Feb-14 20:49 
AnswerRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Pete O'Hanlon17-Feb-14 20:52
mvePete O'Hanlon17-Feb-14 20:52 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Anand Gunasekaran17-Feb-14 21:06
professionalAnand Gunasekaran17-Feb-14 21:06 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Pete O'Hanlon17-Feb-14 21:12
mvePete O'Hanlon17-Feb-14 21:12 
AnswerRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
OriginalGriff17-Feb-14 21:01
mveOriginalGriff17-Feb-14 21:01 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Anand Gunasekaran17-Feb-14 21:14
professionalAnand Gunasekaran17-Feb-14 21:14 
GeneralRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Shameel17-Feb-14 22:26
professionalShameel17-Feb-14 22:26 
AnswerRe: How to Implement the Search Engine(like google,bing, yahoo, etc.,) using C#? Pin
Shameel18-Feb-14 2:55
professionalShameel18-Feb-14 2:55 
QuestionConvert "\\r\\n" into "\r\n" Pin
Ashfaque Hussain17-Feb-14 20:00
Ashfaque Hussain17-Feb-14 20:00 
AnswerRe: Convert "\\r\\n" into "\r\n" Pin
Kornfeld Eliyahu Peter17-Feb-14 20:06
professionalKornfeld Eliyahu Peter17-Feb-14 20:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.