Where do you call the getServerTime method?
On 6/20/06, sansircar <[EMAIL PROTECTED]> wrote:
>
> Hi Joseph:
> yes was missing the Javascript file but the web.config has the
> httphandler code. my new code is --
>
> #######################################################################
> using System;
> using System.Collections;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Web;
> using System.Web.SessionState;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.HtmlControls;
> using AjaxPro ;
> namespace AjaxPro_Demo
> {
> /// <summary>
> /// Summary description for __Default.
> /// </summary>
> public class _Default : System.Web.UI.Page
> {
> private void Page_Load(object sender, System.EventArgs e)
> {
> AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default)) ;
> }
>
> [AjaxPro.AjaxMethod]
> public DateTime GetServerTime()
> {
> return DateTime.Now ;
> }
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> //
> // CODEGEN: This call is required by the ASP.NET Web
> Form Designer.
> //
> InitializeComponent();
> base.OnInit(e);
> }
>
> /// <summary>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> /// </summary>
> private void InitializeComponent()
> {
> this.Load += new System.EventHandler(this.Page_Load);
> }
> #endregion
> }
> }
> #######################################################################
> the Javascript code embedded in the html is -
> <%@ Page language="c#" Codebehind="_Default.aspx.cs"
> AutoEventWireup="false" Inherits="AjaxPro_Demo._Default" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html>
> <head>
> <title>_Default</title>
> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET
> 7.1">
> <meta name="CODE_LANGUAGE" Content="C#">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> <script language="Javascript">
> function getServerTime()
> {
>
> AjaxPro_Demo._Default.GetServerTime(getServerTime_callback) ;
> }
> function getServerTime_callback(result)
> {
> alert(result.value);
> }
> </script>
> </head>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">
> </form>
> </body>
> </html>
> #######################################################################
>
> this time nothing happens when i load the page. shouldnt i get to see
> the current date and time when the page loads. rather no error and no
> date-and-time.
>
> Joseph Guadagno wrote:
> > Do you have any JavaScript to go along with this sample? You also need
> > to add the httpHandler in the web.config file. You can find a quick
> > start quide at http://josephguadagno.net/ajax.aspx.
> >
> > Joseph Guadagno
> > http://josephguadagno.net
>
>
> >
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---