PDA

View Full Version : extjs with asp.net



maxdiable
20 Jun 2009, 1:16 AM
hi, i start my first project with extjs and asp.net... but i have more problem...
the page show the regions, but:

1) asp buttons not fired

2) the asp textbox after a simple post back
lose their values
any help or examples ?
tank's

Animal
20 Jun 2009, 1:53 AM
I deleted your other thread. Do not clutter the forum with duplicates.

maxdiable
20 Jun 2009, 1:55 AM
sorry..
are sorry for the duplicate the thread :(

not help for my problem ?

regards:((

Animal
20 Jun 2009, 2:00 AM
How do you expect people to help?

How do we have any IDEA what you are doing? Do we read your mind?

maxdiable
20 Jun 2009, 2:07 AM
yes sure i post here my code:

this is my asp.net master




<%@ Master Language="VB" CodeFile="test.master.vb" Inherits="test" %>
<!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>Pagina senza titolo</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="js/ext/ext-base.js" />
<asp:ScriptReference Path="js/ext/ext-all.js" />
<asp:ScriptReference Path="js/ext/layout.js" />
</Scripts>
</asp:ScriptManager>

<div id="west">
<div id="west-cont"></div>
</div>
<div id="north">
<div id="north-cont">
<a id="hideit" href="#">Toggle the west region</a><br />
<asp:Button ID="Button1" runat="server" Text="center" />
</div>
</div>
<div id="center">
<div id="center-cont">
<asp:ContentPlaceHolder ID="cphMain" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<div id="south">
<div id="south-cont"></div>
</div>
</form>
</body>
</html>




this i my contenent page




<%@ Page Language="VB" MasterPageFile="~/test.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server">
<asp:Button ID="Button1" runat="server" Text="Button" />
</asp:Content>



i put my layout code in js/ext/layout.js




// File JScript

Ext.onReady(function(){

// NOTE: This is an example showing simple state management. During development,
// it is generally best to disable state management as dynamically-generated ids
// can change across page loads, leading to unpredictable results. The developer
// should ensure that stable state ids are set for stateful components in real apps.
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

var p = new Ext.Panel({
title: 'My Panel',
collapsible:true,
renderTo: 'north',
contentEl:'north-cont',
autoWidth:true
//html: Ext.example.bogusMarkup
});

var viewport = new Ext.Viewport({
layout:'border',
items:[{

region:'north',
id:'north-panel',
el: 'north',
//contentEl:'north-cont',
title: 'Nord',
split:true,
height: 200,
layout:'fit',
items: p
//margins:'5 5 5 5'

},{
region:'south',
//renderTo: 'south',
//contentEl:'south-cont',
id:'south-panel',
//contentEl: 'south',
split:true,
height: 100,
minSize: 100,
maxSize: 200,
collapsible: true,
title:'South',
margins:'0 0 0 0'
}, {
region:'east',
id:'east-panel',
//renderTo: 'east',
//contentEl:'east-cont',
title: 'East Side',
collapsible: true,
split:true,
width: 225,
minSize: 175,
maxSize: 400,
layout:'fit',
margins:'0 5 0 0'
},{
region:'west',
id:'west-panel',
title:'West',
//renderTo: 'west',
//contentEl:'west-cont',
split:true,
width: 200,
minSize: 175,
maxSize: 400,
collapsible: true,
margins:'0 0 0 5',
layout:'fit',
layoutConfig:{
animate:true
}
},{
region:'center',
id:'center-panel',
//renderTo: 'center-cont',
contentEl:'center',
title:'Center',
layout:'fit'
}

]
});
Ext.get("hideit").on('click', function() {
var w = Ext.getCmp('west-panel');
w.collapsed ? w.expand() : w.collapse();
});
});



the page show a beautifull viewport, but the asp button not firing and after post back my asp textbox lose their value

any suggestion ?

sorry for my english :(

geoffrey.mcgill
20 Jun 2009, 9:42 AM
Hi maxdiable,

The <asp:Button> fails to postback properly because the default Viewport widget moves its contents from inside the <form> to outside the form when it renders in the browser.

You can work around this issue by using the FormViewport extension originally developed by vladsch, see http://extjs.com/forum/showthread.php?t=14261

Hope this helps.

maxdiable
20 Jun 2009, 9:57 AM
tank's geoffrey.mcgill but..

I do not understand how to use FormViewport.
any example where the use of FormViewport and create a viewport?

:s

netski
20 Jun 2009, 2:14 PM
tank's geoffrey.mcgill but..

I do not understand how to use FormViewport.
any example where the use of FormViewport and create a viewport?

:s

Hello maxidable, check out http://www.coolite.com/ a partner with ExtJS for a Microsoft .NET implementation.

Cheers,
Timothy

maxdiable
20 Jun 2009, 8:44 PM
tanck's :) for your help

now working \:D/