Click here to Skip to main content
15,887,776 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Question about carrying information from a HTML page to a ASP Pin
Diego Carrion31-Aug-12 5:07
Diego Carrion31-Aug-12 5:07 
GeneralRe: Question about carrying information from a HTML page to a ASP Pin
Deflinek31-Aug-12 22:15
Deflinek31-Aug-12 22:15 
GeneralRe: Question about carrying information from a HTML page to a ASP Pin
Diego Carrion2-Sep-12 5:26
Diego Carrion2-Sep-12 5:26 
QuestionASP.NET Pin
soumyashree sahoo30-Aug-12 17:28
soumyashree sahoo30-Aug-12 17:28 
AnswerRe: ASP.NET Pin
Sandeep Mewara30-Aug-12 18:57
mveSandeep Mewara30-Aug-12 18:57 
Questioncant insert image in table Pin
Michael Portanoba30-Aug-12 16:56
Michael Portanoba30-Aug-12 16:56 
AnswerRe: cant insert image in table Pin
Sandeep Mewara30-Aug-12 18:55
mveSandeep Mewara30-Aug-12 18:55 
QuestionButton event does not execute Pin
netJP12L30-Aug-12 0:58
netJP12L30-Aug-12 0:58 
Hi Guys,
I am loading buttons on a page load event dynamically. The buttons are added to a placeholder control on a aspx page. The problem I am having is that the dynamically created button event below (topic_Click) doesn't get fired.
Bascially, I am trying to add topics to aobjective.
Could you please help me. I would highly appreciate it.
C#
protected void Page_Load(object sender, EventArgs e)
{
       
        if (Session["s"] == null)
        {
            AddObjective();
            AddTopic();
        }
        else if (Session["s"] != null)
        {
            List<Panel> list = new List<Panel>();
            list = Session["s"] as List<Panel>;
            foreach (var item in list)
            {
                AddtoPlaceHolder(item);
            }
        }
    }

private void AddObjective()
{
        Panel panel = new Panel();
        Button objective = new Button();
        objective.Text = "Add objective";
        objective.Click += new EventHandler(objective_Click);
        panel.Controls.Add(objective);
        placeholder.Controls.Add(panel);

        AddtoPlaceHolder(panel);       
    }

void AddtoPlaceHolder(Panel panel)
{
        if (Session["s"] == null)
        {
            List<Panel> list = new List<Panel>();
            list.Add(panel);
            Session.Add("s", list);
        }
        else if(Session["s"] !=null)
        {
            List<Panel> list = Session["s"] as List<Panel>;
            list.Add(panel);
            Session.Add("s", list);
        }
    }

void objective_Click(object sender, EventArgs e)
{
        if (Session["s"] != null)
        {
            AddObjective();
        } 
}

void topic_Click(object sender, EventArgs e)
{
       throw new NotImplementedException();    =======> Problem doesn't execute         
}

private void AddTopic()
{
       Panel paneltopic = new Panel();
        paneltopic.ID = Guid.NewGuid().ToString(); 
        Button topic = new Button();
        topic.ID = Guid.NewGuid().ToString();
        topic.Text = "Insert topic";
        topic.Click += new EventHandler(topic_Click);
        paneltopic.Controls.Add(topic);
        placeholder.Controls.Add(paneltopic);

        AddtoPlaceHolder(paneltopic);
}

AnswerRe: Button event does not execute Pin
jkirkerx30-Aug-12 6:41
professionaljkirkerx30-Aug-12 6:41 
GeneralRe: Button event does not execute Pin
archifux2-Sep-12 13:41
archifux2-Sep-12 13:41 
GeneralRe: Button event does not execute Pin
jkirkerx2-Sep-12 17:32
professionaljkirkerx2-Sep-12 17:32 
GeneralRe: Button event does not execute Pin
archifux6-Sep-12 12:23
archifux6-Sep-12 12:23 
Questioni want my one web page to be run on my one client 's pc only Pin
Devang Vaja29-Aug-12 20:15
Devang Vaja29-Aug-12 20:15 
AnswerRe: i want my one web page to be run on my one client 's pc only Pin
Eddy Vluggen29-Aug-12 22:32
professionalEddy Vluggen29-Aug-12 22:32 
GeneralRe: i want my one web page to be run on my one client 's pc only Pin
Albarhami30-Aug-12 0:50
Albarhami30-Aug-12 0:50 
GeneralRe: i want my one web page to be run on my one client 's pc only Pin
Eddy Vluggen30-Aug-12 1:03
professionalEddy Vluggen30-Aug-12 1:03 
AnswerCross post Pin
Wes Aday30-Aug-12 1:29
professionalWes Aday30-Aug-12 1:29 
GeneralRe: i want my one web page to be run on my one client 's pc only Pin
jkirkerx30-Aug-12 7:01
professionaljkirkerx30-Aug-12 7:01 
Questionhow can i perform a time taking process in a page by considering the performance Pin
PP from bangalore29-Aug-12 9:37
PP from bangalore29-Aug-12 9:37 
AnswerRe: how can i perform a time taking process in a page by considering the performance Pin
jkirkerx29-Aug-12 10:03
professionaljkirkerx29-Aug-12 10:03 
GeneralRe: how can i perform a time taking process in a page by considering the performance Pin
PP from bangalore31-Aug-12 10:07
PP from bangalore31-Aug-12 10:07 
GeneralRe: how can i perform a time taking process in a page by considering the performance Pin
jkirkerx31-Aug-12 10:51
professionaljkirkerx31-Aug-12 10:51 
AnswerRe: how can i perform a time taking process in a page by considering the performance Pin
David Mujica29-Aug-12 10:38
David Mujica29-Aug-12 10:38 
GeneralRe: how can i perform a time taking process in a page by considering the performance Pin
jkirkerx29-Aug-12 11:21
professionaljkirkerx29-Aug-12 11:21 
QuestionHosting GWT .js in an MVC app? [solved] Pin
Ravi Bhavnani29-Aug-12 4:34
professionalRavi Bhavnani29-Aug-12 4:34 

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.