.Net 2.0 - WebBrowser control embedded in IE causes problems

Discussion in 'ASP .Net Web Controls' started by L. Chernov, Jul 16, 2006.

  1. L. Chernov

    L. Chernov Guest

    Hello,

    I am trying to work with .Net 2005 WebBrowser object,
    and put it on a "Windows control library" (embedded in a user control class)
    and then I
    am executing it from an ASP.Net webform(with IE6) with the following object
    tag:
    <OBJECT id="ModPkiObj" height="550" width="800"
    classid="http:ModPkiNew.dll#Mod.Online.Client.ModPkiNew.SignForm"
    name="ModPkiObj" VIEWASTEXT>
    </OBJECT>

    And I get the following error:

    System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'WebBrowser'.
    at System.Windows.Forms.WebBrowser.get_AxIWebBrowser2()
    at System.Windows.Forms.WebBrowser.PerformNavigate2(Object& URL, Object&
    flags, Object& targetFrameName, Object& postData, Object& headers)
    at System.Windows.Forms.WebBrowser.PerformNavigateHelper(String
    urlString, Boolean newWindow, String targetFrameName, Byte[] postData,
    String headers)
    at System.Windows.Forms.WebBrowser.Navigate(String urlString)
    at Mod.Online.Client.ModPkiNew.SignForm.button1_Click(Object sender,
    EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
    button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
    IntPtr wparam, IntPtr lparam)


    Remark: When using this control library class from a winform container I
    dont get this bug.


    Thank You
     
    L. Chernov, Jul 16, 2006
    #1
    1. Advertising

  2. hi, I notice that you have embedded the object in your html source versus
    via script. Try the suggestions in the following post :
    http://groups.google.com/group/micr...l in .aspx page&rnum=3&hl=en#55aa645f38887e76

    Regards,
    Alessandro Zifiglio
    http://www.AsyncUI.net

    "L. Chernov" <> ha scritto nel messaggio
    news:%23r3Fr%...
    > Hello,
    >
    > I am trying to work with .Net 2005 WebBrowser object,
    > and put it on a "Windows control library" (embedded in a user control
    > class)
    > and then I
    > am executing it from an ASP.Net webform(with IE6) with the following
    > object
    > tag:
    > <OBJECT id="ModPkiObj" height="550" width="800"
    > classid="http:ModPkiNew.dll#Mod.Online.Client.ModPkiNew.SignForm"
    > name="ModPkiObj" VIEWASTEXT>
    > </OBJECT>
    >
    > And I get the following error:
    >
    > System.ObjectDisposedException: Cannot access a disposed object.
    > Object name: 'WebBrowser'.
    > at System.Windows.Forms.WebBrowser.get_AxIWebBrowser2()
    > at System.Windows.Forms.WebBrowser.PerformNavigate2(Object& URL, Object&
    > flags, Object& targetFrameName, Object& postData, Object& headers)
    > at System.Windows.Forms.WebBrowser.PerformNavigateHelper(String
    > urlString, Boolean newWindow, String targetFrameName, Byte[] postData,
    > String headers)
    > at System.Windows.Forms.WebBrowser.Navigate(String urlString)
    > at Mod.Online.Client.ModPkiNew.SignForm.button1_Click(Object sender,
    > EventArgs e)
    > at System.Windows.Forms.Control.OnClick(EventArgs e)
    > at System.Windows.Forms.Button.OnClick(EventArgs e)
    > at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    > at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
    > button, Int32 clicks)
    > at System.Windows.Forms.Control.WndProc(Message& m)
    > at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    > at System.Windows.Forms.Button.WndProc(Message& m)
    > at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
    > m)
    > at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
    > IntPtr wparam, IntPtr lparam)
    >
    >
    > Remark: When using this control library class from a winform container I
    > dont get this bug.
    >
    >
    > Thank You
    >
    >
     
    Alessandro Zifiglio, Jul 18, 2006
    #2
    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. Xavier Osa
    Replies:
    0
    Views:
    667
    Xavier Osa
    Jan 9, 2004
  2. ASP .NET Newbie
    Replies:
    10
    Views:
    14,829
    jojobouy
    Sep 28, 2007
  3. L. Chernov
    Replies:
    2
    Views:
    5,272
    vbbrad
    Aug 22, 2006
  4. JP2006
    Replies:
    1
    Views:
    1,092
    Rick Strahl [MVP]
    Jan 7, 2007
  5. Vetrivel
    Replies:
    1
    Views:
    434
    Ken Schaefer
    Dec 11, 2003
Loading...

Share This Page