Hi All,
I am trying to use WebDialogWindow in my aspx page but I am getting 'Sys' error 'object expected'. The design view code I have used is given below.
Plz suggest me where am I doing wrong.
<head runat="server"> <title>Untitled Page</title> <script type ="text/javascript"> // function called on Initialize event function initializeEvt(sender, args) { showClosedState(); } // adjust state of "Show Dialog" button function showClosedState() { var target = $getPart('ShowDialog'); var dialog = $find('<%=WebDialogWindow1.ClientID%>'); //alert(dialog); if(target) target.disabled = (dialog.get_windowState() != $IG.DialogWindowState.Hidden); } // function called before Minimized button event function windowStateChangingEvt(sender, args) { var str = 'Window state Changing. '; var cancel = $getPart('CancelButtonEvents'); if(cancel && cancel.checked) { str += 'Action was canceled.' args.set_cancel(true); } else str += ' Action can be canceled.' addLine(str); } function windowStateChangedEvt(sender, args) { addLine('Window State Changed. Postback can be triggered.'); var postBack = $getPart('PostBackOnButtonEvents'); if(postBack && postBack.checked) args.set_postBack(1); } function movedEvt(sender, args) { addLine('Moved. Left/top new:' + args.get_x() + ',' + args.get_y() + ', old:' + args.get_oldX() + ',' + args.get_oldY() + '. Action can be canceled or modified.'); var modify = $getPart('ModifyMovedEvents'); if(modify && modify.checked) { if(args.get_x() > 300) args.set_X(300); if(args.get_x() < 10) args.set_X(10); } } function movingEvt(sender, args) { var target = $getPart('MovingEvents'); if(target && target.checked) addLine('Moving. Left/top new:' + args.get_x() + ',' + args.get_y() + ', old:' + args.get_oldX() + ',' + args.get_oldY() + '. Action can be canceled.'); var cancel = $getPart('CancelMovingEvents'); if(cancel && cancel.checked && (args.get_y() > 400 || args.get_y() < 50)) args.set_cancel(true); } function resizedEvt(sender, args) { addLine('Resized. Size new:' + args.get_width() + ',' + args.get_height() + ', old:' + args.get_oldWidth() + ',' + args.get_oldHeight() + '. Action can be canceled or modified.'); var modify = $getPart('ModifyResizedEvents'); if(modify && modify.checked) { if(args.get_height() > 300) args.set_height(300); if(args.get_height() < 100) args.set_height(100); } } function resizingEvt(sender, args) { var target = $getPart('ResizingEvents'); if(target && target.checked) addLine('Resizing. Size new:' + args.get_width() + ',' + args.get_height() + ', old:' + args.get_oldWidth() + ',' + args.get_oldHeight() + '. Action can be canceled.'); var cancel = $getPart('CancelResizingEvents'); if(cancel && cancel.checked && (args.get_width() > 400 || args.get_width() < 150)) args.set_cancel(true); }function $getPart(id, div) { var elems = document.getElementsByTagName(div ? 'DIV' : 'INPUT'); var i = elems.length; while(i-- > 0) if(elems[i].id && elems[i].id.indexOf(id) >= 0) return elems[i]; return null; } // clear list of events function clearList() { var target = $getPart('eventList', true); if(target) target.innerHTML = 'Output of Client Events:'; listCount = 0; } </script></head><body> <form id="form1" runat="server"> <div> <input id="ShowDialog" type="button" value="Show WebDilog" onclick ="$find('<%=WebDialogWindow1.ClientID%>').set_windowState($IG.DialogWindowState.Normal);" /> <asp:ScriptManager id="ScriptManager1" runat="server"> </asp:ScriptManager> <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="300px" Style="position: relative; left: 321px; top: 8px;" Width="400px"> <ContentPane BackColor="#FAFAFA"> <Template> <div style="padding: 5px;"> <asp:Label ID="Label1" runat="server" Text="This is the content of the WebDialogWindow." Style="line-height: 20px"></asp:Label> <br /> </div> </Template> </ContentPane> <Header CaptionText="Dialog Caption"> <MaximizeBox Visible="True" /> <MinimizeBox Visible="True" /> </Header> <ClientEvents Initialize="initializeEvt" WindowStateChanging="windowStateChangingEvt" WindowStateChanged ="windowStateChangedEvt" Moved ="movedEvt" Moving="movingEvt" Resized ="resizedEvt" Resizing ="resizingEvt"/> </ig:WebDialogWindow> <div id="EventOptions" > <div id="EventCol1"> <asp:CheckBox ID="CancelButtonEvents" runat="server" Text="Cancel Button Events" /><br /> <asp:CheckBox ID="PostBackOnButtonEvents" runat="server" Text="PostBack On Button Events" /><br /> <asp:CheckBox ID="ModifyMovedEvents" runat="server" Text="Moved: keep left 10..300" /> <asp:CheckBox ID="CancelMovingEvents" runat="server" Text="Moving: keep top 50..400" /><br /> </div> <div id="EventCol2"> <asp:CheckBox ID="MovingEvents" runat="server" Text="Show Moving Events" /> <asp:CheckBox ID="ModifyResizedEvents" runat="server" Text="Resized: keep height 100..300" /><br /> <asp:CheckBox ID="ResizingEvents" runat="server" Text="Show Resizing Events" /><br /> <asp:CheckBox ID="CancelResizingEvents" runat="server" Text="Resizing: keep width 150..400" /><br /> </div> </div> <div id="eventListWrapper"> <div id="eventList" nowrap="nowrap"> Output of Client Events: <input id="ClearEventsButton" style="left: 275px; position: relative; top: 272px" type="button" value="Clear Events" onclick ="clearList()" /></div> </div> </div> </form></body>
Hi all,
I got the solution to my problem there was nothing wrong in my code but I had to uninstall AJAX
and reinstall it from another exe setup file.