FreeTextBox JavaScript错误,是对我的DropDownList的preventing回传 [英] FreeTextBox javascript error is preventing PostBack on my DropDownList

查看:125
本文介绍了FreeTextBox JavaScript错误,是对我的DropDownList的preventing回传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3 FreeTextBox 就可以控制一个页面。他们设置正确,而我使用它们正常,直到我需要添加一个DropDownList控件,将回发到服务器,但我很惊讶地看到 OnSelectedIndexChanged 事件永远不会被触发。如果我是做一个帖子有一个按钮,或者一些其他服务器端控制,那么将在事件被触发。许多调试后,我发现下面的JavaScript错误正在我选择了不同的东西在我的DropDownList控件每次抛出的:

 类型错误:FTB_API.MainContent_MainContent_FreeTextBox1未定义

该错误似乎pretty向前伸直;
萤火告诉我这个错误来自于以下几个功能:

 函数WebForm_OnSubmit()
{
    FTB_API['MainContent_MainContent_FreeTextBox1'].StoreHtml();FTB_API['MainContent_MainContent_FreeTextBox2'].StoreHtml();FTB_API['MainContent_MainContent_FreeTextBox3'].StoreHtml();
    返回true;
}

我试过几件事情没有成功。当我从页面移除FreeTextBox控制,我有成功的回传。任何帮助将是AP preciated。
谢谢你。

修改1 :这是我的一些标记

3 FreeTextBox设置是这样的:

 < FTB:FreeTextBox ID =FreeTextBox3JavaScriptLocation =ExternalFileButtonImagesLocation =ExternalFileToolbarImagesLocation =ExternalFile=服务器EnableHtmlMode =真/>

我的DropDownList:

 < ASP:DropDownList的ID =DropDownList1=服务器AppendDataBoundItems =真的AutoPostBack =真OnSelectedIndexChanged =DropDownList1_SelectedIndexChanged>
< / ASP:DropDownList的>


解决方案

我已经找到了答案,在这个线程的问题:的在Firefox隐藏FreeTextBox错误的似乎出于某种原因,当控制是不可见的,还是隐藏的(我有选项卡)它的行为这种方式。答案是怎样的一个黑客,但它的工作原理。感谢您的答案。

I have one page with 3 FreeTextBox controls on it. They are set up correctly, and I was using them normally until I needed to add a DropDownList control that would PostBack to the server, but I was surprised to see that the OnSelectedIndexChanged event would never trigger. If I was to do a Post with a button, or some other server-side control, then would the event be triggered. After much debugging I found the following Javascript error was being thrown every time I selected something different on my DropDownList control:

TypeError: FTB_API.MainContent_MainContent_FreeTextBox1 is undefined

The error seems pretty straight forward; Firebug tells me this error comes from the following function:

function WebForm_OnSubmit()
{
    FTB_API['MainContent_MainContent_FreeTextBox1'].StoreHtml();FTB_API['MainContent_MainContent_FreeTextBox2'].StoreHtml();FTB_API['MainContent_MainContent_FreeTextBox3'].StoreHtml();
    return true;
} 

I've tried several things without success. When I remove the FreeTextBox controls from my page, I have successful PostBacks. Any help would be appreciated. Thanks.

EDIT 1: This is some of my markup

3 FreeTextBox set up like this:

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

My DropDownList:

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

解决方案

I have found the answer to the question in this thread: Hidden FreeTextBox bug on Firefox It seems for some reason that when the control is not visible or is hidden (I have tabs) it behaves this way. The answer is kind of a Hack, but it works. Thanks for the answers.

这篇关于FreeTextBox JavaScript错误,是对我的DropDownList的preventing回传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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