我需要使用JavaScript在客户端隐藏模态弹窗。
如果我使用
$find( ModalPopupExtender1 ).hide();
为了隐藏它,它报错了。
null 是 null 还是不是一个对象
我需要使用JavaScript在客户端隐藏模态弹窗。
如果我使用
$find( ModalPopupExtender1 ).hide();
为了隐藏它,它报错了。
null 是 null 还是不是一个对象
有两个选项来解决这个问题:
将modalpopup的ID更改为ModalPopupExtender1
。
将你的脚本更改为以下内容:
$find( <%= ModalPopupExtender1.ClientID%> ).hide();
解决此问题有两个选择:
将行为ID更改/添加到模态弹出窗口,并命名为ModalPopupExtender1
。
(Traditional Chinese: 將行為ID更改/添加到模態彈出窗口,並命名為ModalPopupExtender1
。)
把你的脚本改成这样:
$find( ModalPopupExtender1 ).hide();
听起来$find调用可能找不到行为。 你能改变代码吗:
var behavior = $find( ModalPopupExtender1 );
var undefined;
if (behavior !== undefined)
alert("found");
else
alert("not found");
有两个解决办法:
将一个 behaviorID 添加/更改给弹出窗口,并将其命名为 ModalPopupExtender1
Change your script to this: $find( ModalPopupExtender1 ).hide();
I was having no luck with any of the above techniques, nor any others I found on the Web. Something that DOES work for me is to call
__doPostBack("xxx", 0);
This causes a proper page reload and the popup does NOT come back. Note that my code-behind does not explicitly look for or handle the "xxx" param, it just lets the postback reload the page.
我承认,OP可能希望关闭弹窗而不刷新页面,但在我这种情况下,我确实需要刷新,所以这对我有效。
We wrote a couple of controls using Microsoft AJAX (cs class + js class). Now I m thinking about getting rid of it (just use jQuery), as it is bloated and we don t use UpdatePanel. My question is: how ...
I have a telerik rad grid with PageSize=10. The problem is if I have 34 items. On the last page, there will only be 4 rows. Is there a mode to force to control to render with 6 empty null rows or do I ...
I m trying to find a reusable way to set focus from one text box to another upon enter using ASP.NET, but using client-side JavaScript to do so. The only reason I mention this is to be done in ASP....
I undestand that is former for Web Forms ASP.Net only , latter ( currently preview 6 ) suitable for both - classic and MVC. Would it be possible to give a brief description/usage for each. By ASP.NET ...
I have the following code: <div id="comments"> <h2> Comments</h2> <div id="comment"> </div> <% foreach (var comment in this.Model.Topic....
I m looking for feedback on what other people use on their ASP.NET projects to provide a rich user interface experience while still remaining as productive as possible. I m developing an ASP.NET 3.5 ...
I am trying to use an CollapsiblePanelExtender to make some dropdown menus and am having some problems when hovering over links - can anyone help me out... By the way I do want to keep the ...
The Microsoft AJAX Library Preview 6 and jQuery provide several ways to make the sorts of calls I need: Sys.Net.WebRequest (ASP.NET Ajax) Sys.Net.WebServiceProxy (ASP.NET Ajax) $.ajax (jQuery) Sys....