Hi,
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? :-)