Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8877705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:31:50+00:00 2026-06-14T19:31:50+00:00

I am creating a custom control with markup like this: <Custom:CustomGrid> <Columns> <Custom:DataColumn HeaderText=FirstName

  • 0

I am creating a custom control with markup like this:

<Custom:CustomGrid>
    <Columns>
        <Custom:DataColumn HeaderText="FirstName" />
        <Custom:DataColumn HeaderText="LastName" />
    </Columns>
</Custom:CustomGrid>

I am overriding both Render and RenderChildren in order to render the outer Div/Table and Column tags respectively.

I want each of the THs to include a LinkButton, with the HeaderText for sorting. I created a foreach loop to run over the collection of columns and create a TH for each with a LinkButton inside it. I render out the LinkButton using linkBtn.RenderControl(writer);

What I get in html is just an empty anchor tag.
I’m guessing this is due to the fact that asp.net does not know to render the JS side of the server control when it is rendered this way.
But I have no idea what I can do differently.
Any ideas?

EDIT: I can see that href=”javascript:_doPostBack('myGrid$Sort_firstName','')”
is created. I don’t know why the characters are html escaped, but I’m guessing it’s just the html source viewer (or maybe not…) Anyway, the event handler is still not being fired.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:31:52+00:00Added an answer on June 14, 2026 at 7:31 pm

    Turns out that CreateChildControls is not the place to create child controls… (Who would of thunk it…)

    I moved the code adding the controls to the Controls colletion to OnInit and everything was wiered up correctly.

    Turns out that CreateChildControls is called too late in the lifecycle for the post back to route the events correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a custom control called ImageFader. The style template looks like this: <ControlTemplate
I am creating a custom control. I want the template for this control to
I'm creating a custom control for my WPF application, and I'd like to know
I am creating a custom server control to generate button elements with specific markup
So I'm creating a custom user control in .NET 2.0 and this user control
I'm creating a custom control derived from UserControl that I would like to set
I am creating a custom control extending WebControl. This web control allows the consumer
I am creating a custom WPF control that uses the following markup: <custom:FilterPanel Grid.Row=1
I'm creating a custom control for windows phone 8, in this control I use
I am creating my custom control from scratch. Like a UIScrollView I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.