By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

How To load a UserControl Dynamically with ATLAS?

P: n/a
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é

Jul 24 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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!
*************************************************
<A.******@googlemail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
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é
Jul 24 '06 #2

P: n/a
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é


msnews.microsoft.com schrieb:
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!
*************************************************
<A.******@googlemail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
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é
Jul 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.