Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Wednesday, March 28, 2012

Atlas with master pages?

Howdy Folks!Smile

I am having some difficultly using atlas in master and child pages with content holders fired into the mix! I am not sure where to place the script manager ... and so on. Is there a film/document online of how to apply atlas in this instances?

Any help will be appreciated!

Hi.

You should place the ScriptManager in the MasterPage and use ScriptManagerProxy

in the child page.

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.

Monday, March 26, 2012

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 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 Content Template

Hi All,

I want to generate update panel dynamically.

I am using the following code to do that

UpdatePanel

panel =newUpdatePanel();

panel.Mode =

UpdatePanelMode.Conditional;ControlEventTrigger obj =newControlEventTrigger();

obj.ControlID =

"Button1";

obj.EventName =

"Button1_Click";

panel .Triggers.Add(obj);

I want to know how shall we add the controls to the content Template dynamically for the update panel.

Regards,
Techwork

Hello,

myUpdatePanel.Controls.Add( myGridView );

I hope this will work.


Hi,

I had already tried that. It will not work.

We need to add the controls to the content Template of the update panel and not the update panel.

Regards,

Techwork


Hi All,

I am using the following code to do the dynamic update panel.

UpdatePanel panel =newUpdatePanel();

panel.ID =

"panel";

panel.Mode =

UpdatePanelMode.Conditional;

panel.ContentTemplate = Page.LoadTemplate(

"~/UpdateUserControl.ascx");UpdateUserControl user =new UpdateUserControl();ControlEventTrigger obj =newControlEventTrigger();

obj.ControlID =((Button)user.FindControl("Button1")).ID;

panel.Triggers.Add(obj);

I am not getting any error but when I run this page the usercontrol is not loading.

I have the scriptamanager in the page. I have written this code in the Page_Load() event of the page

Do I need to do soem more things other than this?

where exactly I am going wrong?

Regards,

Techwork


Firs you have make yourself a UpdatePanelContent class. Make it a inner class within the class holding the updatepanel.
Note, the only method you need to declare in this class, additional to the constructor, is the instantiateIn . Required by the ITemplate interface

publicclassUpdatePanelContent :ITemplate

{

publicControl m_Control;

public UpdatePanelContent(Control controlToAdd)

{

m_Control = controlToAdd;

}

publicvoid InstantiateIn(Control container)

{

container.Controls.Add(m_Control);

}

}

--Now you can instantiate your panelcontent as shown.
Add your hook, page or whatever controlcollection to the panelcontent trough the updatepanelcontent contructor.

UpdatePanelContent panelContent =newUpdatePanelContent(your_control_collection);

the_updatepanel_instance.ContentTemplate = panelContent;

Regards Knut Dullum

Atlas update control doesnt refresh the gridView content

I have atlas update panel with mode=conditional which means that it should refresh the gridView only when trigger is fired.

I create a trigger which fires when selectedValue is changed on dropdownlist.

But gridView is refreshed only first time, when dropDownList is changed. All other changes in dropDown - gridView remains the same. AnyBody know why?

If I change Mode to always than gridView is refreshed on every dropDown change.

Here is the example:

<

asp:DropDownListID="DropDownList2"runat="server"AutoPostBack="True"><asp:ListItemValue="False">Active</asp:ListItem><asp:ListItemValue="True">Completed</asp:ListItem></asp:DropDownList>

<

atlas:UpdatePanelID="p1"runat="server"Mode="Conditional"><ContentTemplate><asp:GridViewID="GridView1"CssClass="gridView"AlternatingRowStyle-CssClass="even"GridLines="None"runat="server"AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False"DataKeyNames="taskID"DataSourceID="ObjectDataSource1"><Columns><asp:CommandFieldShowEditButton="True"/><asp:BoundFieldDataField="name"HeaderText="name"SortExpression="name"/><asp:CheckBoxFieldDataField="complete"HeaderText="complete"SortExpression="complete"/></Columns><AlternatingRowStyleCssClass="even"/></asp:GridView></ContentTemplate><Triggers><atlas:ControlValueTriggerControlID="DropDownList2"PropertyName="SelectedValue"/></Triggers></atlas:UpdatePanel>

Regards,S

hello.

does this page work there:

<%@. Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList runat="server" id="drop" AutoPostBack="true">
<asp:ListItem Text="True" />
<asp:ListItem Text="False" />
</asp:DropDownList>
<atlas:ScriptManager runat="server" id="manager" EnablePartialRendering="true" />
<atlas:UpdatePanel runat="server" ID="panel">
<ContentTemplate>
<%=DateTime.Now.ToString() %>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="drop" EventName="SelectedIndexChanged" />
</Triggers>
</atlas:UpdatePanel>
</form>
</body>
</html>


Hello,

yes, your example works.

In fact if I change value trigger with event trigger then my example also works.

Replace:


<atlas:ControlValueTrigger ControlID="DropDownList2" PropertyName="SelectedIndex" />

with

<atlas:ControlEventTrigger ControlID="DropDownList2" EventName="SelectedIndexChanged" />

What is wrong with ControlValueTrigger? I found this example at your page from video demonstration.

Regards,Simon


hello.

i think that replacing the controleventtrigger with the controlvaluetrigger still works in the code i've posted previouslly...doesn't it tun there when you use that trigger?


If I use your example with:

<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedValue"/>
OR
<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedIndex" />

It works only when selectedValue is not True, so, when you not select first option.
So, it refresh time every second attempt.

If you add more options into your example:

<asp:ListItem Text="True"/>
<asp:ListItem Text="False"/>
<asp:ListItem Text="Test"/>
<asp:ListItem Text="Test1" />

it works for all other options too, only if selectedIndex>0(if selectedValue<>"True").
Why?

Thanks,Simon


hello again.

are you saying that changing from true to false causes a partial postback but changing from false to true doesn't? that's not what i'm seeing here...btw, i've used this:

<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedIndex" />


Yes, that is exactly what is happening.

First I change value to false and partial postback is happened.
Then I change value to True, no partial postback.
Then I change value to false, partial postback is happened.
Then I change value to True, no partial postback.
and so on...

Every change of dropdown to first choice(selectedIndex=0) creates no postback.

My code is exactly the same as yours.I copied it from here.
No master page, no any other code.
I install atlassetup.msi from

http://www.microsoft.com/downloads/details.aspx?FamilyId=B01DC501-B3C1-4EC0-93F0-7DAC68D2F787&displaylang=en

and create empty atlas web project.
Create test page and put your script into it.

Any idea? I can send you my web.cofig file and my page if you want.

Regards,Simon


hello again.

just to be sure, here's the code i'm running:

<%@. Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList runat="server" id="drop" AutoPostBack="true">
<asp:ListItem Text="True" />
<asp:ListItem Text="False" />
</asp:DropDownList>
<atlas:ScriptManager runat="server" id="manager" EnablePartialRendering="true" />
<atlas:UpdatePanel runat="server" ID="panel">
<ContentTemplate>
<%=DateTime.Now.ToString() %>
</ContentTemplate>
<Triggers>
<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedIndex" />
</Triggers>
</atlas:UpdatePanel>
<%=DateTime.Now.ToString() %>
</form>
</body>
</html>


Hello,

well my code is exact the same only that I use code behind.

So, only difference is top most line:
<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="test.aspx.cs"Inherits="test" %>

Do you know, how to include atlas into existing web application? Set references to atlas.dll and what else?

When creating new web site it's simple, just select atlas web site.

Regards,Simon


hello.

well, normally you must also add some entries on the web.config. if you look at the your atlas installation path, you'll find a web.config file that has the necessary entries. copying those entries to your web.config should be enough. you might also need to configure IIS if you're using bridges and you have not installed atlas msi on the server that is hosting your app.

Saturday, March 24, 2012

Atlas Triggers not quite woring

Hi,

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

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

If anybody has had the same problem and have sessed it please post your solutions. Should the UpdatePanles have their Mode set to Partial in order for triggers to work?Hi LoneTiger,

This forum is specifically devoted to the"Atlas" Control Toolkit. You'll probably get a much better response if you post this question in either the"Atlas" Discussion and Suggestions or the"Atlas" UI forums where theUpdatePanel experts are.

Thanks,
Ted
Thanks Ted. I reposted the question at suggested forum. Is it possible to delete this one?

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.