Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Wednesday, March 28, 2012

calling javascript in atlas

Hi,

I want to call a javascript function when call is made to server using atlas.

For e.g. instead of using ProgressBar of atlas which makes a div tag visible till server response comes in,I want to do some other processing through a javascript function till server response comes in (like hiding button).

Is it possible ?

thanks in advance for response

hello.

yes, you can...search this forum for pagerequestmanager _inPostback...you should find 1 or 2 examples that show how to do that.

calling javascript function in atlas

Hi,

I want to call a javascript function when call is made to server using atlas.

For e.g. instead of using ProgressBar of atlas which makes a div tag visible till server response comes in,I want to do some other processing through a javascript function till server response comes in.

Is it possible ?

thanks in advance for response

I believe this is not a Toolkit issue; please see FAQ topic "Posting in the right forum". Thanks!

Calling a WCF secure service

I know Atlas has some extensions to call WCF services but I am wondering is there any way to call a service using WS-Security instead of transport security (Https) ?.

Thanks

Pablo.

Hi Pablo,

Atlas is targeted on the "reach" end of the spectrum, which means it's pitched at technologies that are already widely deployed today. This necessarily means it can't take advantage of some of the richer protocol work like WS-Security because it's new and not everyone understands how to speak that stuff yet. I think of that as the "reach/rich tradeoff". The unfortunate reality is that you can't optimize for both at the same time.

However, history has shown that technologies that were once squarely in the 'rich' end of the spectrum have a tendency to become ubiquitous over time (a great example of this is DHTML, which has been around for years but has only recently become interesting).

Interesting times ahead :)
-steve
Thanks a lot Steve!!!. I just want to be sure about that.

Calling a Page Method Instead of a Web service method with javascript?

Hi All,

I am just wondering if it is possible to call a page method or a static method (non webservice) with javascript and have it return the results to the calling javascript funciton just like how it is done with a webservice call? Personally I prefer not to be producing asmx's for things that may only be used on a single page.

If so ... how might I accomplish this?

If Not.... Why not?

hehe

Thanks

Hi miskiw

Yes you can do that, you can find details here

http://ajax.asp.net/docs/tutorials/useWebServiceProxy.aspx at the bottom of the page titled "To call a static page method".

It is worth noting that there is a bug with this in the current release where you can only call methods that are inline. You cannot currently make async calls to methods that are in code behind.

HTH

Andy.


http://ajax.asp.net/docs/tutorials/useWebServiceProxy.aspx

can't open.

can you give a sample?THX


The new address is:http://ajax.asp.net/docs/tutorials/ExposingWebServicesToAJAXTutorial.aspx
In the bottom of the page, you have the section Exposing Web Services from an ASP.NET Web Page.

Basically, what you need to do is to create a static method and apply the [WebMethod] attribute to it.

[WebMethod]public static string EchoString(string name) {return"Called by " + name +".";}
HTH,
MaĆ­ra

Saturday, March 24, 2012

Call a JS function on AJAX update (instead of using UpdateProgress control)

The atlas:UpdateProgress control is nice, but an app I am working on already has a "loading..." image that is displayed using JavaScript (displayLoader(), and hideLoader() to hide) whenever a "non-Atlas" postback is invoked, and when the page initially starts loading.

I am looking for an way to call these functions whenever an Atlas postback is made so I can use this functionality for both types of postback. Is there an way to do this with client script, rather than creating a custom version of the UpdateProgress control?

Regards,
David

You should check out the samples on the client atlas section.

You can handle the different events to create your own custom progress indicator.


hello.

once again, search the atlas discussion an suggestion forum. there you'll find 1 or 2 posts that show how to handle the propertychanged event of the pagerequestmanager in order to handle the start and end of a partial atlas postback with jscript.


Great, those keywords have helped turn up some good results. I was previously searching both here and search engines for terms relating to "custom atlas updateprogress control" and didn't have much luck.

Thanks for pointing me in the right direction.
Regards,
David

Wednesday, March 21, 2012

calendarextender questions

How do i let the users only pick the months instead of days? which mean i will be showing the months instead of the days which will be exclude from the calendar.

I would like to close the calendar when i click anywhere on the page. at this moment i only can close the calendar at the popupbutton or by selecting a date.
Any idea of how to achieve this effect like the good old calendar?

Anybody has some good theme for the ajax calendar? I want to achieve the same effect as the default one but only changing the color.
if I use a CSS file, the whole calendar theme is overwritten.

Sorry I am not an expert in javascript that's why all these questions.

Hi Donkaiser,

My understanding of your issue is that your have thress questions in your thread list below:

donkaiser:

How do i let the users only pick the months instead of days?

I'm afraid that there's no function can support your idea unless you modify the source code.

donkaiser:

I would like to close the calendar when i click anywhere on the page. at this moment i only can close the calendar at the popupbutton or by selecting a date.
Any idea of how to achieve this effect like the good old calendar?

Yes , please add this javascript function to your page:

function document.onclick(){
$find("<%=CalendarExtender1.ClientID %>").hide();
}

donkaiser:

Anybody has some good theme for the ajax calendar? I want to achieve the same effect as the default one but only changing the color.
if I use a CSS file, the whole calendar theme is overwritten.

I haven't found a satisfied one yet by now but you can change it based on its own css style.

I hope this helps.

Best regards,

Jonathan


"Yes , please add this javascript function to your page:

function document.onclick(){
$find("<%=CalendarExtender1.ClientID %>").hide();
}"

Where should i put this function in my page? like the header? does it have to include the tag

<script type= "text/javascript" language="javascript"> </script>?


Hi Donkaiser,

This is another sample address which for other customer's related question.There are similar.In your case ,you just need to replace the Javascript functions with

function document.onclick(){
$find("<%=CalendarExtender1.ClientID %>").hide();
}"

This sample shows how to show the calendar when the TextBox'sonfocus and onclick envent is fired and hide the calendar after a date is selected.

<%@. 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:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" Format="yyyy-MM-dd" PopupButtonID="Button1"> </ajaxToolkit:CalendarExtender><asp:Button ID="Button1" runat="server" Text="Button" /> <script type="text/javascript" language="javascript"> function pageLoad(){ $addHandler($get("<%=TextBox1.ClientID%>"),"focus",showCalendar); } function showCalendar(){ $find("<%=CalendarExtender1.ClientID%>").show(); } function document.onclick(){ if(event.srcElement.id!="<%=TextBox1.ClientID%>") $find("<%=CalendarExtender1.ClientID%>").hide(); } </script> </form></body></html>
I hope this helps.
Best regards,
Jonathan