Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Wednesday, March 28, 2012

Atlas with multiple GridViews

I have a page which needs to allow user to populate fields by selecting rows from Gridviews. I would like to temporarily display a GridView with search field to locate a row, then populate the associated field with a value from GridView row and move on to the next field with it's own associated GridView.

Is it possible to do true Ajax with Atlas, e.g. load content dynamically? It would be nice if the GridViews didn't load their corresponding data sources until acutally needed for a given field. I thought I might use the Atlas Control Toolkit's collapsible panel component but not sure if this is the best way to only render a GridView when it's needed.

Any suggestions on how to go about this would be appreciated.

hello.

though i haven't understood your scenario very well, i think that atlas can help you accomplish this. since you've spoken about gridviews, i think you'll want to use the server side approach, where you use an updatepanel to have a partial update zone on the page.

in these situations, you can have a placeholder and add controls dinamically to that control during postbacks (partial or complete).


Hi Luis

I'm not sure I understand my scenario completely either ;)

But suppose I have a drive name field. If a user clicks on choose button, a panel with search field and GridView pops up, allowing the user to select a driver from the user database. The driver name field is populated and the GridView disappears. Since I have a number of fields I need to allow the user to fill by choosing from a GridView I don't want to populate the page with GridViews at the outset.

Your idea sounds like it could work, but I'm unclear on what events I should use to dynamically add the GridView and search field. It would be great if you could direct me to a sample where someone uses Atals to replace content dynamically (would be great if it was with a GridView ;).

Thanks much!

hello.

hum...i think that basically we're talking about dynamic replacement of a portion of the page. you may use usercontrols to encapsulate both parts (on has the textbox and the search button and the other user control has the grid) and you'll need to work with the params collection in order to replace the controls dynamically (search the forums because one or two days ago i've wrote a small sample that shows how to replace the usercontrols dynamically in an updatepanel).

Atlas with javascript

I will try to put an update panel around a content place, in order to assure only the "inside" pages will be refreshed, leaving the master page static. There might work I suppose...

Is there any problem in registering our own javascript in a page that has an Atlas control like updatepanel ? If yes, how could it be worked around?

Hi

Should be able to just register your Javascript with the script manager on the page. If the javascript is going to be put in the master page then add the script manager to the master page and register the script in the code behind for the master page.

If you need to register more stuff in the content pages use the ScriptManagerProxy in the content page as you can only have a sing le script manager on a page.

A good over view ishttp://www.nikhilk.net/AtlasScriptManager.aspx

Hope that helps


Hi,

in addition to what Richard Line wrote; if you're going to inject JavaScript code (or script references) in a page after a partial postback, then you must rely on the static RegisterXXX methods of the ScriptManager.

Atlas with Asp.net web pages

I have a problem with how to communicate with Web page using atlas script(i dont want to use Web service).i need to send data from client to server. appriciate if any body can help regard on this matter.

Thanks

Better go for magicajax. Its very simple. Add the dll to project refrence. Put your form tag inside ajax panel and do your natural work. magicajax will take care of the rest.
You can expose a Web Service directly from an ASP.NET Web Page:http://atlas.asp.net/docs/atlas/doc/services/exposing.aspx#webpage

-Mike

you can use atlas:updatepanel around the web controls which you want to update data after postback. The updatepanel will automatic control data send and receive between client and server side, it also automatic refresh the web without reload the page.

Quick way to use atlas update panel:

1. Remember to edit your web.config to configure for Microsoft.Atlas (view the web.config in Atlas setup folder: C:\Program Files\Microsoft ASP.net\Atlas). Remember to copy the Microsoft.Web.Atlas.dll to your bin folder.

2. in your aspx page, remember set runat="server" for head tag. in this section, you can declare a scriptmanger control like this

<head runat="server">
<atlas:ScriptManagerID="ScriptManager1"runat="server"EnableScriptComponents="true"EnablePartialRendering="true"/>
</head>

3. In your aspx body, under the form tag, you add atlas update panel
<form runat="server">
<atlas:UpdatePanel><ContentTemplate>

... your web controls and HTML controls ... here

</

ContentTemplate></atlas:UpdatePanel>
</form>

That all. You don't need to change any code in your .aspx.vb or .aspx.cs file, Run your website project and you will see the effect of Atlas to your page postback behavior.

Of course, above is just the easiest and unprofessional way to apply Atlas to your asp.net website project. You can try the Triggers of the Update Panel and you can read more to take advantages from Atlas.

Happy Atlasen

Atlas with a base page

In my current application, I have a class named BasePage that inherits from System.Web.UI.Page. Some of the pages in my application inherit from the BasePage class. I need the BasePage because I use it to build my menus, user controls, and also some business logic. The pages that inherit from the BasePage class will not work (won't update the page) with EnablePartialRendering set to true. The only error that I received was in Atlas.js at:

var title = delta.selectSingleNode('/delta/rendering//title/text()');
document.title = title.nodeValue.trim();

I ended up adding a check for a null title, which removed this error. BTW, title was null because it is a property set in a user control on my base page. Any ideas as to why/how I can get EnablePartialRendering to work while still inheriting from the BasePage?

If the issue was just with the title being null, then that will be fixed in the next release of Atlas. There shouldn't be any specific problems related to having a base class page when using UpdatePanels.

Thanks,

Eilon

Atlas WebPartZones Visible property not working correctly

Hi All,

I have an ASPX page that contains three WebPart Zones. As per therequirements, one of the Zones, say rightZone, needs to be hidden for,say X, role. For this I check the user role in the Page_Load event, andif logged-in user's role is X then I set rightZone's Visible propertyto false. This works fine using ASP.NET 2.0 WebParts.

I wanted to have drag-and-drop in FireFox as well; therefore, I used"Atlas" (March CTP) WebPartManager and WebPartZone to achieve the same.This works fine for all roles except X. That is, when an X type userlogs in, a JavaScript error is displayed. It goes something like this:

Could not find 'rightZone' element.

On further investigation I found out that if set the rightZone isrendered even though its visible property is set to false. I guessthat's the reason for JavaScript error.

Please let me know if this is a bug in "Atlas" or I am doing something wrong.

Thanks.

~Vihar

It's generally not a good idea to set Visible=false on a WebPartZone. The Visible property only controls whether the WebPartZone is rendered, not whether the WebPartZone participates in the WebParts control set. For example, if a WebPartZone has Visible=false, it will still appear in the list of WebPartZones in the CatalogZone and LayoutEditorPart. This will be confusing to users, since they will be able to add or move a WebPart to an invisible WebPartZone.

A better idea is to remove the WebPartZone from the page completely. You would need to do this in the PreInit phase of the lifecycle.

All this aside, you have indeed found a bug in Atlas, and it applies to any server control, not just WebParts. The xml-script for a control is always being rendered, even if the control is not visible. This is a bug because the xml-script for a control usually assumes that the control was actually rendered. We'll work on fixing this for a future release. Thanks.

-Mike
For now you could use a workaround to add the css style with display:none.

Monday, March 26, 2012

Atlas UpdatePanel wont display certain data records

I have a page with a GridView that displays about 50 records, 5 per page. Works great without Atlas. Once I added an Atlas UpdatePanel to the page, the paging of the GridView stopped working. I've researched the problem, added a DetailsView control to the UpdatePanel, and discovered that the 9th record of the dataset won't display with Atlas, but will without Atlas. I can't find anything unusual with the data record. Any help/suggestions? Thanks.

Is it possible that the record contains some data that is not properly HTML encoded? If it's not confidential data, can you show part of that record so we can see it?

We made a number of fixes in the March CTP to allow for more relaxed support for HTML. In the next CTP we will have even better support for data that isn't quite XHTML compliant as well.

Thanks,

Eilon

Atlas updatepanel triggered by user control event

I created a user control which has a imagebuttton in it, I then exposed the click event of the button to the page the user control was placed on using the following code:

Public Event ImageButton1_Click(ByVal senderAs Object,ByVal eAs EventArgs)Private Sub eventXYZ(ByVal senderAs Object,ByVal eAs System.Web.UI.ImageClickEventArgs)Handles ImageButton1.ClickRaiseEvent ImageButton1_Click(sender, e)End Sub

I can use this event from the ASPX page with no problems, however when I use the event as an Atlas trigger for the updatepanel the page always posts back. Is there any way to wire this event up to the upatepanel and avoid the postback (btw the user control was not added dynamically).

Any chance you've found a resolution to this? I'm having the same issue but with a dropdown in a user control....

Thanks.


hello.

well, not something supported out of the box...maybe this tip will help you:

http://forums.asp.net/thread/1345407.aspx

Atlas UpdatePanel in MasterPage but the page refreshes completely.

I have used atlas script manager and atlas update panel in Master Page.

My scenario is not to refresh my header,the content place holder will have the dynamic content.This operation works well in Mozilla browser.

But when i select a menu in header the page get refreshed in IE browser,but this is not happening in Mozilla browser.

May i know what is the problem getting refreshed with IE.

Have a look at this tutorial about Using UpdatePanels in Master Pages:http://asp.net/AJAX/Documentation/Live/tutorials/UsingUpdatePanelMasterPages.aspx

Without seeing your code, it's tough to know what's going on...

-Damien


I have used AtlasControlToolKit.DLL and its corresponding Dlls

<atlas:ScriptManagerID="ScriptManager1"EnablePartialRendering="true"runat="server">

</atlas:ScriptManager>

<atlas:UpdatePanelID="upPortal"runat="server"RenderMode="Inline"Mode="Conditional">

<ContentTemplate>

<CustomWebPart:PortalWebPartManagerID="HomeWebPartManager"runat="server">

</CustomWebPart:PortalWebPartManager>

<asp:ContentPlaceHolderID="ContentPlaceHolder1"runat="server">

</asp:ContentPlaceHolder>

</ContentTemplate>

</atlas:UpdatePanel>

My Page gets refreshed even after having update panel in MasterPage.

The Page refresh only for IE browsers and in Mozilla the page is not refreshed and please guide me what is the problem how to resolve this.

I have added the page in my Testing Server . please view the output and get me out of this issue resolved

http://221.134.108.199/Theforum/authentication/userlogin.aspx

Thanks

Navya Jeevan


You are saying you used atlas Update Panel

I think it is older version of AJAX, use latest version

http://asp.net/ajax/documentation/live/tutorials/UsingUpdatePanelMasterPages.aspx


You can get the latest release here:http://www.asp.net/ajax/default.aspx

-Damien

Atlas UpdatePanel control is not working on a Microsoft CMS (MCMS) site page

Hi all,

I am really puzzled about the Atlas UpdatePanel control not working on a MCMS template page. Can someone please comment on possible fixes, issues related to using this control of MCMS? I am not very familiar with how the control work under the hood. Can someone pinpoint me where to find documentation on the internal workings of this control?

Here is what I have tried so far.

I followed the insertion of the javascript on the page_load event handler post on this linkhttp://blogs.technet.com/stefan_gossner/archive/2006/06/01/431687.aspx?CommentPosted=true#commentmessage

// register a client script that ensures that the action property
// is correct when AJAX tries to do its postback.
string script =
"\n<script type=\"text/javascript\">\n" +
" if (typeof (__CMS_CurrentUrl) != \"undefined\")\n" +
" {\n" +
" __CMS_PostbackForm.action = __CMS_CurrentUrl;\n" +
" }\n" +
"</script>\n";

Page.ClientScript.RegisterStartupScript(this.GetType(), "AdjustActionForAJAX", script);

However, no luck at all.

Here is a description of the behaviour after that Javascript insertion.

I try using the ATLAS:UpdatePanel control and it didn't work. The button on my page and the clicked results are wrapped inside the content of the UpdatePanel. In view mode, it still does a postback by refreshing the page. And in author mode, there are more problems. The edit link for the web author console will not show up when it is clicked.

Have anyone tried using the ATLAS:UpdatePanel control with a MCMS site.

The only post I found ishttp://forums.asp.net/thread/1335638.aspx
The person responded the following:

It was a painful lesson, but I was able to see multiple things that CMS did to break ATLAS.

- CMS writes a JScript block intercepts the ATLAS async post sent from the client and throws it on the floor. So, the client never gets the post back off the machine. Turns out using the DefaultConsole control is writing the additional JScript block. Needed for CMS editing of the page.

- When using the cms:RobotMetaTag control in CMS, it will cause the XMLDOM load to fail for ATLAS on the postback because of the '&' characters in a <BASE> tag. Plus there is a <META> with no closing tag. This control can be removed if you don't want to use the CMS feature.

We resorted to placing the ATLAS enabled page in an iFrame of a page that was done in CMS. Seems to work

This is still an issues with 1.0 RC.

Has anyone else been able to get the UpdatePanel to work with MCMS?


Here is what I finally came up with to adjust for the ugly CMS urls that was causing AJAX to reject the post backs from UpdatePanel. This is currently going through test, and I'm not sure if it broken FireFox, but this is what I have to get it work in IE.

// add this Script to handle the confusing between CMS and AJAX
string script = "\n<script type=\"text/javascript\">\n" +
"Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);\n" +
"function EndRequestHandler(sender, args) { \n" +
" if (typeof (__CMS_CurrentUrl) != \"undefined\")\n" +
" {\n" +
" Sys.WebForms.PageRequestManager._instance._form._initialAction = __CMS_CurrentUrl;\n" +
" }\n" +
"}\n" +
"EndRequestHandler(null, null);\n" +
"</script>\n";
Page.ClientScript.RegisterStartupScript(this.GetType(), "AdjustAJAXForCMS", script);


I figured out that this fix is for IE and is not needed for FireFox. Funny how the two browsers deal with this.

So I added a check for IE before I write the script block.


Does anyone have an update on this issue? I'm having the same problem and I was able to narrow it down to the RobotMetaTag object and the BASE tag that it appends.

Any help is appreciated.

Thanks,
Ahmed

Atlas UpdatePanel Browser Hang

I am currently creating a web page utilizing the April Atlas CTP. On my web page there is a dropdown list, a listbox, and two buttons for add and remove. The goal is to allow the user to select an item from the drop down and move it to the listbox. The selected item is then removed from the dropdown control. Removing an item does the same but from the listbox to the dropdown.

Here is the web page snippet:

<asp:Content ID="newJobContent" ContentPlaceHolderID="mainContentArea" runat="Server">
<atlas:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="True">
</atlas:ScriptManager>
...

<div id="artist_area" style="border: solid 1px black">
Artist(s):
<atlas:UpdatePanel ID="panelArtistDropDown" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlArtist" runat="server" CssClass="control" Width="150">
</asp:DropDownList>
<asp:ListBox ID="lstArtist" runat="server" CssClass="control" Rows="4" Width="200"> </asp:ListBox>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="btnAdd" EventName="Click" />
<atlas:ControlEventTrigger ControlID="btnRemove" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
<asp:Button ID="btnRemove" runat="server" OnClick="btnRemove_Click" Text="<" />
<asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text=">" />
<asp:CustomValidator ID="valCustArtist" runat="server" ClientValidationFunction="CheckArtist" ControlToValidate="lstArtist" ErrorMessage="You must select an artist(s)." ValidateEmptyText="True"></asp:CustomValidator>
</div
And here's the server side code:

protected void btnAdd_Click(object sender, EventArgs e)
{
ListItem li = new ListItem();

li.Value = ddlArtist.SelectedItem.Value;
li.Text = ddlArtist.SelectedItem.Text;

lstArtist.Items.Add(li);
ddlArtist.Items.Remove(li);
}
protected void btnRemove_Click(object sender, EventArgs e)
{
ListItem li = new ListItem();

li.Value = lstArtist.SelectedItem.Value;
li.Text = lstArtist.SelectedItem.Text;

ddlArtist.Items.Add(li);
ddlArtist.Items.Remove(li);
}

Here's the problem... in IE6 I can add or remove 2 items. On the third try the browser will hang. The code behind is never called. The only way to get control back is to refresh the page. With FireFox everything works great. Very strange. Has anyone experienced this? Any help would be appreciated.I've tracked down the problem. Seems like a third party tool that we use (BasicDatePicker) is causing the problem. When we remove the third party control IE works as it should. Frankly I'm not too surprised because BasicDatePicker generates a ton of javascript. Looks like I'll be coming up with a new date control ;)

Atlas UpdatePanel and FormsAuthentication Cookie Expiry

Hello all,

i have an ASP.NET 2 website that uses Forms Authentication. When the auth cookie expires, and an attempt is made to refresh a page or post-back, the browser is automatically redirected to the login page, according to settings in the web.config. All is well so far.

I then decided to use Atlas in my pages, specifically the "UpdatePanel" control in order to prevent the whole page being re-served each time when only one control needed to be updated. This also seemed to work fine.

The problem occurs when the Authentication Cookie has expired. Now instead of redirecting to the login page on a post-back, I just get a pop-up msgbox from IE6 saying simpy "Unknown Error". If I refresh the page however using the refresh browser button, i *do* get back to the login page.

I guess the Atlas Update Panel control is somehow minimising the HTML updates in the http reponse (which i guess is the whole point of the Update Panel control).. and blocking the redirect.

I have no clue how to get round this without removing Atlas - but that can't be the solution.. can it? :)

ok i've found my answer in the Atlas forums.. this is a bug in Atlas and although it was apparently supposed to be fixed in the 'next' CTP (July), it wasn't. So i'm not sure when it will be available.
I've not tried, but perhaps in your page load, something like
If Not Me.User.Identity.IsAuthenticatedThen FormsAuthentication.RedirectToLoginPage()End If

yeah, this work-around works.. almost.. if you put this in the Page_Load, it means that the actions of the postback are carried out on the server even though the user is no longer authenticated. Then, when the page_load is executed the user is redirected to the login page because it's only at this point that the authentication is checked.

It would be a bit better if the authentication could be checked in a single place in the Master page_load, but i'm not sure how to check the authentication from here since me.user.identity doesn't work.

Atlas update progress

I have page with large execution time, so I use updateProgress to show the user, taht the page is still calculating:

<atlas:UpdateProgress ID="up" runat="server">
<ProgressTemplate>
<div class="progress">
<img src="http://pics.10026.com/?src=../images/indicator.gif" />
Calculating...
</div>
</ProgressTemplate>
</atlas:UpdateProgress
I would like that user see the indicator as long as the server is calculating results .
But when 90 seconds is passed, my indicator is gone and user thinks that
calculation is done.
If I remove atlas, than page is generating 3 minutes(server.scriptTimeout is setted to 1000 seconds).
Any idea how to enlarge execution time of atlas update progress?

Regards,S

Hi there,

The timeout period for async postbacks with UpdatePanels is currently hard-coded to be 90 seconds. I don't know of any workaround in the CTPs, though this issue will be addressed in Atlas 1.0.

Thanks,

Eilon

Atlas Update Problem

Hi!, I have a page with a image background, and a image fill table, when viewing it in IE and the update panels triggers, the image background disapears when using IE but the same page viewing it in Firefox doesn't do that...

the webpage is this one:

www.cantinadoimbriaco.com/congelados/produtos.aspx

can some one help in what i'm doing wrong... thanks...Hi,

which image background is disappearing? It seems OK on IE for me.
Well it has a image background, and the menu has a fill background, as well as the submenu has an image background...

When changing to another submenu category the image of those backgrounds disapears, viewing it in IE... does any one sees it or just me?

ATLAS update panel slower when using dial up

First let me start with I love ATLAS it definitely makes the web suck less.

I have a page with an ATLAS update panel around 3 dropdownlist boxes that are dynamically populated based on the previous selected dropdownlistbox. In the broad band world this works outstanding. On dial up however it is actually slower to use the updatepanel than to do a full post back. 15 seconds for a full post-back, 25 for just one dropdown. Any ideas, I already tried asking the customer to get broadband, that did not go over well :-)

ajax is web 2.0 stuff. And web 2.0 is born upon broad band, but not upon narrow band. If your customer want to use dialing to go online, you should persuade them to give up the idea of using altas.
Interesting answer, But I think it is flawed. First off AJAX has nothing to do with asp.net 2.0, and if I write this using AJAX I do not have a performance problem. However if I chose to use an ATLAS updatePannel I do have the performance problem. Is there a bug, perhapps with the ATLAS framework or have I missed a setting?

Atlas update panel request timeout

I have annoying problem. Page has EnablePartialRendering="true" and several Update panels. Page works fine if Request is short, bit some time it can take up to 5 minutes to finish respond, and in this case, page does not return anything. I guess it has to be some TimeOut async request reaches. I tried to set <pages asyncTimeout="600"> - it does not help. Would appreciate any advise.

hello.

use the scriptmanager's AsyncPostBackTimeOut property to define the timeout associated with a partial request.


You may also consider manually calling the update panel .Update() - if its a long request and on the browser side its taking awhile - you could do this:

<Update Panel>

<Panel id="pnlForm" >

insert control here or whatever

<Panel if="pnlStatus">

Display message will take a while - do not navigate from page...

write a short javscript method that when you know it will be a long request... will toggle on the postback the second panel...I suggest using the style='display:none' instead of the .net visible = true or false...

Then in code behind do your work and at the end reissue the css style select to trigger them back to original status...and then call the updatepanel.Update()...

That may work as a solution for something of that time period...Since we are talking asynch - and you have other update panels - this should theoretically allow other stuff to happen - and still handle your first request.. I don't know for sure if that will work

I have noted that even setting the asynch timeout - with IE in particular it will not process a direct postback after x period of time...

But - I do think a better solution - is to figure out why it takes 5 minutes to perform something for a web client. If its a report generation - then the best thing to do is write kinda a job queue that stores the results - and has a status flag it updates... then on the web client poll the job status and when available trigger the update for the update panel...


Hello

I don't see AsyncPostBackTimeOut among ScriptManager properties.

Thanks


If you are using Atlas - I don't think that property existed - its a property of the new Beta however...

Atlas update panel problem

Hi,

I have page which main content is generated with function which returns HTML string:

<table>
<

tbody><tr><tdvalign="top"align="left">
<%=_contentOfPage%>
</td></tr></tbody>
</table>

Ant the function in code behind looks like:

public

string _contentOfPage;
publicvoid getContent(Int32 nDays)

{

String content;

content=.....//here is logic, which define content of the page

.......

_contentOfPage=content;

}

Everything works fine.

Because page has a lot of menues which I don't wont to refresh on every page submit, I included atlas update panel, which refresh only the main content of the page. It works with atlas too, page doesn't blink and only the main content is refreshed on page submit, like I wanted. But the interesting here is that refreshing only the part of the page(main content) takes about 3 seconds, while on the other hand, refreshing whole page takes only 1 second.
On all other pages, refreshing only content of the page works much faster, but here not. Any idea why?
Maybe because the length of _contentOfPage string is about 10000 signs or more?

Regards,S

HI,
as per my guess you are using lots of string concatenations to create the _contentOfPage,
that will take much of the server time,
try using stringBuilder which will be quite faster than the normal string concatenation

hope this will help
satish

Hi,

all I'm using for string concate is + sign between many if statements.
Maybe string builder is faster but the problem is not on the server.

The function on the server generates string in miliseconds.

The problem is obviously on client side.

Atlas call this method from client to server with ajay technology(XML HTTP) and than replace part of page on client with new string which gets from the server.(I think with INNERHTML method or similar).

If string is very long, like in my case, that procedure is slower than refresh a whole page.

I don't know if that is a rule or I missed something? Any idea?

regards,S

ATLAS Update panel does not update if & is in the page title

If you are experiencing a problems with the update panel not updating after an ATLAS postback, be sure to check if there are any '&' characters in your page title. Recently I came accross this and it took me ages to figure out why the AJAX stopped working!

After replacing the '&' with '&' it all works good again ;)

Hi,

I work actually on an atlas project, and i had the same problem with the titles of my contents pages.

Replacing '&' with '&' doesn't work for me...

Instead, I use the Master title for all my content pages... :)

I think the title must be a part of the identification in callback...

Search these forums and you will find lots of information on needing to escape (CDATA) the head element.

Atlas update panel

I have atlas update panel which works perfect for couple of hours or even a day or two.

Then it stops render part of page when trigger fires submit.

Just render nothing.

And that happens on all of my pages, where I use atlas.

What that could be?

I tried to create and define triggers in page_init event but still the same.

And I can't even test this behaviour because on the beggining it works.

Otherwise, I have to remove atlas from all pages because my users are complaining.

Any idea?

regards,Simon

Got a question, maybe not even related. When you see the problem is the session timeout? Got a problem before with the session.

Saturday, March 24, 2012

Atlas trigger not quite working

Hi,

I have got a serious problem with triggersnot updating the content of UpdatePanel at appropriate time. Here's thesituation:

The master page holds three fieldset elements -each of those is dragable and resizable (YUI library). Inside each ofthose is an UpdatePanel. Each UpdatePanel holds part of the left sidemenu, so parts are separately draggable around the UI.
Next, thepage that uses this master page further has four (4) more draggablefieldsets with UpdatePanel's inside. Each of these panels holds a partof the final content - drill down. So I need to update each lowerUpdatePanel when the upper one changes. Each of the content panelsactualy holds a WebUserControl (.ascx) and those all inherit from abase control that defines and fires a common event when somethingchanges. This works. I debugged the event firing and it works justfine. The problem is that when i created Triggers and defined thecontrols that fire them and the common event nothing really happens.All those UpdatePanel's have their Mode set to Always so they did getupdated even before i added triggers with a small problem that they gotupdate after two clicks, thous showing what should have been shown oneclick back. Triggers actualy made no diference even dough I thoughtthey would.

If anybody has had the same problem and havesessed it please post your solutions. Should the UpdatePanles havetheir Mode set to Partial in order for triggers to work?

Last time I saw this "one-update-behind rendering" problem (for lack of a better term), it was a bug on my side; I was updating the data too late in the page lifecycle (so the UI had already been rendered).

A simple test to see if you have the same bug would be to take Atlas out of the equation. (Probably setting EnablePartialRendering="false" on your atlas:ScriptManager should be enough.) If the problem is still there when using normal postbacks, then you know that Atlas isn't the problem. On the other hand, if it starts working just like you'd expect (but full page refreshes, of course), then you know it's somehow related to Atlas.

As always, the best way to get help would be to create a really minimal Atlas app that demonstrates the problem and post the full code. That way other people can read through it and even try it on their own.


Hi Steve,

I tested Atlas behavior with creating a test project with one page (no master page). Then i created 2 web user controls (.ascx), added 2 UpdatePanels to the page and within each one I placed one of those user controls. Each user control contains a button which increments its number of clicks and the oposite control displays that number.

This composition works well if i set the UpdatePanels mode to Always - the user controls displays the correct number. If I set the mode to Conditional, the control - as expected - gets updated only when one of its contained controls has coused postback.

Next i tested adding Triggers to each of the UpdatePanels and link the controlId to oposite user control button and event name to click event. And afcourse setting the mode to Conditional. This also works very well.

Then I added events to controls themselfs. When the button within the control is clicked that event gets fired from the button click handler. And the user control event is then used as the target event in the UpdatePanel Trigger. Here is the problem. I am probably doing something wrong with page / user control as you suggested. Funny thing is this is a very simple page (no added code behind) and two very simple user controls. Each of user controls contains a method InnitializeControls() which sets the .Text property of the label. This method is called from Page_Load.

Is there some special way controls have to be written in order for Triggers and the Conditional Mode to work correctly? I would expect that trigger would update the panel after its target has finished initialization or after all other event handlers have finished. At what point are the triggers called? Should this involve any event bubbling?

Anyways, I need UpdatePanels to update based on user control event - the control is contained in another UpdatePanel. The problem can be fixed by explicitly setting the event handler to the publicly defined method in the control that needs to get updated when the event emiter changes. and setting the Mode to Always.

I hope there is a better way because this approach has a lot of overhead. I just don't get it why it works with buttons but not with user control events. Has this anything to do with client side clicks?

Thanks for any suggestions.

Atlas timer control question

I have two Atlas timer controls on my page. The first one I have a label that updates a tip every 5 seconds. I put the update information in the page load event and not it is working great, I cache even cache the datatable with the hints to improve the performance even more.

Now I have users who sign in. Every 15 minutes, I want to check to see if they are still valid. I would like to use the second Atlas Timer control to do this. How can I a sub to fire to verfiy the user is still good from the timer? I do not want this timer to hit the page load event.

Anyone with any ideas?

Thanks, Chester

I can't believe I am the only person having this problem with the timer control in Atlas. I at first thought that it may be the placement of the timer control, so i have tried various positions on the page. On the timer interval it appears the page is reloading because I have a login password and user ID and if there is anything in the password text box when the tip changes on the timer interval, then the password field is emptied. I guess I will just not use the timer control because it appears to not be perfected yet.

Chester


I have a similar problem too with timers. I'm using two timer controls in a asp.net page. I have two update panels, each timer is inside each update panel. Apparently, only 1 timer can execute the code behind even i've placed code behind to each of the timer's tick event. If I put the first timer interval's 1000, and the second one to 1500, only the first one executes. If i change the first timer to 2000 and the second remains at 1500, only the second one excutes. Anyone has any idea?

cheers


When the first timer fires, the interval for the second timer would be reset. So how would you see the second timer firing. (Only the smaller interval from the two would fire)
vineetc