Smartnavigation disables ActiveX Events (OWC)

K

Kevin Ortman

Hi all,

I am wondering if the following is a known problem, and if there are any
known solutions.

Thanks in advance,
Kevin Ortman


[ Problem ]
Enabling Smartnavigation on my webform disables client side activex events
(specifically OWC 10 events like BeforeContextMenu) after postback.

[ Repro ]
1) Create a webform with a button and a spreadsheet control.
2) In the webform's Page_Load() event, use RegisterClientScriptBlock() to
register vbscript events.
-- When the page is first loaded, the events are fired and the script is
executed.
4) Click on the button to generate a postback.
-- When the page is re-loaded, the events are not fired and the script is
not executed.

[ Environment ]
..NET Framework 1.0 / Windows XP

[ Sample ]
<%@ Page language="c#" Codebehind="WebForm3.aspx.cs" AutoEventWireup="false"
Inherits="DesignerTest.WebForm3" SmartNavigation=true %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="WebForm3" method="post" runat="server">
<OBJECT id="MyGridControl" style="Z-INDEX: 101; LEFT: 219px; POSITION:
absolute; TOP: 117px" classid="clsid:0002E551-0000-0000-C000-000000000046"
VIEWASTEXT>
</OBJECT>
<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 61px; POSITION:
absolute; TOP: 124px" runat="server" Text="Button"></asp:Button>
</form>
</body>
</HTML>


protected System.Web.UI.WebControls.Button Button1;

private void Page_Load(object sender, System.EventArgs e)
{
System.Text.StringBuilder scriptBuilder = new
System.Text.StringBuilder();

scriptBuilder.Append("<script language=vbscript>\n");

scriptBuilder.Append("Sub MyGridControl_LoadCompleted() \n");
scriptBuilder.Append(" me.ActiveSheet.Protection.Enabled = -1 \n");
scriptBuilder.Append(" me.DisplayColumnHeadings = 0 \n");
scriptBuilder.Append(" me.DisplayRowHeadings = 0 \n");
scriptBuilder.Append("End Sub\n");

scriptBuilder.Append("</script>\n");

Page.RegisterClientScriptBlock(this.UniqueID + "_GridEvents",
scriptBuilder.ToString());
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top