Showing posts with label pages. Show all posts
Showing posts with label pages. 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.

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

Monday, March 26, 2012

Atlas UpdatePanel, EnablePartialRendering, and a custom javascript problem.

Hi all,

I have a javascript that renders custom tooltips on onmouseover events of objects on my pages, for example an A element. The custom javascript points the elements onmouseover event to delegates. This works fine except however when an UpdatePanel is render after the page has initially loaded. The function pointers are lost by objects within the UpdatePanel.

How can I setup an client side event procedure that can be run everytime the UpdatePanel renders something so that I can reinstate the lost function pointers?

Or, is there a better way to do this?

Thanks,

Andeezle

Please allow me to simplify my question. In other words, how can i run a client side script after an updatepanel updates?

also, i need a reference to the updatepanel that updated.

-Thanks,

Andeezle


Hi,

please check theUpdateProgressSignup written bySimone Busoli.

Thank you. Very cool. And it worked too!!!

-Andy

Saturday, March 24, 2012

Atlas through apache proxy

Hi

I'm hosting pages on apache, and I need access to asp.net2 pages hosted on another server. To expose only one server on the net, I decided to show my apache server, and use a virtual directory as proxy to the iis server, with somethink like this :
http://www.codeproject.com/aspnet/cassini_apache_101.asp

The thing works well, but not atlas...
I'm explaining :
Apache is configured to redirect /iis/* requests to the IIS server as /*
I'm using a sample empty page to test atlas (update panel containing 1 button, 1 textbox and 1 label, with an updateprogress).
The page works well, without any atlas objects.
When adding atlas, the proxied page doesn't work (javascript error).
When reading the source, I see a script with this url :

<script src="http://pics.10026.com/?src=/testatlas/WebResource.axd?d=V3h7lAaHQGE9jJRzRQZIfy1AxfEQzTtQmmpxyF4UrKQxRFNElU1QoINPfX3GmTiJpZAHIiXxweeRrf8WfQuZZjp6nneIqCzcGcWwa4A2zOk1&t=632799255520000000" type="text/javascript">
The url is bad. Let's look a the calls made at each step :
My browser is requesting http://server/iis/page.aspx
Apache proxy is handling this request, and makes a request http://iis/page.aspx
The response is returned to the browser.

So all the path infos are returned relative to the request made by the proxy, and not rewritten when the response is returned.

One solution can be to specify relative url from the page (with enough ../ ) to go to the root, and not relative url from root.

Does anyone know if there is another solution ?

I suggest that you look at the following post:

http://forums.asp.net/2/1248767/ShowThread.aspx

You can use the technique mentioned by mharder to override the Atlas scripts path, so that instead of using the web resource it uses Atlas scripts from the location you specify.

Wednesday, March 21, 2012

ATLAS seems to me to be slow

I've bulild a new website, some of the pages uses Atlas others not.

Pages without Atlas are 3 times faster then pages with Atlas.

Are there some trick to perform the pages with atlas?

Christian

Hi Christian,

It may be that you are running in debug mode. Please see this otherpost for details.

thanks,
David


Hi David,

thanks!

This was the solution!

Christian

Atlas request discovery

I have a BasePage class that is the base class for all my pages.
This page does a lot of the rendering of the page, the header, footer etc.
This should of course not be done when the request is an atlas request, so in these cases I need to just call base.Render.

The problem is that I can't see any way of discovering that the current request is an Atlas request, it looks exactly the same as a regular request.

Any ideas?

PS: Rewriting to use master pages etc instead is not an option, would take way to much time as this is an enterprise application with several hundreds of pages inheriting the BasePage class.

Thanks,
Einar

ok may b move ur atlas functionality to a webservice
One Way to find out whether a request is an Atlas Request is to use the following piece of code. It is based on my research using Reflector.

bool isAtlasRequest = ScriptManager.GetCurrent(this).IsInPartialRenderingMode;

Works, thanks!

Einar

Atlas problem with page base class structure

Hi there,

I'm working on a ASP.NET 1.1 application that was converted to 2.0. Instead of using master pages and templates in uses inherited base page classes to ensure consistancy of look, feel and functionality across all the pages.

The base class from which all pages inherit builds the html structure of the page. All that's in aspx page is:

<%@dotnet.itags.org. Page language="c#" Inherits="F360.PresentationTier.Testing.AJAX" CodeFile="AJAX.aspx.cs"%>
<head runat="server" id="headTag" />
CodeBehind is:
public partial class AJAX : BasePageHtmlAndNav

When creating pages the developer can drop in controls into the aspx page but the headers, footers, structure and menus etc are all built by the base page in OnInit

Ok, on to my ATLAS issue:

I've tested a simple updatePanel using a standard WebForm template and it works great. However when I try to add a ScriptManager and UpdatePanel to a page derived from our base class structure described above the updatePanel doesn't update. An asynchronous postback is made and the server-side event is triggered but the contents of the panal doesn't change.

I know it's hard to fathom what's going on here without full details of our base page class structure but if anyone has any ideas I'd appreciate it as I'm very keen to integrate the ATLAS framework in future applications that we'll be developing here.

Many thanks

MatOk, having read some posts on ATLAS problems with Master pages I did some tinkering and found the strangest (to me) of issues. ATLAS works fine with the base class structure outlined in my previous if there are no linked style sheets in the <head> tag. As soon as I add a style sheet (dynamically) to the head tag at runtime (as a LiteralControl) the updatePanel does not refresh. Does anyone have any idea why tis might be?

N.B. It makes no difference what is in the stylesheet. The problem still occur even when the links style sheet is empty.

Thanks

Mat

hello.

well, i'd say that you're generating a non valid xml element, ie, you're probably not closing the html element that is being sent to the browser. you can easilly verify this by using fiddler. what you must know is that, currently, the contents of the head section (if you have it with runat="server") are sent inside an xml message generated by the server in response to a partial postback and they aren't eascaped by using a cdata section. so, it's important to make sure that the contents of the head element are well formed xml elements.

btw, the correct way to identify a stylesheet to the page is to sue the htmllink element:

HtmlLink link = new HtmlLink( );
link.Href = "caminho ate Css file";
link.Attributes.Add( "rel", "stylesheet" );
link.Attributes( "type", "text/css" );
this.Header.AddParsedSubObject( link );


Hi there,

Thanks for the info. You were spot on. One of the style tags wasn't closed and when I corrected that worked... kind of!

The first postback is fine. However on the second postback I get the following error and IE crashes:

Unhandled exception at 0x7dd47bb3 in IEPLORE.EXE: 0xCOOOOOO5:
Access violation reading 0x0000004
Any ideas anyone?

And thanks for the tip regarding stylesheet link. I'll sort that out.

Mat


hello.

can you test that in another browser? it may be a problem with your ie...


Thanks for you're assistance. I got to the bottom of it in the end. I doubt anyone else will have a similar issue but I'll outline it anyway.

The application I'm working on used a CSS unorder list dropdown menu, as descibed here:http://www.tanfa.co.uk/css/examples/menu/tutorial-v.asp

To make the menu work correctly in IE an htc behaviour had to be attached to the body tag in the stylesheet. It was this beahviour that was causing IE to crash when asynchronous calls were being made. (No idea why). When I removed the behavious ATLAS worked fine. I have since changed the very light CSS menu for a third party control and now have both ATLAS functionality and a funky new menu. All good.

Thanks again

Mat


Can you explain better the solution...?
I have exactly the sameproblem... and I use a similar menu fromWebFX and I followed your linkbut I don't understand what's the problem generating the crash muchless the solution proposed...

Thanks
Agapito

Atlas Problem

I am using atlas updatepanel.But it not works in some pages only.If i invoke the Event i get the following error called

Error: element has no properties
Source File:http://localhost:1922/V1.5/WebResource.axd?d=76cvup_o6D5oq67FJRJ3lWFGXAOxalxDLDfhjEshy7rTmGT1wgioOjBBazTacAsXaJvLmuPSxaQ96h73WKTgYJPI_6yrvF_ItQBwDvIVAxY1&t=632894223780000000
Line: 10845

What is the error .& how to solve this problem...P

first the link u have provided is not working

try to copy and paste ur markup to help u

but any way try to check with me the syntax here:

<atlas:ScriptManager runat="srever" ID="scriptManager1" EnablePartialRendering="true"/>

<atlas:UpdatePanel runat="srever" ID="updatePanel1" Mode="Always" >

<ContentTemplate>

//here u add ur controls

</ContentTemplate>

</atlas:UpdatePanel>

or if u make it conditional mode

<atlas:ScriptManager runat="srever" ID="scriptManager1" EnablePartialRendering="true"/>

<atlas:UpdatePanel runat="srever" ID="updatePanel1" Mode="Conditional" >

<ContentTemplate>

//here u add ur controls

</ContentTemplate>

<Triggers>

// here u add ur triggers may be upon event or a change in property as u wish

</Triggers>

</atlas:UpdatePanel>

Atlas postback very very slow.

Hi i have a web app and most of the pages work fine, but i have two that are responding very slowly. I use Atlas update panels on the page so i thought if anything the responce would be quicker.
The postback is not doing a great deal. all i am doing is selecting a link button on a grid view which has the command='select' property. Within the row_command event all i am doing is changing the state of a couple of buttons on a seperate update panel.

The buttons act equally slow, they perform more code but still not a 4/10 sec round trip as i have other buttons that do more yet postback faster.

Any thoughts appreciated.

Steve

Hi Steve,

Can you check two things:

1) Are you running the app in debug mode? If so, the Atlas script libraries get downloaded on each request -- and that might be one cause of the delay.

2) What is the size of the viewstate on the page that you are working on? It could be that you have a lot of viewstate on the page which is slowing it down. Disabling viewstate would make postbacks work much faster.

Hope this helps,

Scott


Hi Scott

Thanks for posting.

I dont have it in debug mode.

How would i find the size of viewstate?

Steve


Scott

I disabled view state and the datagrid came back empty. The grid is only 1 col which is a template field with a link button in.

Steve


I have just done a view source on the two pages in question.

One: Viewstate = just short of 45000 chars.
Two: Viewstate = just short of 9000 chars.

So i guess thats the problem?? I am guessing that to cure the gridview coming back blank i will need to rebind on each postback?

Steve


How do i use properties like selectedindex from the gridview when viewstate is disabled??


You can use ControlState instead, which acts a lot like ViewState except that it's never turned off. Seehttp://msdn2.microsoft.com/en-us/library/system.web.ui.pagestatepersister.controlstate.aspx for more information. I'm not 100% sure you can enable at the page level as its supposed to work on controls, but then again a page is just a control

HTH
Thanks

How do i use the selectedindex from control state?

Steve

i use selectedvalue all over the place. Without creating my own control from the gridview is there anyway i can use this value.
I guess the selectedindex would work i could put the id in a hidden value and get it that way BUT... with view state turned off on the gridview i am unable to get the selectedindex, i thought selectedindex was held in control state....is there something special i need to do to use the control state properties?

Thanks

Steve


OK got it sorted.

on rowdatabound i have done e.Row.EnableViewState=false;
this has reduced the viewstate from 50K chars to a little over 6K. And I can access selectedvalue OK.

Time to stick it up live and see how we go.

Thanks, Steve