Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Ext.net更改面板BodyCls处于代码隐藏状态_Asp.net_Extjs_Ext.net - Fatal编程技术网

Asp.net Ext.net更改面板BodyCls处于代码隐藏状态

Asp.net Ext.net更改面板BodyCls处于代码隐藏状态,asp.net,extjs,ext.net,Asp.net,Extjs,Ext.net,请帮帮我。。。我的aspx页面是: <head runat="server"> <title></title> <style type="text/css"> .notApprovedComment { background-color:#FFF8C1; } .ApprovedComment { background-color:#FFFFFF; } </styl

请帮帮我。。。我的aspx页面是:

<head runat="server">
<title></title>
<style type="text/css">
    .notApprovedComment
    {
        background-color:#FFF8C1;
    }
    .ApprovedComment
    {
        background-color:#FFFFFF;
    }
</style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server" ID="rc1" ViewStateMode="Enabled"> </ext:ResourceManager>
            <ext:Panel runat="server" ViewStateMode="Enabled" ID="pnlTest" Title="Comment" Width="655" BodyCls="notApprovedComment">
                <Content>  comment  </Content>
            </ext:Panel>
            <ext:Button runat="server" ViewStateMode="Enabled" ID="btnTest" Text="salam">
                <DirectEvents>
                    <Click OnEvent="btnTest_Click" ViewStateMode="Enabled" ></Click>
                </DirectEvents>
            </ext:Button>
        </div>
    </form>
</body>
但是当点击ext:按钮时
pnlTest.BodyCls
仅更改一次,如果我再次单击
ext:按钮
pnl.BodyCls
将不会更改!!!但是
ext:button
工作正常

c#

javascript(变体)

这是客户端示例

protected void Page_Load(object sender, EventArgs e)
{

}
[DirectMethod]
protected void btnTest_Click(object sender, DirectEventArgs e)
{
        btnTest.Text = btnTest.Text + " edited";
        if (pnlTest.BodyCls == "ApprovedComment")
            pnlTest.BodyCls = "notApprovedComment";
        else if (pnlTest.BodyCls == "notApprovedComment")
            pnlTest.BodyCls = "ApprovedComment";
}
[DirectMethod]
protected void btnTest_Click(object sender, DirectEventArgs e)
{
    btnTest.Text = btnTest.Text + " edited";
    X.Js.Call("triggerClass");
}
function triggerClass(){
    var panel = Ext.getCmp('pnlTest');
    if(Ext.select('.ApprovedComment').getCount() > 0)
        panel.removeBodyCls('ApprovedComment');
    else
        panel.addBodyCls('ApprovedComment');
}