更新面板不工作在asp.net code [英] update panel is not working on asp.net code

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

问题描述

这是我的C#$ C $后面

This is my c# code behind

protected void callDispositionChanged(object sender, EventArgs e)
{
    var dropDown = (DropDownList)ListView1.FindControl("callDispositionSelector");
    var visitID = (TextBox)ListView1.FindControl("visitID");
    if (dropDown != null)
    {
        Response.Write(dropDown.SelectedValue + "ssssssssss");
        visitID.Text = dropDown.SelectedValue;
    }
    else
    {
        visitID.Text = "ffffff";
        Response.Write("FFFFFFFFFFFFFFFF");
    }               
}

这是我的ASP code

this is my asp code

<asp:UpdatePanel ID="UpdatePanel3" UpdateMode="Conditional" runat="server">
                        <ContentTemplate>
                        <tr class="footer" runat="server">
                            <td colspan="4" runat="server">* By VoiceMpower
                               <asp:DropDownList AutoPostBack="true" runat="server"  ID="callDispositionSelector" OnSelectedIndexChanged="callDispositionChanged" clientidmode="Static">
                                   <asp:ListItem Value="-1">Select Disposition Reason</asp:ListItem>
                                   <asp:ListItem Value="1">Reservation</asp:ListItem>
                                   <asp:ListItem Value="2">Change of Reservation</asp:ListItem>
                                   <asp:ListItem Value="3">Cancellation</asp:ListItem>
                                   <asp:ListItem Value="4">Wait List</asp:ListItem>
                                   <asp:ListItem Value="5">Other</asp:ListItem>
                               </asp:DropDownList>
                                <asp:TextBox runat="server" ID="visitID" clientidmode="Static"></asp:TextBox>
                            </td>
                        </tr>
                         </ContentTemplate>
                    </asp:UpdatePanel>

当我改变选择的值,函数被执行,但结果(后背页)已经在devaul vaule选择。

when I change the value of the select, the function is executed, but the results (the post back page) has the select in the devaul vaule.

我已经有

<asp:ScriptManager ID="ScriptManager2" runat="server" />

注释3

这是ASP code在 asp.listview

我无法调试该项目,因为在服务器和数据库,我不能做一个链接。所以,我每开发一个functoin的时候,我去部署在服务器上的网站并进行测试。所以,请让你的答案未做破发点和类似的东西。在此先感谢

I can't debug the project because the database on the server and I am not allowed to make a link to it. So each time i develop a functoin, I go and deploy the website on the server and test it. So please let your answers without making break points and something like that. thanks in advance

推荐答案

您正在使用条件模式,这意味着,更新面板就不会工作,除非该事件被触发。

You are using Conditional Mode which means, the update panel will not work, unless the event is triggered.

删除。

 <asp:UpdatePanel ID="UpdatePanel3" runat="server">
            <ContentTemplate>
                <tr class="footer" runat="server">
                    <td colspan="4" runat="server">* By VoiceMpower
                           <asp:DropDownList AutoPostBack="true" runat="server" ID="callDispositionSelector" OnSelectedIndexChanged="callDispositionChanged" ClientIDMode="Static">
                               <asp:ListItem Value="-1">Select Disposition Reason</asp:ListItem>
                               <asp:ListItem Value="1">Reservation</asp:ListItem>
                               <asp:ListItem Value="2">Change of Reservation</asp:ListItem>
                               <asp:ListItem Value="3">Cancellation</asp:ListItem>
                               <asp:ListItem Value="4">Wait List</asp:ListItem>
                               <asp:ListItem Value="5">Other</asp:ListItem>
                           </asp:DropDownList>
                        <asp:TextBox runat="server" ID="visitID" ClientIDMode="Static"></asp:TextBox>
                    </td>
                </tr>
            </ContentTemplate>
        </asp:UpdatePanel>

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

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