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 1029541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:33:36+00:00 2026-05-16T12:33:36+00:00

I have a custom control which is rendered as a hyperlink: Public Class TestControl

  • 0

I have a custom control which is rendered as a hyperlink:

Public Class TestControl
    Inherits System.Web.UI.WebControls.WebControl
    Implements IPostBackEventHandler

    Public Sub RaisePostBackEvent(ByVal eventArgument As String) Implements System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
        Trace.WriteLine("Hyperlink 1 clicked")
    End Sub

    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        writer.WriteLine("<a href=""{0}"" id=""{1}"">Hyperlink 1</a>", _
                         Page.ClientScript.GetPostBackClientHyperlink(Me, "Hyperlink 1"), _
                         Me.ClientID)
    End Sub
End Class

This works fine. It also works nicely when put inside an UpdatePanel: Only the UpdatePanel is refreshed, no full postback is performed.

Now I would like to output a second hyperlink in the Render method. If I use the same id (Me.ClientID), everything works nicely, but this obviously results in broken HTML (no two controls are allows to have the same id attribute). If I use different client IDs (like Me.ClientID & "_1" and Me.ClientID & "_2"), a full postback is performed when the hyperlinks are clicked.

Is there some way to tell ASP.NET AJAX: “All postbacks of the following client IDs should be done asynchronously: …“?

  • 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-05-16T12:33:36+00:00Added an answer on May 16, 2026 at 12:33 pm

    I use a slightly different approach, which has been UpdatePanel-friendly in my experience, which you may want to consider.

    Instead of generating HTML content directly in the Render() method, I inherit my control from CompositeControl and fill it with child controls in the CreateChildControls() method. With the controls collection populated, the render method sort of “takes care of itself.”

    To the Update Panel, this composite control is just a bucket of otherwise-ordinary server controls, so the built-in behavior “just works.”

    If you haven’t worked much with composite controls, here’s a resource to get started. I tend to build the whole control tree rather than override the RenderControl() method, but it’s a reasonable resource anyway.

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

Sidebar

Related Questions

I have a custom control which inherits from System.Web.UI.Control and some of its properties
I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
I have a custom control which has a property of type Collection<System.Drawing.Point> . When
I have a custom control (ascx) which implements the IPostBackEventHandler interface for intercepting custom
I have a custom control: it's managed code, which subclasses System.Windows.Forms.Control. I want to
I have a custom control which displays results of some operations. It is hidden
I have a custom server control which wraps a RadEditor (basically a textarea). I
I have a DropDownList as a custom control inserted into a subform which is
I have a custom control with a public collection marked as DesignerSerializationVisibility.Content . When
I have a custom Control which contains the generic.xaml inside the Themes folder. I

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.