PDA

View Full Version : [FIXED] [V0.6] AjaxEvent not working



Jurke
Sep 09, 2008, 11:29 AM
Hi
Have problems with getting the AjaxEvent to work, I tried this examle from another thread
(http://forums.ext.net/showthread.php?threadid=1512-17-1.aspx?Highlight=AjaxEvents).
Im using 0.6 of Coolite, and IE 7. The active tabpage does not change, i just get the Ajax loader, and when finished loading nothing happens.






<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">


protected void Button1_Click(object obj, AjaxEventArgs e)
{
this.TabPanel1.ActiveTabIndex = 1;
}
</script>


<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Coolite Toolkit : Setting the .ActiveTabIndex on an AjaxEvent</title>
</head>
<body>
<p><a href="ActiveTabIndex.aspx">Reload</a></p>
<form id="Form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:TabPanel ID="TabPanel1" runat="server" Height="300">
<Tabs>
<ext:Tab ID="Tab1" runat="server" Title="Tab 1" Html="Tab 1" />
<ext:Tab ID="Tab2" runat="server" Title="Tab 2" Html="Tab 2" />
</Tabs>
</ext:TabPanel>
<ext:Button ID="Button1" runat="server" Text="Submit">
<AjaxEvents>
<Click OnEvent="Button1_Click" />
</AjaxEvents>
</ext:Button>
</form>
</body>
</html>



Best regards
Mikael

Timothy
Sep 09, 2008, 11:37 AM
Hello Jurke,

Have you registered Coolite Ajax in your Web.Config? Discussed here: http://forums.ext.net/showthread.php?threadid=1360-16-2.aspx and announced in the ReadMe.txt :)

Cheers,
Timothy

Vladimir
Sep 09, 2008, 11:52 AM
Hi Mikael,

Can you check please that code in Button1_Click was executed (for example, under debug set breakpoint in Button1_Click)?

If code executed then please change the Button1_Click



protected void Button1_Click(object obj, AjaxEventArgs e)
{
this.TabPanel1.AddScript("alert('The request completed');");
this.TabPanel1.ActiveTabIndex = 1;
}


If all correct the after request you shouild see the alert window. Please let me know about results

Jurke
Sep 09, 2008, 12:13 PM
Hi Guys
Thank you for your quick reply. It was my mistake, I have missed the web.config part. Im my defense, I just got the 0.6 dll by mail without the read me. :)

Its now working fine!

Best regards
Mikael