Smartnavigation disables ActiveX Events (OWC)

Discussion in 'ASP .Net' started by Kevin Ortman, Dec 5, 2003.

  1. Kevin Ortman

    Kevin Ortman Guest

    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());
    }
    Kevin Ortman, Dec 5, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CVN_tst cvn via .NET 247

    OWC 9 and Owc 11 compatibility

    CVN_tst cvn via .NET 247, Aug 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    647
    CVN_tst cvn via .NET 247
    Aug 4, 2004
  2. Scott Allen

    Re: OWC 9 and Owc 11 compatibility

    Scott Allen, Aug 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    815
    Scott Allen
    Aug 4, 2004
  3. =?Utf-8?B?Sm9obiBOaW5hbg==?=

    PreRender Disables the User controls events

    =?Utf-8?B?Sm9obiBOaW5hbg==?=, Sep 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    525
    Martin Dechev
    Sep 24, 2004
  4. =?Utf-8?B?a3N0cml5aG9u?=

    OWC pivot table events

    =?Utf-8?B?a3N0cml5aG9u?=, Jun 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,996
    Alvin Bruney [MVP - ASP.NET]
    Jun 29, 2005
  5. Jason Madison

    OWC Example that uses the ActiveX control on the client

    Jason Madison, Mar 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    441
    Jason Madison
    Mar 18, 2005
Loading...

Share This Page