更新面板在WEB SERVER中不起作用 [英] Update Panel not Working in WEB SERVER

查看:98
本文介绍了更新面板在WEB SERVER中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,


在我的Web应用程序中,我使用UpdatePanel来加快服务器响应速度.
它在我的本地系统和WINSERVER2008R2中都可以正常工作.

但是在客户端在WEB SERVER 2008中发布我的网站时,它保持静态,不显示任何错误

请帮帮我...


这是我的设计视图...




In my web application, i have use UpdatePanel for speed up the server response.
Its works fine in my local system, and our WINSERVER2008R2.

But in client side while publish my website in WEB SERVER 2008, it remain static, doesn''t shows any errors

Please help me out...


Here is my Design View...

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>

<asp:DropDownList ID="ddl_mode" runat="server" AutoPostBack="true" onselectedindexchanged="ddl_mode_SelectedIndexChanged">
                <asp:ListItem> By Cash</asp:ListItem>
                <asp:ListItem> By Cheque</asp:ListItem>
                <asp:ListItem> By Card</asp:ListItem>
</asp:DropDownList>

 </ContentTemplate>
    </asp:UpdatePanel>

 <asp:Panel ID="Pnl_pay_Cheque" runat="server">

         <table>
            <tr align="center">
                        <td>
                            <strong>Cheque No. :</strong></td>
                        <td>
                            <asp:TextBox ID="txt_Chequeno" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"

                                ControlToValidate="txt_Chequeno" ErrorMessage="*Required"

                                SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
            </tr>
            <tr align="center">
                        <td>
                            <strong>Cheque Date :</strong></td>
                        <td>
                            <asp:TextBox ID="txt_Chequedate" runat="server"

                                onclick="showCalendarControl(this)"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"

                                ControlToValidate="txt_Chequedate" ErrorMessage="*Required"

                                SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
             </tr>
             <tr align="center">
                        <td>
                            <strong>Bank Name :</strong></td>
                        <td>
                            <asp:TextBox ID="txt_Chequebank" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"

                                ControlToValidate="txt_Chequebank" ErrorMessage="*Required"

                                SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
             </tr>
        </table>

</asp:Panel>


<asp:Panel ID="Pnl_pay_Card" runat="server">

        <table>
            <tr align="center">
                        <td>
                            <strong>Card No. :</strong></td>
                        <td>
                            <asp:TextBox ID="txt_cardno" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"

                                ControlToValidate="txt_cardno" ErrorMessage="*Required" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
             </tr>
             <tr align="center">
                        <td>
                            <strong>Bank Name :</strong></td>
                        <td>
                            <asp:TextBox ID="txt_cardbank" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"

                                ControlToValidate="txt_cardbank" ErrorMessage="*Required"

                                SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
              </tr>
         </table>

</asp:Panel>







这是我的服务器代码







Here is my Server Code

protected void ddl_mode_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddl_mode.SelectedIndex == 0)
        {
            Pnl_pay_Cheque.Visible = false;
            Pnl_pay_Card.Visible = false;
            txt_enteramt.Text = "0";

        }
        else if (ddl_mode.SelectedIndex == 1)
        {
            Pnl_pay_Cheque.Visible = true;
            Pnl_pay_Card.Visible = false;
            txt_enteramt.Text = "0";

        }
        else if (ddl_mode.SelectedIndex == 2)
        {
            Pnl_pay_Card.Visible = true;
            Pnl_pay_Cheque.Visible = false;
            txt_enteramt.Text = "0";
        }
        txt_enteramt.Text = "";
    }





实际上,当用户更改DropDownlist项目时,我需要隐藏/显示相应的面板.





Actually while user Changing the DropDownlist items, i need to hide/Show the respective Panels.

推荐答案

亲爱的,正如我在代码中看到的那样,看来您正在放置面板在更新面板控件之外
在这种情况下,您将无法在更新面板之外更新/刷新控件.

尝试将面板放在< contenttemplate>之间.并且它将正常工作.

我已经准备好解决任何问题,如果您想通过电子邮件发送我的邮件以快速回答问题,您可以直接与我联系


谢谢.
Dear as i can see in the code it seems your are putting the panel outside the update Panel control
in this case you can''t update/refresh the controls outside the update panel.

try to put the panels between the <contenttemplate> and and it will work fine.

i''m ready for any question and u can communicate with me directly if you want put your email to send mine for fast answer


Thank you.


能否请您解释一下,您能输入您正在使用的aspx代码吗?
这样我可以为您解决问题.
can you please explain more, can you put the aspx code you are using ?
so i can solve the problem for you.


这篇关于更新面板在WEB SERVER中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆