This is a migrated thread and some comments may be shown as answers.

RadWindow, onclientclose, __dopostback, ajax, aspx and usercontrol.

3 Answers 315 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brent
Top achievements
Rank 1
Brent asked on 01 Oct 2008, 03:59 PM
Hi,

- I have a main aspx page containing an ascx user control I've created.
- The user control contains a RadAjaxManager and a RadWindowManager.
- The user control has an imagebutton on it that opens a modal RadWindow.
- In the javascript function assigned to the on close of the RadWindow, I call __dopostback.
- The dopostback() refreshes the entire main aspx page.

PROBLEM:
So, all of the above works, except the entire main aspx page refreshes (full postback is done).  I only want to refresh the user control (partial postback), using ajax.

So perhaps this is just more of a AjaxManager question...  but I must not be "ajaxifying" the correct updated / target controls.

The crappy thing is that I had the partial postback working, but was then running into many other issues with the RadWindow.  In the past I was also trying to do a client side .ajaxRequest from within the function that runs on close of the RadWindow, but was having problems with that as well.

In case you want to know, I am specifying the name of the user control as my eventtarget, in the dopostback, like:  ctl00$ContentPlaceHolder$ctl00$ContentPlaceHolder$ucUCCIndexingFilingControlsParent$ucFilingDetails

Perhaps you can just guide me as to how you would:
 - Open a RadWindow from within a user control.
 - When it is closed, have it post back to the server, but be ajaxified so that only part of the page is posted / refreshed.

Q.  Should I just move all of the javascript to the user control, instead of having it in the main aspx page?

Thanks,
Brent

3 Answers, 1 is accepted

Sort by
0
Brent
Top achievements
Rank 1
answered on 01 Oct 2008, 04:07 PM
MORE INFORMATION:
When I call .ajaxRequest from within the javascript function that runs onclientclose of the RadWindow (see below), I get the error that I've listed below the code, the SECOND time I try to open the RadWindow.

window[

'<%= UCCIndexingRadAjaxManager.ClientID %>'].ajaxRequest(ajaxEventArgs);

ERROR:
Microsoft JScript runtime error: 'this._windows.length' is null or not an object

So in this scenario, I've successfully opened the radwindow, closed it, got the args I needed, and did the partial postback of only my user control.

But as soon as I click the button again that opens the RadWindow, I get the error.

Ideas?
0
Brent
Top achievements
Rank 1
answered on 01 Oct 2008, 04:10 PM
LAST BIT OF INFORMATION (may be inconsequential):
As mentioned above, when I use ajaxRequest instead of __dopostback, I get the behavior I desire but then I get the error when I click the button to open the RadWindow a second time.

The window DOES open, but doesn't appear to be "my" radwindow.  It sort of appears to be the default (it isn't using my skin).  But maybe because of the error, the skin / css doesn't get applied... don't know.
0
Brent
Top achievements
Rank 1
answered on 01 Oct 2008, 06:50 PM
CAUSE:
I had the RadWindowManager in my user control... while the javascript was in the main aspx page.

SOLUTION:
Once I moved the RadWindowManager to the main aspx page, the problem was resolved.

Done...
Tags
Window
Asked by
Brent
Top achievements
Rank 1
Answers by
Brent
Top achievements
Rank 1
Share this question
or