473,322 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How To load a UserControl Dynamically with ATLAS?

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
2 1774
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Josema | last post by:
Hi to all, I have a webform.aspx and inside i have a dropdown list with autopostback and a place holder... Depending of the selected index that the user selects in the dropdownlist i load a...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
0
by: Matt Howeson | last post by:
I have a problem with a usercontrol that is dynamically loaded, from a web control and is not restoring it's viewstate properly. Here's the scenario. Within our content management system, I have...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
4
by: sebastien | last post by:
Hi, In page_load : If Not Page.IsPostBack Then Dim myUC As UserControl = LoadControl("ficheProspects.ascx") myUC.ID = "FicheProspects1" End If In another Sub i need to find my control :
2
by: Eric Falsken | last post by:
Eric Falsken <eric@db4o.com> wrote on 04 Dec 2005: > craigkenisston@hotmail.com wrote on 19 Nov 2005: > >> I'm working in the migration of an asp.net application in 1.1 to 2.0. >> I'm new to...
1
by: urs | last post by:
Two days ago, I built an ASP.NET 2.0 application and published it on a shared IIS 6 Web server. After publishing, and during the whole day, it worked fine. The server remained untouched since....
0
by: ush | last post by:
while dynamically loading usercontrol I am getting the errror - ' type 'ImageButton' must be placed inside a form tag with runat=server '. how to solve this - if a usercontrol contains...
0
abehm
by: abehm | last post by:
I have a couple placeholders in which I want to dynamically load user controls into a multi-pageview based on db data. The database returns the filename of the user control (i.e....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.