How To load a UserControl Dynamically with ATLAS?

A

A.Wussow

Hi Everybody,

i want to load dynamically content from some user controls (with forms,
or some data-controls) using atlas. So i use an UpdatePanel for loading
the user control into a placeholder.

Using buttons for loading new content works fine. But i still want to
use a function which is callable per javascript. I think this way is
more flexable than using the Buttons, becaus every button needs it's
own Sub-Routine. But i want to have a function with an Parameter for
loading the new content.

But i don't know how to realize it. For me, it is important to load
elements with own routines for working with some data dynamically.

How do you realize loading content pages with forms or other controls
dynamically per Atlas?

I have tried so much, but haven't find a comfortable way.

Thank you for every hint.

Best regards,

André
 
M

msnews.microsoft.com

You are NOT going to load user controls via Atlas. Atlas is asynch and does
not take a "trip" back to the server (means the whole page takes a trip, not
the data taking a trip). User controls get loaded on the server side. If you
need to load a user control, via normal means, you will have to take the
full trip.

Is there a way around this?
Sure, load the controls into "hidden" layers and activate via Atlas on the
client side. You can also have the control use Atlas to fill itself with the
data related to the Atlas "click". You can also create JavaScript that
interacts with Atlas to create controls on the client side. Be careful how
deep you go in this direction before refactoring, as you will likely end up
with better reuse if you occasionally examine your work and look for places
where your controls can emit JavaScript (and AJAX code).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
Hi Everybody,

i want to load dynamically content from some user controls (with forms,
or some data-controls) using atlas. So i use an UpdatePanel for loading
the user control into a placeholder.

Using buttons for loading new content works fine. But i still want to
use a function which is callable per javascript. I think this way is
more flexable than using the Buttons, becaus every button needs it's
own Sub-Routine. But i want to have a function with an Parameter for
loading the new content.

But i don't know how to realize it. For me, it is important to load
elements with own routines for working with some data dynamically.

How do you realize loading content pages with forms or other controls
dynamically per Atlas?

I have tried so much, but haven't find a comfortable way.

Thank you for every hint.

Best regards,

André
 
A

A.Wussow

Hi,

thanks for your answer.
Yes i know, that the user controls aren't loaded with Atlas. But i Call
a Method on Server Side, which loads the user control. And with a
TriggeredEvent (per UpdatePanel) the Postback is stopped and only the
UpdatePanel refreshes.

Here is some code:
At first the Method on Server-side:
<WebMethod()> _
Public Function Test(ByVal intId As String) As Boolean
Dim contentName As String = intId & ".ascx"
Dim contentControl As Control = Page.LoadControl(contentName)

PlaceHolder.Controls.Add(contentControl)

Return True
End Function

And now the JavaScript Function which is called per Link:

function test(intId) {
PageMethods.Test(intId, CallBack);
}

So after called per Link, nothing ist done, because there was no
Postback. But if i use a Button, it works finde.

Im actually analyize the Atlas.Js to find a better way for doing a
async Postback without a triggered Control.

Best regards,

André
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top