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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:36:13+00:00 2026-05-11T23:36:13+00:00

I got a user control containing a form. On a page that includes the

  • 0

I got a user control containing a form. On a page that includes the user control, I need to populate the form in the user control, when the user pushes a button.

Heres how I’ve done it, and it doesn’t work:

User Control:

public partial class editUC : System.Web.UI.UserControl
{
    public DataTable dataTable { set { UpdateForm(value); } }

    protected void Page_Load(object sender, EventArgs e) { }

    private void UpdateForm(DataTable dt) { txtControl.Text = dt.Rows..... ... }
}

Where UpdateForm binds different text boxes.

And the page containing the UC, when a button has been clicked:

EditUserControl.dataTable = dt;

Clicking the button, nothing happens. What am I missing here?

Thanks in advance.


UPDATE:

I got a bit closer. It’s because I’m using a jQuery dialog for the user control. It works if I remove the jQuery.

This is how I create the dialog:

$(document).ready(function() {
    var dlg = $('.editFormDialog').dialog({
        autoOpen: false,
        height: 650,
        width: 550,
        modal: true,
        bgiframe: true,
        title: 'Rediger',
        open: function(type, data) {
            $(this).parent().appendTo("form");
        }
    });

    dlg.parent().appendTo("form");

    $('#btnEdit').live('click', function() {
        $('.editFormDialog').css('visibility', 'visible');
        $('.editFormDialog').dialog('open');
    });
});

I am appending it to the form, but it doesn’t work. Any ideas?


2nd update:

It works if I remove the update panels from the page. Any ideas? 🙂

  • 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-11T23:36:13+00:00Added an answer on May 11, 2026 at 11:36 pm
    1. are you using Caching on the control? If the control’s contents is cached using the ASP.NET control caching mechanism, then there will be no change on the control’s text.

    2. Can you add a breakpoint inside the private void UpdateForm(DataTable dt) to make sure this function gets called when you click on your button?

    3. Depending on what the user control contains you might need to do a EditUserControl.DataBind();

    4. If you are sending javascript code (jquery) as part of your update panel async postback, it’s important to remember that javascript will not be evaluated by the browser. You need to find another method to run that code after your async postback.

    Also, when you do an async postback on an UpdatePanel control, all the DOM elements in that control get trashed and replaced by new elements. The jQuery elements have to be re-created again.

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

Sidebar

Ask A Question

Stats

  • Questions 162k
  • Answers 162k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think it depends a lot on what you mean… May 12, 2026 at 12:05 pm
  • Editorial Team
    Editorial Team added an answer I finally choose SqlCommandBuilder to build insert command automatically See… May 12, 2026 at 12:05 pm
  • Editorial Team
    Editorial Team added an answer Try this: Imports System Imports System.IO Class Program Shared Sub… May 12, 2026 at 12:05 pm

Related Questions

I am developing a desktop application with a MainForm that's grown rather large. There
I got a user control which implements a reference to a css file, now
I've got a user control that has an event that I can subscribe to.
I've got a LinkButton control in a user control like this (Accordion is from

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.