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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:33:51+00:00 2026-05-26T17:33:51+00:00

I have a custom control that mimics to some extent the built in ASP.Net

  • 0

I have a custom control that mimics to some extent the built in ASP.Net CheckboxList control. On the render event I generate a UL>LI>Checkbox#customId structure based on the DataSource the control is getting.

My biggest puzzle is that, even though the input HTML elements get rendered on the page, when submitting back the page, the Request.Form collection has no data related to these inputs.

So, my question is this:
Once a PostBack is triggered, is there a way to get the inputs checked by the user?

Thanks in advance,
Kali

  • 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-26T17:33:52+00:00Added an answer on May 26, 2026 at 5:33 pm

    Typically, a custom server control will implement the SaveViewState, LoadViewState, and TrackViewState methods to manage the state of controls.

    I don’t know how you’re control is built so I can’t give you the exact code, but here’s an example of those methods being used in a control that I created:

    protected override void LoadViewState(object savedState)
    {
        if (savedState != null)
        {
            object[] state = (object[])savedState;
    
            if (state[0] != null)
                base.LoadViewState(state[0]);
            if (state[1] != null)
                ((IStateManager)ItemStyle).LoadViewState(state[1]);
            if (state[2] != null)
                ((IStateManager)headerStyle).LoadViewState(state[2]);
            if (state[3] != null)
                ((IStateManager)AlternatingItemStyle).LoadViewState(state[3]);
        }
    }
    
    protected override object SaveViewState()
    {
        object[] state = new object[4];
    
        state[0] = base.SaveViewState();
        state[1] = itemStyle != null ? ((IStateManager)itemStyle).SaveViewState() : null;
        state[2] = headerStyle != null ? ((IStateManager)headerStyle).SaveViewState() : null;
        state[3] = alternatingItemStyle != null ? ((IStateManager)alternatingItemStyle).SaveViewState() : null;
    
        return state;
    }
    
    protected override void TrackViewState()
    {
        base.TrackViewState();
    
        if (itemStyle != null)
            ((IStateManager)itemStyle).TrackViewState();
        if (headerStyle != null)
            ((IStateManager)headerStyle).TrackViewState();
        if (alternatingItemStyle != null)
            ((IStateManager)alternatingItemStyle).TrackViewState();
    }
    

    Aside from the above methods, if you want to reload information from the Request object, you can implement the IPostBackDataHandler interface, which requires these two methods:

    public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection)
    {
        string somePostedValue = postCollection["SomePostedValue"];
        string anotherPostedValue = postCollection["AnotherPostedValue"];
    }
    
    public virtual void RaisePostDataChangedEvent()
    {
    
    }
    
    • 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 that extends ASP.NET Update panels. On the server side
I have a Custom Control that has multiple textbox fields and a checkbox contained
I have a custom control that inherits from .NET's CompositeControl class. This control overrides
I have a custom control that has an event. I have a window using
I have a custom control that I use that has some (NSTextField *) NSCells
I have a custom control that will do some fancy stuff, once it knows
I have written a custom control that renders some graphics. The graphics itself is
I have an ASP.NET control that binds data to a repeater. Inside that repeater,
The background is I have a custom control that is a asp:Menu that is
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).

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.