Sep 09, 2009, 8:45 AM
[CLOSED] The javascript function in not fire?
Hi,
See the sample i am unable to fire the javascript function(addTab()). See the code.
Design is
See the sample i am unable to fire the javascript function(addTab()). See the code.
Design is
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function addTab() {
alert('hi');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="scm" runat="server">
</ext:ScriptManager>
<ext:ViewPort ID="vw" runat="server">
<Body>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<West MinWidth="175" MaxWidth="400" Split="true" Collapsible="true">
<ext:Panel ID="WestPanel" runat="server" Title="" Width="175">
<Body>
<ext:Accordion ID="Accordion1" runat="server" Animate="true">
<ext:Panel ID="LinkFolders" runat="server" Title="LinkFolders" IconCls="LinkFolder-icon"
Border="false" BodyStyle="padding:6px;">
<Listeners>
<Expand Handler="Coolite.AjaxMethods.OnAccordianExpand1()"></Expand>
</Listeners>
<Body>
<ext:TreePanel ID="TreeLinkFolder" runat="server" BodyBorder="false" UseArrows="True">
</ext:TreePanel>
</Body>
</ext:Panel>
</ext:Accordion>
</Body>
</ext:Panel>
</West>
<Center>
<ext:Panel ID="pnlContent" runat="server">
<Body>
</Body>
</ext:Panel>
</Center>
</ext:BorderLayout>
</Body>
</ext:ViewPort>
</form>
</body>
</html>
code is
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Coolite.Ext.Web;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Hashtable htLF = new Hashtable();
htLF.Add(0, "My Addresses");
htLF.Add(1, "Some Folder");
htLF.Add(2, "a");
htLF.Add(3, "dffdsf");
htLF.Add(4, "For Sai");
htLF.Add(5, "Link");
htLF.Add(6, "Link Folder");
htLF.Add(7, "My links");
htLF.Add(8, "new link");
htLF.Add(9, "temp folder");
htLF.Add(10, "Testttt");
htLF.Add(11, "xvcx");
Coolite.Ext.Web.TreeNode linkNodes = new Coolite.Ext.Web.TreeNode("LinkFolders");
for (int i = 0; i < htLF.Count; i++)
{
Coolite.Ext.Web.TreeNode linkNode = new Coolite.Ext.Web.TreeNode(htLF[i].ToString());
linkNodes.Nodes.Add(linkNode);
}
TreeLinkFolder.Root.Add(linkNodes);
TreeLinkFolder.RootVisible = false;
}
[AjaxMethod]
public void OnAccordianExpand1()
{
scm.AddScript("addTab()");
}
}