Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Monday, March 26, 2012

Intercepting Atlas on client

Iv been pndering on this for a couple of days

How can i go about intercepting a particular update, for example. If ihave a page with a grid view inside an updatepanel, a timercontrol thatfires and the gridview is reloaded. If this takes time i'd like to notify the user.
So lets say you want to notify the user when ever any type of routineis being run where atlas is communicating with the server. And lets sayyou want to do something as simple as gmail, a little red div appearsand dissapears accordingly

Any suggestion / ideas would be greatly appreciated

Thanks

DrayI've seen this question asked quite a few times - infact i spent thelast the last 3 hours going through Wilco's Browser and theonline documentation.

I am Still stumped.

This should be a pretty thing - you have a update panel - and you need a callback for it ? Please somebody from the team ...

We can have a callback if we are manually making a call - but where dowe specify the callback location if you have an update panel ?
Anybody ? how can we intercept in Javascript if an update is complete(using update panel on the page).

Is Something like Function OnComplete() Available?

This will help is making loaders etc...

Atlas team ?
No response means it's impossible?

hello.

have you tried using the updateprogress control? it should solve your problem...


Thanks for response

but I do not see how updateprogress can help me.
I need to know that particular update action has been completed.
Maybe I've overlooked somethig?

hello again.

see if this page does what you need:

<%

@.PageLanguage="C#" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

scriptrunat="server">void h(object sender,EventArgs args)

{

info.Text = ((

Button)sender).ID +" " +DateTime.Now.ToString();

System.Threading.

Thread.Sleep(2000);

}

</

script>

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>Untitled Page</title>

</

head>

<

body><formid="form1"runat="server"><atlas:ScriptManagerrunat="server"id="manager"EnablePartialRendering="true"></atlas:ScriptManager><atlas:UpdatePanelrunat="server"ID="panel"><ContentTemplate><asp:Buttonrunat="server"ID="bt"Text="Submit"OnClick="h"/><asp:Literalrunat="server"ID="info"/></ContentTemplate></atlas:UpdatePanel><atlas:updateprogressrunat="server"ID="prog1"><ProgressTemplate>

Updating...you can put what you want here... an img, etc;

you can position it with css, if that's important

</ProgressTemplate></atlas:updateprogress></form>

</

body>

</

html>
I've created exactlly the same demo web on my machine :).
But I need to know about completion of an action on client side.
I need to call my own java script function.I think that it should base on
interception of Atlas call and adding my own handler of oncomplete event.

hello.

maybe something like this?

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


Luis Abreu:

hello.

maybe something like this?

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

Thanks, that what I've been looking for although it looks like kind of hack :).
How can I get a list of available methods and properties of "args" and "obj" objects
from following event handler:
function changed( obj, args )

I need to know for examply which UpdatePanel caused post back.

Thanks again

Wednesday, March 21, 2012

Is ATLAS to be used with web-services only?

Is it just me, or is ATLAS designed to be used along with web-services?

Every example I see has web-services as the data-source.

All I am looking for is...can I use ATLAS in conjunction with server-side code, and NOT use web-services.

Btw...me new to ATLAS or AJAX for that matter...and am just starting to learn it.

Thanks,

Sashidhar

No. If you do a bit more reading/research, you'll see that Atlas is like any other AJAX product in terms of what you can do. Web Service is just a convenient method of serving as a data source.

jcasp:

No. If you do a bit more reading/research, you'll see that Atlas is like any other AJAX product in terms of what you can do. Web Service is just a convenient method of serving as a data source.

And what are the other options?


hello.

well, i guess that it is fair to say that you have 2 approaches: client-side or server-side. when you use client-side, you tipically perform postbacks through web method calls (here you have 2 options: expose the method through a web service or simply put the method on your page and annotate it with the webmethodattribute).

if you want, you can also use a server-side approach. in this case, you use updatepanels to wrap the portions of the page that should be refreshed through AJAX and don't really need to change much in your ASP.NET code.

Luis Abreu:

when you use client-side, you tipically perform postbacks through web method calls (here you have 2 options: expose the method through a web service or simply put the method on your page and annotate it with the webmethodattribute).

So basically when you use client side calls you can call only webmethods i.e. soap services.

Am I correct?

Thanks


Most of the ATLAS client controls will use web services when issuing post backs to the server, e.g. the AutoComplete behavior, data sources, etc. So, the short answer to your question is yes, client side calls are made using Web Services. Keep in mind that calls made to web services are actually done using JSON at runtime by default, I believe a new capability was added in the March CTP, that allows you to make service calls using SOAP if you need to. If you don't want to use a service, you could use the AtlasRuntime library, which essentially wraps the XmlHttpRequest object to make a "raw" AJAX request to do something like this:

var request = new Sys.Net.WebRequest();
request.set_url("MyHandler.ashx");
request.completed.add(this.onCompleted);
request.invoke();


yortch,

forgive me for the lame question but by raw AJAX request you actually mean raw XML request, right?


Yes, by AJAX request I meant an HTTP request issued using the JavaScript XmlHtttpRequest object.

Though note that even though it uses XmlHttpRequest, Atlas does not use SOAP & XML to call web services. Instead, it uses JSON. The nameXmlHttpRequest can be confusing in this respect.

David


So we can not call a standard ASMX service before it is JSON enabled. Correct?

And we can use Atlas client side library to call any JSON enabled service no matter if it written on .NET or not. Is that right?

I need to match the dictionary in AJAX world. I have not used AJAX before. Sorry if my questions bore you.

Thanks


You don't really need to do anything to JSON enable your asmx services. If they are on your Atlas site, they are callable via Atlas.

As for your second question, JSON is only a serialization format, and there are many ways you can call a web service using JSON. Until there is a standard that everyone follows (like SOAP for XML), Atlas client code can only call Atlas services.

Also, note that cross domain browser limitations generally make it hard to call different servers from client calls. So in most cases, you are calling back to your own server, and you know it has Atlas on it.


I got it.

Thanks davidebb!


What I am not quite able to figure out quite yet is...how many web-services would I have to write for providing a richer interface to any client, if I have a ton of fields on my webform.

Isn't the idea of having too many web-services kinda a performance hit on its own??Surprise [:O]

-Sashidhar


Even if you have "a ton of fields" in your webform you could use a single web service call. JSON requests at runtime are lighter than SOAP (XML) requests, the request still need to be de/serialized, but this is something you can't get away from if you'll be using AJAX. If you're concerned about perfomance look into trying to minimize the number of server side requests issued using ATLAS, i.e. if you can get the data you need to populate your form or whatever it is you're trying to achieve, try to achieve this with one request. If you're concerned about using Web Services at all, then look into either using the ATLAS runtime directly (which will require writing more javascript code), or use server controls such as the UpdatePanel. Hope this helps...

Is it possible to collapse left and not up?

Hello,

I'm looking at the CollpsiblePanel. I'm wondering if Control Toolkit has the possibility to collapse to the left and not up. For example, collapse the left side menu to the left.

Would that be nice to have? Cheer

Ive collapsed a side menu using the control extender make sure you set the ExpandDirection="Horizontal"

AjaxButter