This project is read-only.

Need in N2 Ajax using samples?

Jan 8, 2009 at 4:43 PM
Is there any ways to use Ajax?
I saw at web.config that there is Ajax handlers, how could i use it?
And may be N2 has it's own ajax mechanisms?
Jan 8, 2009 at 8:07 PM
You should probably use standard updatepanels or e.g. WCF.

N2 uses a custom scheme with the http handler you saw (to play better with jquery and avoid dependencies). To use it you can register a "sub-handler":


This isn't really documented but you could look at existing usages if you want to use it.

Jan 8, 2009 at 11:05 PM
Standard updatePanels doesn't want work, i can't understand...
That's the page code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxTest.aspx.cs" Inherits="N2.Addons.DMSPrograms.Plugins.AjaxTest" %>

<%@ Register Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">
                <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />            
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

        <asp:UpdateProgress DynamicLayout="true" ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
        <div><%= DateTime.Now.ToString() %></div>

        protected void Button1_Click(object sender, EventArgs e)
            Label1.Text = DateTime.Now.ToString();

On button click page is updating as it should, but by standard postback (all page is restarting not partially).
P.S.: May be this situation linked with web.config file, but I use one from N2 package...