PDA

View Full Version : [CLOSED] Help with viewport sample



LuB
Aug 19, 2008, 3:43 PM
Hi! I'm trying to adapt the viewport with BorderLayour sample to use in a personal project. I want to show an aspx page in each panel of accordion control, select an option of this panel (with buttons, links or anything) and show a page in a tab in center region.

But I have a problem: when I add in the panel some asp.net controls (buttons, for example), I have a crash when I click them. If I add coolite buttons, they doesn't show when I run the application. (I'm using AutoLoad property in the panel to show the page with the buttons). The buttons are visible if I run only the page which contains them (not the viewport page).

Can someone help me? (any sample or something like it would be very welcome!)

(Disclaimer: I'm from Argentina and my english sucks. Sorry if you can't understand me and thanks for trying!)

geoffrey.mcgill
Aug 19, 2008, 4:11 PM
By "crash", do you mean Visual Studio crashes when you add a control during design time? If yes, are you using any other 3rd party controls on the same page? If yes, which one(s)?

If VS is not crashing, the can you provide more details on what exactly is crashing? the browser? which would be very strange. Or, are you just getting a JavaScript error? or is an Exception thrown?

I think you might have to post some code demonstrating what you've got so far?

LuB
Aug 20, 2008, 9:58 AM
geoffrey.mcgill (8/19/2008)By "crash", do you mean Visual Studio crashes when you add a control during design time? If yes, are you using any other 3rd party controls on the same page? If yes, which one(s)?

If VS is not crashing, the can you provide more details on what exactly is crashing? the browser? which would be very strange. Or, are you just getting a JavaScript error? or is an Exception thrown?

I think you might have to post some code demonstrating what you've got so far?


I have several problems:

-If I open in IE6, It doesn't show anything in the panel in the accordion (only Loading...).
-In Firefox 3, the panel shows the aspx page (Paginas.aspx), and I can see the asp.net button, but not the coolite button.
-If I click the asp.net button, I get an exception.

I'm attaching the code. Just copy the Coolite dll.

Thanks!

geoffrey.mcgill
Aug 20, 2008, 2:08 PM
Based on your description, I think you're just getting a JavaScript error somewhere. I'm taking a look at your sample now.

geoffrey.mcgill
Aug 20, 2008, 3:27 PM
The problem is caused because the AutoLoad property is loading another .aspx Page which contains a <form> and server controls. The AutoLoad feature is very unique in that it takes the html of the AutoLoad page (Child) and adds it directly to the Parent Page. The two become one.

The AutoLoad property makes an ajax request for the Child page, so the complete lifecycle of the Child is executed. AutoLoad then takes the Child html response and adds it directly to the Parent. It's kind of like a client-side file include.

In general, if you have an asp.net web control, for example <asp:Button>, on the Child, then clicking the Button will trigger a postback, not to the Child, but to the Parent. Because the button was on the Child, but the server is trying to process through the Parent, you may get a Exception and/or unexpected results. The Child posts back to the Parent.

If you want to define functionality within a Child Page and that child contains asp.net web controls which post back to the server, I would suggest adding the functionality to a web user control (.ascx), or loading an <iframe> with the Child.

If the .AutoLoad property is set with a url which starts with "http", then AutoLoad thinks you're loading an external domain and loads the url into an <iframe>.

If the Child does not contain postback controls, using AutoLoad shouldn't be a problem.

I think for your scenario, it would be best to add the Child controls/functionality to a web user control (.ascx), then add the .ascx to the <Content> section.

Hope this helps.

LuB
Aug 21, 2008, 2:37 PM
Thanks, I think I will use iframes.