Hello, thank you for your time, I don't know what it is wrong.
I put all of the code that you mentioned in the masterpage and I put the javascript code inside the form, and it doesn't work out, the modalpup extender doesn't show up during the asyncronous call when I click over the Button1 in web form , in web form
I put only this code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(3000)
End Sub
<script type="text/javascript">
Sys.Application.add_load(GlobalApplicationLoadHandler);
function GlobalApplicationLoadHandler(sender, args) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (!prm.get_isInAsyncPostBack()) {
prm.add_initializeRequest(initRequest);
prm.add_endRequest(endRequest);
}
}
function initRequest(sender, args) {
var pop = $find("<%=GlobalModalPopupExtender.ClientID%>");
pop.show();
}
function endRequest(sender, args) {
var pop = $find("<%=GlobalModalPopupExtender.ClientID%>");
pop.hide();
}
</script>
Christianpmg
Member
73 Points
59 Posts
Re: Javascript error 'null' is null or not an object in Modalpopup extender
Jul 15, 2009 03:24 AM|LINK
Hello, thank you for your time, I don't know what it is wrong.
I put all of the code that you mentioned in the masterpage and I put the javascript code inside the form, and it doesn't work out, the modalpup extender doesn't show up during the asyncronous call when I click over the Button1 in web form , in web form I put only this code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(3000)
End Sub
In the the masterpage I put the following code:
Thank you in advance and best regards
Christian.
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.vb" Inherits="WebApplication1.Site1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
<div id="GlobalMain" runat="server">
<asp:ScriptManager ID="ScriptManager2" AsyncPostBackErrorMessage="Connection with the server was lost. Please try again"
runat="server" EnablePartialRendering="true" EnablePageMethods="True" EnableScriptGlobalization="true"
EnableScriptLocalization="true">
</asp:ScriptManager>
</div>
<cc1:ModalPopupExtender ID="GlobalModalPopupExtender" runat="server" PopupControlID="GlobalpnlPopup"
DropShadow="False" TargetControlID="GlobalMain" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="GlobalpnlPopup" runat="server" Style="display: none; background-color: #EEF1F1;
border-width: 1px; border-style: solid; width: 200px; border-color: Black; padding: 2px">
<table align="center">
<tr>
<td align="center">
<asp:Image ID="imgGlobalProcessing" runat="server" ImageURL="progress.gif" />
Processing ...
</td>
</tr>
</table>
</asp:Panel>
<script type="text/javascript">
Sys.Application.add_load(GlobalApplicationLoadHandler);
function GlobalApplicationLoadHandler(sender, args) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (!prm.get_isInAsyncPostBack()) {
prm.add_initializeRequest(initRequest);
prm.add_endRequest(endRequest);
}
}
function initRequest(sender, args) {
var pop = $find("<%=GlobalModalPopupExtender.ClientID%>");
pop.show();
}
function endRequest(sender, args) {
var pop = $find("<%=GlobalModalPopupExtender.ClientID%>");
pop.hide();
}
</script>
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>