I am using ModalPopup extender in my application, with this extender I created a progress bar, it works fine without using a Masterpage in my webform, but when I use my webform in a MasterPage doesn't work out, I tried to solve this problem moving the javascript
code to the Masterpage, but it doesn't work, I don't know how to make my Modalpopup extender works fine in my webform with a MasterPage. If somebody knows how to solve this or has anyother idea I would be thankful. following I put all of the code without using
a MasterPage. I receive a javascript code: 'null' is null or not an object
Christianpmg
Member
73 Points
59 Posts
Javascript error 'null' is null or not an object in Modalpopup extender
Jul 09, 2009 01:35 AM|LINK
Hello everybody, my name is Christian.
I am using ModalPopup extender in my application, with this extender I created a progress bar, it works fine without using a Masterpage in my webform, but when I use my webform in a MasterPage doesn't work out, I tried to solve this problem moving the javascript code to the Masterpage, but it doesn't work, I don't know how to make my Modalpopup extender works fine in my webform with a MasterPage. If somebody knows how to solve this or has anyother idea I would be thankful. following I put all of the code without using a MasterPage. I receive a javascript code: 'null' is null or not an object
thank you in advance.
best regards.
Christian.
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript" language="javascript">
// CAPTURE EVENTS
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);
function beginRequest(sender, args) {
$find('ModalProgress').show();
}
function endRequest(sender, args) {
// BEGIN POSTBACK EVENT
$find('ModalProgress').hide();
}
</script>
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(3000)
End Sub
</script>
<asp:UpdatePanel ID="Ejemplo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Button" />
<ajaxToolkit:ModalPopupExtender ID="ModalProgress" runat="server"
TargetControlID="Fntr_Popup" PopupControlID="Fntr_Popup" BackgroundCssClass="backgroundprogressbar">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="Fntr_Popup" runat="server" CssClass="progressbar" style="display:none">
please wait or/o por favor espere ...
<img src="loading.gif" alt="" title=""/>
</asp:Panel>
<br />
</form>
</body>
</html>