0

当我输入这个时,我弄清楚是什么导致了我的问题,但我还没有弄清楚它为什么会导致问题,这对我来说似乎很奇怪。也许有人可以解释......这是我的情况(问题在底部):

我有 2 个模式弹出窗口。

PopupControlID 如下:

popup1 
popup2

从服务器端代码调用:

popup1.Show()    'works fine
popup2.Show()    'works fine

但在某些时候:

popup1.Show() 'inspecting on server side all properties definitely belong to
              'popup1, but when the ajax .js is triggered, popup2 
              'property values are being used 

一切都已正确设置以使这些控件运行,但是它们设置之外的某些东西导致了问题。

在 page_load 中,我将 popup2(它是一个 div)的目标弹出控件设置为.Visible = False. 当我注意到这段代码时,我删除了它,因为我知道目标控件是使用隐藏的style="display:none;"。删除后,我运行代码,没想到这会修复错误,但冲突消失了。我不明白这如何以这种方式影响我的弹出窗口。

问题:

有谁知道为什么 popup1.Show() 会继续使用 popup2 的属性而不是 ajax 脚本中自己的属性,只是因为在代码中的某个点,popup2 的目标控件设置为.visible = false

4

1 回答 1

0

In replicating my issue it seems the answer is as simple as this:

Any time you set a control to .Visible = "False" that is also the PopupControlID of a modal popup extender it will cause an error and the page will not load. I feel kinda stupid for now realizing this up front, a real "duh" moment...

Anyway, pretty basic stuff when I realized what was happening. Here is an article related to this issue:

http://blog.matthewdoyle.net/2008/10/13/visiblefalse-vs-displaynone/

于 2013-06-21T19:53:36.393 回答