Adding ASP.net control to JQuery Dialog doesn't render correctly?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

Up vote 0 down vote favorite share g+ share fb share tw.

Hi I've seen quite a few similar questions to this but all have been resolved by adding the dialog back into the page's main form. This doesn't resolve the following problem: In my Aspx file, I've defined a segment of code as following: and I've got the following javascript / jquery to initialise the dialog $("#areaFilterDialog"). Dialog({ bgiframe: true, autoOpen: false, resizable: false, modal: true, draggable: true, closeOnEscape: true, width: 630, open: function (type, data) { dialogOpen = true; $(this).parent().

AppendTo("form"); } }); }); which appends the dialog's element to the form on the parent page. In a . Cs file, I add content to the element as follows: var departmentCode = e.

DepartmentCode; var summaryType = e. SummaryType; var summaryCode = e. SummaryCode; var totalName = e.

TotalName; var view = this.TemplateControl. LoadControl(". \\WebControls\\FilteredAreaRadGrid.

Ascx") as FilteredAreaRadGrid; using (var businessManager = new BusinessManager(new DALConnection(this. DalConnectionString))) { view. DataSource = businessManager.

GetData(departmentCode, summaryType, summaryCode, string. Empty); this. AreaFilterDialog.Controls.

Add(view); } and I make the JQuery UI Dialog show by registering the following startup script with the ScriptManager: var script = string. Format("ShowAttendanceFilterPopup('{0}');", totalName); ScriptManager. RegisterStartupScript( this.

Page, this.Page.GetType(), "tmp", string. Format("", script), false); which calls the following javascript / jquery: function ShowAttendanceFilterPopup(summaryName) { $("#areaFilterDialog"). Data('title.

Dialog', summaryName); $('#areaFilterDialog'). Dialog("open"); $('#areaFilterDialog'). Dialog("enable"); } The problem is that the html which should have been appended to the dialog is actually just appended to the top of the page, and the dialog box is not shown at all.

If I don't add a Control to the dialog before I show it, the dialog displays correctly. I've tried this with what I add currently, which is a UserControl containing a Telerik RadGrid, but also with a standard asp button, and both have the same behaviour. Anyone got any ideas to what I'm doing incorrectly or even better, a solution to this problem?

Thanks a lot, Rob c# asp.net jquery-ui jquery-ui-dialog link|improve this question asked Oct 14 '11 at 14:51rjbell00426 75% accept rate.

It may be able to help you figure out exactly what is going on here. You know the process of updating the div is somehow affecting the dialog box -- using firebug you can examine the DOM at every step and get some insight into what exactly is happening. – mikey Oct 14 '11 at 16:29 yes it's being added to the div correctly but the styling isn't being applied even though it's attributed to the elements.

– rjbell00 Oct 14 '11 at 17:52.

Perhaps try: I've not used the Telerik Ajax Panels but I'm guessing something like: using (var businessManager = new BusinessManager(new DALConnection(this. DalConnectionString))) { view. DataSource = businessManager.

GetData(departmentCode, summaryType, summaryCode, string. Empty); RadAjaxPanel2.Controls. Add(view); } Having the div inside the AjaxPanel ContentTemplate and adding the view Control to it just doesn't seem right to me.

You can't directly add a Control collection of an UpdatePanel object, but if you add it to the ContentTemplateContainer object's Controls collection, it works! Thank you :-) – rjbell00 Oct 17 '11 at 8:41 Actually, that doesn't work. It works the first time I update the panel, but will not update it again (the data being retreived is correct, just it doesn't update).

Any ideas? – rjbell00 Oct 17 '11 at 8:53 I needed to do a view.DataBind(); after I reset the DataSource property. I'll still mark this answer as correct as it was pretty much 90% of the fix.

Cheers! – rjbell00 Oct 17 '11 at 9:04 Glad to hear! I am an Anthem.

NET guy (sad though because it is kind of an orphaned project) -- so I get the idea of ajax panels but I've not used them. Happy to help even a little. – mikey Oct 17 '11 at 12:25.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions