PC Review


Reply
Thread Tools Rate Thread

Child Neglect

 
 
wASP
Guest
Posts: n/a
 
      8th Aug 2005

Hi,

I was under the impression that, when ASP rendered a page,
it recursively traversed the hierarchy, executing all controls
in each ControlCollection of every control in that hierarchy.

I tried adding a Button control to a TextBox ControlCollection,
and it didn't execute. When I add the control to the Placeholder
ControlCollection (after the TextBox control is added), it executes
without any problem:
/* . . . . . . . . . . . . . . . . */
protected void create_ctrl_pair_0x
(String text_box_id, String Btn_ID, String Btn_text)
{
ControlCollection crnt_ctrl = CCP_Dyn_Ctrl_Placeholder.Controls;

// Create UserTextBox TextBox control.

UserTextBox0x = new TextBox ();

// Configure the UserTextBox TextBox control.
UserTextBox0x.ID = text_box_id;

// Add UserTextBox TextBox control to the Controls collection
// of the Dyn_Control_Placeholder PlaceHolder control.

crnt_ctrl.Add (UserTextBox0x);
crnt_ctrl.Add ( new LiteralControl("<br>XxXxXxXxXxXxXxXxX<br><br>") );

// Create and initialize a Button.

button0x = new Button();
button0x.ID = Btn_ID;
button0x.Text = Btn_text;

// make the button a child of the text box control.
crnt_ctrl = UserTextBox0x.Controls;

crnt_ctrl.Add (button0x);
crnt_ctrl.Add
( new LiteralControl("<br>===================<br><br>") );
}
/* . . . . . . . . . . . . . . . . */
/* | | | | | | | | | | | | | | | | */
/* . . . . . . . . . . . . . . . . */



If this assignment statement is removed from the above:
crnt_ctrl = UserTextBox0x.Controls;
... it works fine. Otherwise, there is no button, as the child is neglected.



Can anyone give me an idea as to what I would have to do to make this work?



My complete code is as follows:
<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
<head>

<script runat="server">

/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
// protected class sys_obj_class
public class sys_obj_class
{
private Page this_page01;
public Page Get_this_page01
{ get { return this_page01; } }

private PlaceHolder Obj_Dyn_Ctrl_Placeholder;
public PlaceHolder Get_Obj_Dyn_Ctrl_Placeholder
{ get { return Obj_Dyn_Ctrl_Placeholder; } }

private Label Obj_Dyn_Label01;
public Label Get_Obj_Dyn_Label01
{ get { return Obj_Dyn_Label01; } }


public sys_obj_class
(PlaceHolder Dyn_Ctrl_Placeholder, Label Dyn_Label)
{
this_page01 = Dyn_Ctrl_Placeholder.Page;
Obj_Dyn_Ctrl_Placeholder = Dyn_Ctrl_Placeholder;
Obj_Dyn_Label01 = Dyn_Label;
}
}

/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
public void Page_Init (object sender, EventArgs e)
{
int ndx = 2;

Dyn_Control_Placeholder.Controls.Add
( new LiteralControl("<br>||| added 1 on init |||<br><br>") );
}
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
protected void Page_Load (Object sender, EventArgs e)
{
PlaceHolder plc_hldr = (PlaceHolder) FindControl ("Dyn_Control_Placeholder");
Label lbl_msg01 = (Label) FindControl ("Message01");
sys_obj_class sys_obj = new sys_obj_class (plc_hldr, lbl_msg01);

ctrl_pair_creation_01 ccp1 = new ctrl_pair_creation_01 (sys_obj);

ccp1.create_ctrl_pair_01 ();
}
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */

/* - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - */
protected class base_create_ctrl_pair
{
protected TextBox UserTextBox0x;
protected Button button0x;
protected PlaceHolder CCP_Dyn_Ctrl_Placeholder;
protected Label Dyn_Lbl_msg01;

/* =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= *
<<< constructor >>>
* =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= */
protected base_create_ctrl_pair (sys_obj_class sys_obj)
{
CCP_Dyn_Ctrl_Placeholder = sys_obj.Get_Obj_Dyn_Ctrl_Placeholder;
Dyn_Lbl_msg01 = sys_obj.Get_Obj_Dyn_Label01;
}
/* =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= */
/* =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= */

protected void init_single_line_text_box (TextBox new_TextBox, int col_sz)
{ new_TextBox.Columns = col_sz; }

/* . . . . . . . . . . . . . . . . */
protected void create_ctrl_pair_0x
(String text_box_id, String Btn_ID, String Btn_text)
{
ControlCollection crnt_ctrl = CCP_Dyn_Ctrl_Placeholder.Controls;

// Create UserTextBox TextBox control.

UserTextBox0x = new TextBox ();

// Configure the UserTextBox TextBox control.
UserTextBox0x.ID = text_box_id;

// Add UserTextBox TextBox control to the Controls collection
// of the Dyn_Control_Placeholder PlaceHolder control.

crnt_ctrl.Add (UserTextBox0x);
crnt_ctrl.Add ( new LiteralControl("<br>XxXxXxXxXxXxXxXxX<br><br>") );

// Create and initialize a Button.

button0x = new Button();
button0x.ID = Btn_ID;
button0x.Text = Btn_text;

// make the button a child of the text box control.
crnt_ctrl = UserTextBox0x.Controls;

crnt_ctrl.Add (button0x);
crnt_ctrl.Add
( new LiteralControl("<br>===================::::<br><br>") );
}
/* . . . . . . . . . . . . . . . . */


/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- *
<<< Button Click Handlers >>>
* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
private String submit_click_str01 = "The TextBox";

private String submit_click_str02
= " control above is dynamically generated. <br> You entered: ";

public void Submit_Click (Object sender, EventArgs e)
{ // Retrieve the UserTextBox TextBox control from the
Dyn_Control_Placeholder
// PlaceHolder control.
TextBox TempTextBox = (TextBox)
CCP_Dyn_Ctrl_Placeholder.FindControl("UserTextBox1");

// Display the Text property.
Dyn_Lbl_msg01.Text = submit_click_str01 + '1' + submit_click_str02 +
TempTextBox.Text;
}
/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */

}
/* - - - - - - - - - - - - - - - - - - - - - - */
/* END: protected class base_create_ctrl_pair */
/* - - - - - - - - - - - - - - - - - - - - - - */

/* /|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\ */
protected class ctrl_pair_creation_01 : base_create_ctrl_pair
{
private sys_obj_class lcl_sys_obj;

// constructor
public ctrl_pair_creation_01 (sys_obj_class sys_obj) : base (sys_obj)
{ lcl_sys_obj = sys_obj; }

/* . . . . . . . . . . . . . */
public void create_ctrl_pair_01 ()
{ create_ctrl_pair_0x
("UserTextBox1", "DButton01", "Submit 01");

button0x.Click += new EventHandler (Submit_Click);

if (!lcl_sys_obj.Get_this_page01.IsPostBack)
init_single_line_text_box (UserTextBox0x, 22);
}
/* . . . . . . . . . . . . . */
}
/* /|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\ */
/* /|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\ */

</script>
</head>

<body>

<form runat="server">

<h3> Control Init </h3>

Enter some text and click the Submit button. <br><br>

<asp:PlaceHolder ID="Dyn_Control_Placeholder" runat="server"/>

<asp:Label ID="Message01" runat="server"/>

</form>

</body>
</html>

<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>



THANKS!!!



- wASP
 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      9th Aug 2005
not quite. the page renders all its children. if the one of the form
controls supports children of its own, it renders them.

the default implemenation of Render is RenderChildren. the TextBox overrides
the render with its own, and never calls RenderChildren (because the TextBox
does not support children).

-- bruce (sqlwork.com)




"wASP" <wylbur[at]ev1[dot]net> wrote in message
news:(E-Mail Removed)...
>
> Hi,
>
> I was under the impression that, when ASP rendered a page,
> it recursively traversed the hierarchy, executing all controls
> in each ControlCollection of every control in that hierarchy.
>
> I tried adding a Button control to a TextBox ControlCollection,
> and it didn't execute. When I add the control to the Placeholder
> ControlCollection (after the TextBox control is added), it executes
> without any problem:
> /* . . . . . . . . . . . . . . . . */
> protected void create_ctrl_pair_0x
> (String text_box_id, String Btn_ID, String Btn_text)
> {
> ControlCollection crnt_ctrl = CCP_Dyn_Ctrl_Placeholder.Controls;
>
> // Create UserTextBox TextBox control.
>
> UserTextBox0x = new TextBox ();
>
> // Configure the UserTextBox TextBox control.
> UserTextBox0x.ID = text_box_id;
>
> // Add UserTextBox TextBox control to the Controls collection
> // of the Dyn_Control_Placeholder PlaceHolder control.
>
> crnt_ctrl.Add (UserTextBox0x);
> crnt_ctrl.Add ( new
> LiteralControl("<br>XxXxXxXxXxXxXxXxX<br><br>") );
>
> // Create and initialize a Button.
>
> button0x = new Button();
> button0x.ID = Btn_ID;
> button0x.Text = Btn_text;
>
> // make the button a child of the text box control.
> crnt_ctrl = UserTextBox0x.Controls;
>
> crnt_ctrl.Add (button0x);
> crnt_ctrl.Add
> ( new LiteralControl("<br>===================<br><br>") );
> }
> /* . . . . . . . . . . . . . . . . */
> /* | | | | | | | | | | | | | | | | */
> /* . . . . . . . . . . . . . . . . */
>
>
>
> If this assignment statement is removed from the above:
> crnt_ctrl = UserTextBox0x.Controls;
> ... it works fine. Otherwise, there is no button, as the child is
> neglected.
>
>
>
> Can anyone give me an idea as to what I would have to do to make this
> work?
>
>
>
> My complete code is as follows:
> <+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
> <+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
> <%@ Page Language="C#" AutoEventWireup="True" %>
>
> <html>
> <head>
>
> <script runat="server">
>
> /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> */
> /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> */
> // protected class sys_obj_class
> public class sys_obj_class
> {
> private Page this_page01;
> public Page Get_this_page01
> { get { return this_page01; } }
>
> private PlaceHolder Obj_Dyn_Ctrl_Placeholder;
> public PlaceHolder Get_Obj_Dyn_Ctrl_Placeholder
> { get { return Obj_Dyn_Ctrl_Placeholder; } }
>
> private Label Obj_Dyn_Label01;
> public Label Get_Obj_Dyn_Label01
> { get { return Obj_Dyn_Label01; } }
>
>
> public sys_obj_class
> (PlaceHolder Dyn_Ctrl_Placeholder, Label Dyn_Label)
> {
> this_page01 = Dyn_Ctrl_Placeholder.Page;
> Obj_Dyn_Ctrl_Placeholder = Dyn_Ctrl_Placeholder;
> Obj_Dyn_Label01 = Dyn_Label;
> }
> }
>
> /* ------------------------------------------------------------------ */
> /* ------------------------------------------------------------------ */
> public void Page_Init (object sender, EventArgs e)
> {
> int ndx = 2;
>
> Dyn_Control_Placeholder.Controls.Add
> ( new LiteralControl("<br>||| added 1 on init |||<br><br>") );
> }
> /* ------------------------------------------------------------------ */
> /* ------------------------------------------------------------------ */
> protected void Page_Load (Object sender, EventArgs e)
> {
> PlaceHolder plc_hldr = (PlaceHolder) FindControl
> ("Dyn_Control_Placeholder");
> Label lbl_msg01 = (Label) FindControl ("Message01");
> sys_obj_class sys_obj = new sys_obj_class (plc_hldr, lbl_msg01);
>
> ctrl_pair_creation_01 ccp1 = new ctrl_pair_creation_01 (sys_obj);
>
> ccp1.create_ctrl_pair_01 ();
> }
> /* ------------------------------------------------------------------ */
> /* ------------------------------------------------------------------ */
>
> /* - - - - - - - - - - - - - - - - - - - - - - */
> /* - - - - - - - - - - - - - - - - - - - - - - */
> /* - - - - - - - - - - - - - - - - - - - - - - */
> protected class base_create_ctrl_pair
> {
> protected TextBox UserTextBox0x;
> protected Button button0x;
> protected PlaceHolder CCP_Dyn_Ctrl_Placeholder;
> protected Label Dyn_Lbl_msg01;
>
> /*
> =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= *
> <<< constructor >>>
> *
> =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= */
> protected base_create_ctrl_pair (sys_obj_class sys_obj)
> {
> CCP_Dyn_Ctrl_Placeholder =
> sys_obj.Get_Obj_Dyn_Ctrl_Placeholder;
> Dyn_Lbl_msg01 = sys_obj.Get_Obj_Dyn_Label01;
> }
> /*
> =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= */
> /*
> =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= */
>
> protected void init_single_line_text_box (TextBox new_TextBox,
> int col_sz)
> { new_TextBox.Columns = col_sz; }
>
> /* . . . . . . . . . . . . . . . .
> */
> protected void create_ctrl_pair_0x
> (String text_box_id, String Btn_ID, String Btn_text)
> {
> ControlCollection crnt_ctrl =
> CCP_Dyn_Ctrl_Placeholder.Controls;
>
> // Create UserTextBox TextBox control.
>
> UserTextBox0x = new TextBox ();
>
> // Configure the UserTextBox TextBox control.
> UserTextBox0x.ID = text_box_id;
>
> // Add UserTextBox TextBox control to the Controls collection
> // of the Dyn_Control_Placeholder PlaceHolder control.
>
> crnt_ctrl.Add (UserTextBox0x);
> crnt_ctrl.Add ( new
> LiteralControl("<br>XxXxXxXxXxXxXxXxX<br><br>") );
>
> // Create and initialize a Button.
>
> button0x = new Button();
> button0x.ID = Btn_ID;
> button0x.Text = Btn_text;
>
> // make the button a child of the text box control.
> crnt_ctrl = UserTextBox0x.Controls;
>
> crnt_ctrl.Add (button0x);
> crnt_ctrl.Add
> ( new
> LiteralControl("<br>===================::::<br><br>") );
> }
> /* . . . . . . . . . . . . . . . .
> */
>
>
>
> /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> *
> <<< Button Click Handlers >>>
>
> * -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> */
> private String submit_click_str01 = "The TextBox";
>
> private String submit_click_str02
> = " control above is dynamically generated. <br> You
> entered: ";
>
> public void Submit_Click (Object sender, EventArgs e)
> { // Retrieve the UserTextBox TextBox control from the
> Dyn_Control_Placeholder
> // PlaceHolder control.
> TextBox TempTextBox = (TextBox)
> CCP_Dyn_Ctrl_Placeholder.FindControl("UserTextBox1");
>
> // Display the Text property.
> Dyn_Lbl_msg01.Text = submit_click_str01 + '1' +
> submit_click_str02 +
> TempTextBox.Text;
> }
>
> /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> */
>
> /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> */
>
> }
> /* - - - - - - - - - - - - - - - - - - - - - - */
> /* END: protected class base_create_ctrl_pair */
> /* - - - - - - - - - - - - - - - - - - - - - - */
>
> /* /|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\ */
> protected class ctrl_pair_creation_01 : base_create_ctrl_pair
> {
> private sys_obj_class lcl_sys_obj;
>
> // constructor
> public ctrl_pair_creation_01 (sys_obj_class sys_obj) : base
> (sys_obj)
> { lcl_sys_obj = sys_obj; }
>
> /* . . . . . . . . . . . . . */
> public void create_ctrl_pair_01 ()
> { create_ctrl_pair_0x
> ("UserTextBox1", "DButton01", "Submit 01");
>
> button0x.Click += new EventHandler (Submit_Click);
>
> if (!lcl_sys_obj.Get_this_page01.IsPostBack)
> init_single_line_text_box (UserTextBox0x, 22);
> }
> /* . . . . . . . . . . . . . */
> }
> /* /|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\ */
> /* /|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\_/|\ */
>
> </script>
> </head>
>
> <body>
>
> <form runat="server">
>
> <h3> Control Init </h3>
>
> Enter some text and click the Submit button. <br><br>
>
> <asp:PlaceHolder ID="Dyn_Control_Placeholder" runat="server"/>
>
> <asp:Label ID="Message01" runat="server"/>
>
> </form>
>
> </body>
> </html>
>
> <+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
> <+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
>
>
>
> THANKS!!!
>
>
>
> - wASP



 
Reply With Quote
 
wASP
Guest
Posts: n/a
 
      9th Aug 2005
On Mon, 8 Aug 2005 17:34:19 -0700, "Bruce Barker" <brubar_nospamplease_@safeco.com>
wrote:

>not quite. the page renders all its children. if the one of the form
>controls supports children of its own, it renders them.
>
>the default implemenation of Render is RenderChildren. the TextBox overrides
>the render with its own, and never calls RenderChildren (because the TextBox
>does not support children).
>
>-- bruce (sqlwork.com)


I'm thinking that this behavior can be overridden ... maybe?

The first question that springs into my mind is that,
if the TextBox does not support children (the lousy deadbeat),
then why would it have a ControlCollection?

I'll start digging through the docs ...


- wASP
 
Reply With Quote
 
rl
Guest
Posts: n/a
 
      9th Aug 2005
Why would you want a TextBox to contain a Button as a child? Always
think about the final HTML that is the eventual target of all these
ASP.NET objects. Having a button as a child of a TextBox would
generate invalid HTML:

<input type="text"><input type="submit" /></input>

If what you want is to have a Button that immediately follows a
TextBox, then the HTML you want is:

<input type="text" /><input type="submit" />

And in this case the Button is NOT a child of the TextBox. Remember
that "child of" means "contained by" and now "follows."

Try adding the Button as a child of the Page (or the Control, if that's
where the TextBox is) and specifying the index at which to add the
control:

Page.Controls.AddAt(Page.Controls.IndexOf(tx),bt);

You can also use a Panel or Placeholder control to contain both the
TextBox and the Button:

pnl.Controls.AddAt(pnl.Controls.IndexOf(tx),bt);

rl

wASP wrote:
> On Mon, 8 Aug 2005 17:34:19 -0700, "Bruce Barker" <brubar_nospamplease_@safeco.com>
> wrote:
>
> >not quite. the page renders all its children. if the one of the form
> >controls supports children of its own, it renders them.
> >
> >the default implemenation of Render is RenderChildren. the TextBox overrides
> >the render with its own, and never calls RenderChildren (because the TextBox
> >does not support children).
> >
> >-- bruce (sqlwork.com)

>
> I'm thinking that this behavior can be overridden ... maybe?
>
> The first question that springs into my mind is that,
> if the TextBox does not support children (the lousy deadbeat),
> then why would it have a ControlCollection?
>
> I'll start digging through the docs ...
>
>
> - wASP


 
Reply With Quote
 
wASP
Guest
Posts: n/a
 
      9th Aug 2005
On 9 Aug 2005 05:29:04 -0700, "rl" <(E-Mail Removed)> wrote:

>Why would you want a TextBox to contain a Button as a child? Always
>think about the final HTML that is the eventual target of all these
>ASP.NET objects. Having a button as a child of a TextBox would
>generate invalid HTML:
>
><input type="text"><input type="submit" /></input>
>
>If what you want is to have a Button that immediately follows a
>TextBox, then the HTML you want is:
>
><input type="text" /><input type="submit" />
>
>And in this case the Button is NOT a child of the TextBox. Remember
>that "child of" means "contained by" and now "follows."


*NOW* I get it.

I had a basic misunderstanding as to the implications of making
the button control a child of the textbox control - that is until
you clued me in with your post.


>Try adding the Button as a child of the Page (or the Control, if that's
>where the TextBox is) and specifying the index at which to add the
>control:
>
>Page.Controls.AddAt(Page.Controls.IndexOf(tx),bt);
>
>You can also use a Panel or Placeholder control to contain both the
>TextBox and the Button:
>
>pnl.Controls.AddAt(pnl.Controls.IndexOf(tx),bt);


THAT is what I need to do.

I appreciate your efforts to enlighten me on this issue.


THANKS rl!!!


- wASP
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell cursor neglect cellinfo. Joergen Bondesen Microsoft Excel Programming 4 12th Nov 2008 09:09 PM
Child Aggregate Filter Not Recognising Newly Added Child Rows (ADO.NET 2.0 Dataset) s.gregory@4castweb.com Microsoft ADO .NET 2 20th Mar 2007 04:45 PM
Child Neglect wASP Microsoft C# .NET 1 9th Aug 2005 08:00 PM
Child Neglect wASP Microsoft Dot NET 2 9th Aug 2005 07:58 PM
Why Neglect .Net Remoting Howard Swope Microsoft Dot NET Compact Framework 5 27th Dec 2004 10:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:54 PM.