Jan 05, 2011, 3:55 PM
[CLOSED] how to set panel html property as javascript property
Hi, I try to set Panel Html property with javascript code. Below codes are sample for my scenario. If I set html property as standart html code, It works. But, If I set html property as javascript, it doesn't work. What should I do?
[DirectMethod]
public void Button1_Click()
{
string html = @" Ext.onReady(function() {
var window1 = new Ext.Window({
id: 'Window1',
title: 'Fatura Elektronike',
html: <iframe src='http://www.google.com' width='100%' height='100%' frameborder='0'></iframe>,
frame: true,
modal: true,
resizable:false,
draggable: false,
closeAction: 'hide',
width: 950,
height: 775,
y:10,
border: true
});
window1.show();
});";
Panel1.Html = html;
}
----------------------------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication9.WebForm4" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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>
<ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server">
<script type="text/javascript">
function Button1_Click() {
Ext.net.DirectMethods.Button1_Click();
}
</script>
</ext:ResourcePlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<ext:Panel ID="Panel1" runat="server" Height="300" Title="Title">
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Apply Changes">
<Listeners>
<Click Handler="Button1_Click();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Panel>
</form>
</body>
</html>
Last edited by Daniil; Jan 05, 2011 at 6:46 PM.
Reason: [CLOSED]