Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.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
C# FreeTextBox javascript错误阻止在我的DropDownList上发回_C#_Javascript_Asp.net_Postback_Freetextbox - Fatal编程技术网

C# FreeTextBox javascript错误阻止在我的DropDownList上发回

C# FreeTextBox javascript错误阻止在我的DropDownList上发回,c#,javascript,asp.net,postback,freetextbox,C#,Javascript,Asp.net,Postback,Freetextbox,我有一个页面,上面有3个控件。它们设置正确,我一直在正常使用它们,直到我需要添加一个DropDownList控件,该控件将回发到服务器,但我惊讶地发现,OnSelectedIndexChanged事件永远不会触发。如果我使用按钮或其他服务器端控件发布帖子,那么事件会被触发。经过多次调试后,我发现每当我在DropDownList控件上选择不同的内容时,都会抛出以下Javascript错误: TypeError: FTB_API.MainContent_MainContent_FreeTextBox

我有一个页面,上面有3个控件。它们设置正确,我一直在正常使用它们,直到我需要添加一个DropDownList控件,该控件将回发到服务器,但我惊讶地发现,
OnSelectedIndexChanged
事件永远不会触发。如果我使用按钮或其他服务器端控件发布帖子,那么事件会被触发。经过多次调试后,我发现每当我在DropDownList控件上选择不同的内容时,都会抛出以下Javascript错误:

TypeError: FTB_API.MainContent_MainContent_FreeTextBox1 is undefined
这个错误似乎很直截了当; Firebug告诉我此错误来自以下函数:

function WebForm_OnSubmit()
{
    FTB_API['MainContent_MainContent_FreeTextBox1'].StoreHtml();FTB_API['MainContent_MainContent_FreeTextBox2'].StoreHtml();FTB_API['MainContent_MainContent_FreeTextBox3'].StoreHtml();
    return true;
} 
我试过几件事都没有成功。当我从页面中删除FreeTextBox控件时,我成功地进行了回发。任何帮助都将不胜感激。 谢谢

编辑1:这是我的一些标记

3 FreeTextBox设置如下:

<FTB:FreeTextBox ID="FreeTextBox3" JavaScriptLocation="ExternalFile" ButtonImagesLocation="ExternalFile" ToolbarImagesLocation="ExternalFile" runat="server" EnableHtmlMode="true" />

我的下拉列表:

<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>

在标记页面中设置下拉列表的属性AutoPostBack=true。当您更改下拉元素并触发OnSelectedIndexChanged时,这将使帖子返回

示例:

<asp:DropDownList id="drpList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="event name" />


我在这个线程中找到了问题的答案:似乎出于某种原因,当控件不可见或隐藏(我有选项卡)时,它的行为是这样的。答案有点像黑客,但它是有效的。谢谢你的回答。

对不起,我想我应该期待得到这样的答案,因为我没有发布我的代码或部分代码。我已将AutoPostBack属性设置为true。我将用更多的代码更新我的问题。