Click here to Skip to main content
15,910,787 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionmultilanguage asp.net application Pin
manoj_geet6-Sep-06 1:59
manoj_geet6-Sep-06 1:59 
AnswerRe: multilanguage asp.net application Pin
minhpc_bk6-Sep-06 2:05
minhpc_bk6-Sep-06 2:05 
AnswerRe: multilanguage asp.net application Pin
Sathesh Sakthivel6-Sep-06 2:10
Sathesh Sakthivel6-Sep-06 2:10 
QuestionFilling Dropdown via Javascript - Strategic Question Pin
matthias s.6-Sep-06 1:23
matthias s.6-Sep-06 1:23 
AnswerRe: Filling Dropdown via Javascript - Strategic Question Pin
g00fyman6-Sep-06 1:53
g00fyman6-Sep-06 1:53 
Questionasp:menu 2.0 postback issue [modified] Pin
beren7776-Sep-06 1:08
beren7776-Sep-06 1:08 
AnswerRe: asp:menu 2.0 postback issue Pin
minhpc_bk6-Sep-06 2:03
minhpc_bk6-Sep-06 2:03 
Questioncustom control event not firing Pin
g00fyman5-Sep-06 23:49
g00fyman5-Sep-06 23:49 
hi all,

i am converting my custom control from a flow layout to a more configurable layout using div's (System.Web.UI.WebControls.Panel). The control has a couple of buttons on it that work fine if i just render them within the custom control and not put them in another controls control collection.

As soon as i put the button/s into another controls control collection, the events dont fire. I have created a class WebPanel that extends Panel and implements INamingContainer but that doesn't help either. The same problem occurs also if I use a Table instead of a Panel

this is my overriden OnBubbleEvent

protected override bool OnBubbleEvent(object source, EventArgs e)
{
  if (e is CommandEventArgs)
  {
    CommandEventArgs e1 = (CommandEventArgs)e;
    Button button = source as Button;
    OnClick(this, new ButtonEventArgs(button));
    return false;
  }
  return true;
}


this is my overriden CreateChildControls

protected override void CreateChildControls()
{
  Controls.Clear();

  Button button = new Button();
  button.Text = "Button1";
  button.CommandArgument = "Button1";

  this.Buttons.Add(button);
}


btw, this.Buttons is a custom ButtonCollection that has a ButtonAdded event, which adds the Button to the Controls collection

This renders & events fire
protected override void Render(HtmlTextWriter writer)
{
  EnsureChildControls();

  foreach (Button button in Buttons)
  {
    button.RenderControl(writer);
  }
}


This renders & event *dont* fire
protected override void Render(HtmlTextWriter writer)
{
  EnsureChildControls();

  Panel container = new Panel();
  Controls.Add(container);

  foreach (Button button in Buttons)
  {
    container.Controls.Add(button);
  }
  container.RenderControl(writer);
}



Any ideas please.

g00fy
AnswerRe: custom control event not firing Pin
Parwej Ahamad6-Sep-06 0:59
professionalParwej Ahamad6-Sep-06 0:59 
GeneralRe: custom control event not firing Pin
g00fyman6-Sep-06 1:49
g00fyman6-Sep-06 1:49 
AnswerRe: custom control event not firing Pin
Parwej Ahamad6-Sep-06 2:32
professionalParwej Ahamad6-Sep-06 2:32 
AnswerRe: custom control event not firing Pin
minhpc_bk6-Sep-06 1:00
minhpc_bk6-Sep-06 1:00 
GeneralRe: custom control event not firing Pin
g00fyman6-Sep-06 1:47
g00fyman6-Sep-06 1:47 
GeneralRe: custom control event not firing Pin
minhpc_bk6-Sep-06 2:01
minhpc_bk6-Sep-06 2:01 
GeneralRe: custom control event not firing Pin
g00fyman6-Sep-06 2:12
g00fyman6-Sep-06 2:12 
GeneralRe: custom control event not firing Pin
minhpc_bk6-Sep-06 2:27
minhpc_bk6-Sep-06 2:27 
GeneralRe: custom control event not firing Pin
g00fyman6-Sep-06 2:39
g00fyman6-Sep-06 2:39 
Questionhow to write into the .htm file Pin
Amit Agarrwal5-Sep-06 23:21
Amit Agarrwal5-Sep-06 23:21 
AnswerRe: how to write into the .htm file Pin
Exelioindia5-Sep-06 23:48
Exelioindia5-Sep-06 23:48 
AnswerRe: how to write into the .htm file [modified] Pin
g00fyman5-Sep-06 23:53
g00fyman5-Sep-06 23:53 
GeneralRe: how to write into the .htm file Pin
Amit Agarrwal6-Sep-06 0:11
Amit Agarrwal6-Sep-06 0:11 
GeneralRe: how to write into the .htm file Pin
g00fyman6-Sep-06 0:16
g00fyman6-Sep-06 0:16 
GeneralRe: how to write into the .htm file Pin
Amit Agarrwal6-Sep-06 0:20
Amit Agarrwal6-Sep-06 0:20 
GeneralRe: how to write into the .htm file [modified] Pin
g00fyman6-Sep-06 0:29
g00fyman6-Sep-06 0:29 
GeneralRe: how to write into the .htm file Pin
Amit Agarrwal6-Sep-06 1:08
Amit Agarrwal6-Sep-06 1:08 

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.