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

  • Home
  • SEARCH
  • 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 6902187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:46:00+00:00 2026-05-27T07:46:00+00:00

I have create one web part in sharepoint 2010. In CreateChildControls() method i write

  • 0

I have create one web part in sharepoint 2010. In CreateChildControls() method i write following code.

 Panel pnlPropertyDiv;
    Button btnEmployee;
    CheckBoxList plist;
    CheckBoxList rlist;
    HtmlGenericControl divleft = new HtmlGenericControl("div");
    HtmlGenericControl divmiddle = new HtmlGenericControl("div");

    protected override void CreateChildControls()
    {


            plist = new CheckBoxList();
            plist.ID = "ProjectCheckbox";
            plist.Items.Add("p");
            plist.Items[0].Attributes.Add("style", "display:none");

            rlist = new CheckBoxList();
            rlist.ID = "ResourceCheckbox";
            rlist.Items.Add("r");
            rlist.Items[0].Attributes.Add("style", "display:none");

            Panel pnlContainer = new Panel();
            pnlContainer.ID = "Project_Container";
            this.Controls.Add(pnlContainer);
            pnlPropertyDiv = new Panel();


            divleft.ID = "left";
            divleft.Attributes["style"] = "float:left; border-right: 1px solid #E1E3E4;height: 65px;text-align: center;width: 200px;";
            pnlPropertyDiv.Controls.Add(divleft);
            divleft.Controls.Add(plist);


            divmiddle.ID = "middle";
            divmiddle.Attributes["style"] = "float:left; border-right: 1px solid #E1E3E4;height: 65px;text-align: center;width: 200px;";
            pnlPropertyDiv.Controls.Add(divmiddle);
            divmiddle.Controls.Add(rlist);

            HtmlGenericControl divfooter = new HtmlGenericControl("div");
            divfooter.ID = "footer";
            divfooter.Attributes["style"] = "text-align: center";
            btnEmployee = new Button();
            btnEmployee.ID = "btnEmployee";
            btnEmployee.Text = "Apply";
            btnEmployee.Click += new EventHandler(btnEmployee_Click);
            divfooter.Controls.Add(btnEmployee);
            pnlPropertyDiv.Controls.Add(divfooter);
            pnlPropertyDiv.ID = "EditProperties";
            pnlPropertyDiv.Attributes.Add("style", "width: 410px;position:fixed;top:45px;right:18px;z-index:1;color: #6C6E70;font-family: 'Segoe UI',Tahoma,Verdana,sans-serif;font-size: 8pt;");
            this.Controls.Add(pnlPropertyDiv);


    }

using jquery i add new checkbox in checkbox list.Below is my button event code.

        project = "";
        resource = "";
        foreach (ListItem pclist in plist.Items)
        {
            if (pclist.Selected == true)
            {
                project += pclist.Text;
            }
            else
            {

            }
        }
        foreach (ListItem rclist in rlist.Items)
        {
            if (rclist.Selected == true)
            {
                resource += rclist.Text;
            }
            else
            {

            }
        }

My problem is when i click my button i am not able to get checkbox which is added by jquery.Because CreateChildControls() method always call first and override checkboxlist control so changes apply by jquery is override.

Note:-

I am not able to use ispostback because CreateChildControls() have must call when page refresh.

  • 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-27T07:46:01+00:00Added an answer on May 27, 2026 at 7:46 am

    I’m not convinced you will beable to access the checkbox added by jquery within the c# code behind. The jquery checkbox won’t be added to the .Net control tree so won’t be accessible to any server side processing.

    You can do the other way. Add a control in C# then access through JQuery. Standard stuff.

    Could you put the control in a div with style=”display:none” set then use JQuery to show it.

    $('#PanelClientID').show()
    

    That might work for you?

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

Sidebar

Related Questions

I am working on sharepoint 2010. I have created a simple visual web part
I have a strange one. Create a new form. Then add the following function
I have to create a web part that displays all site collections under the
I have to create one table using XSLT and CSS. The table should look
i have to create a line chart with finance information like the one in
I have created one user named tuser with create database rights in SQL server
I have created one table using the below command: create table Table1( Id int
I have a class: class One def initialize; end end I need to create
I have a file with one line in it. I create a branch and
We create a socket. On one side of the socket we have a server

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.