Click here to Skip to main content
15,897,371 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Target Framework Configuration Pin
Not Active26-Mar-08 10:47
mentorNot Active26-Mar-08 10:47 
GeneralSo many questions, so little space Pin
Brady Kelly26-Mar-08 7:19
Brady Kelly26-Mar-08 7:19 
GeneralRe: So many questions, so little space Pin
Christian Graus26-Mar-08 9:40
protectorChristian Graus26-Mar-08 9:40 
GeneralRe: So many questions, so little space Pin
Brady Kelly26-Mar-08 9:49
Brady Kelly26-Mar-08 9:49 
QuestionTextBox and CreateChildControls() Pin
msalti26-Mar-08 7:07
msalti26-Mar-08 7:07 
GeneralRe: TextBox and CreateChildControls() Pin
Jesse Squire26-Mar-08 7:25
Jesse Squire26-Mar-08 7:25 
GeneralRe: TextBox and CreateChildControls() Pin
msalti26-Mar-08 7:31
msalti26-Mar-08 7:31 
GeneralRe: TextBox and CreateChildControls() Pin
Jesse Squire26-Mar-08 7:43
Jesse Squire26-Mar-08 7:43 
It would appear that you're exactly right. When I popped open Reflector and took a look at the Render method for the TextBox, it does not make the standard call to RenderChildren. In order to have the child control render, I had to override the Render method. This worked for me:

  public class MyControl : TextBox

  {

    protected override void CreateChildControls()

    {

      this.Controls.Add(new HiddenField(){ ID = "MyHidden", Value = "TEST TEST TEST" });

      base.CreateChildControls();

    }

 

    protected override void Render(HtmlTextWriter writer)

    {

      this.RenderChildren(writer);

      base.Render(writer);

    }

  }


The above will render the Hidden field before the TextBox itself, if that matters to you. You can change the behavior by delegating to the base Render first, then calling RenderChildren.

Hope that helps. Smile | :)

  --Jesse
"... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi

GeneralRe: TextBox and CreateChildControls() Pin
msalti26-Mar-08 8:14
msalti26-Mar-08 8:14 
GeneralRe: TextBox and CreateChildControls() Pin
Jesse Squire26-Mar-08 8:38
Jesse Squire26-Mar-08 8:38 
GeneralA stupid question about databases and ASP.NET Pin
Cristoff26-Mar-08 6:02
Cristoff26-Mar-08 6:02 
GeneralRe: A stupid question about databases and ASP.NET Pin
Declan Bright26-Mar-08 6:41
Declan Bright26-Mar-08 6:41 
GeneralRe: A stupid question about databases and ASP.NET Pin
Jesse Squire26-Mar-08 6:49
Jesse Squire26-Mar-08 6:49 
GeneralPlease help me any one............ Pin
Member 377313726-Mar-08 5:27
Member 377313726-Mar-08 5:27 
GeneralRe: Please help me any one............ Pin
Herman<T>.Instance26-Mar-08 5:30
Herman<T>.Instance26-Mar-08 5:30 
GeneralRe: Please help me any one............ Pin
Jesse Squire26-Mar-08 6:26
Jesse Squire26-Mar-08 6:26 
GeneralRe: Please help me any one............ Pin
Not Active26-Mar-08 9:06
mentorNot Active26-Mar-08 9:06 
Questionlist of class(asp.net with C#) Pin
Saba0226-Mar-08 5:27
Saba0226-Mar-08 5:27 
GeneralRe: list of class(asp.net with C#) Pin
Declan Bright26-Mar-08 5:37
Declan Bright26-Mar-08 5:37 
GeneralRe: list of class(asp.net with C#) Pin
ChrisKo26-Mar-08 10:43
ChrisKo26-Mar-08 10:43 
QuestionBatch File Upload Pin
Talal Sultan26-Mar-08 5:11
Talal Sultan26-Mar-08 5:11 
GeneralRe: Batch File Upload Pin
Declan Bright26-Mar-08 5:21
Declan Bright26-Mar-08 5:21 
GeneralRe: Batch File Upload Pin
Talal Sultan26-Mar-08 5:25
Talal Sultan26-Mar-08 5:25 
QuestionGoing back to a previous web page with information still being present Pin
ahlaj7726-Mar-08 3:55
ahlaj7726-Mar-08 3:55 
GeneralRe: Going back to a previous web page with information still being present Pin
eyeseetee26-Mar-08 4:08
eyeseetee26-Mar-08 4: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.