View Full Version : Passing node from Ext.tree.TreePanel to ASPX code behind

29 Aug 2012, 11:15 AM
Passing node from Ext.tree.TreePanel to aspx code behind

I am having a hard time getting / retrieving the node parameter and value from a treepanel and having it show up in my aspx code behind.

Here is the tree panel code:

var rootMenuDatabaseTables = 'SQL_Server';
var rootMenuDatabaseTablesLc = 'sql server';

Ext.ux.TreeDatabaseTables = Ext.extend(Ext.tree.TreePanel, {
// Init the Component

initComponent:function() {
// Componet Functions used in Init process

// applyIf so we can extent this new class in the future
var Tree = Ext.tree;
var menuTreeId = Ext.id();
Ext.applyIf(this, {
id: menuTreeId,
scope: this,
//layout: 'fit',
useArrows: true,
autoScroll: true,
border: false,
animate: true,
containerScroll: true,
root: new Tree.AsyncTreeNode({
scope: this,
text: rootMenuDatabaseTables,

loader: new Tree.TreeLoader({
headers: {'Content-type': 'application/json'},
url: '../BAB_Net/TreeLoader.aspx'
this.on('contextmenu', this.menuShow, this);
Ext.ux.TreeDatabaseTables.superclass.initComponent.apply(this, arguments);
}, // eo function initComponent

listeners : {
scope : this,
beforeload: function(loader, node) {
Ext.Ajax.defaultHeaders = { 'Content-Type': 'application/json; charset=utf-8' };
}, ...

this is what my code behind looks like. I just can't seem to get the node parameter or find it anywhere in form or the query string.

public partial class TreeLoader : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
Response.Headers.Add("Content-type", "application/json");

int size = Page.Request.Form.Count;
string n = Request.Form["node"];

string node = Request.QueryString["node"];


In my firefox, firebug it shows in the post section: node=SQL_Server

for whatever reason I can't get the node parameter. Any help would be great.