Click here to Skip to main content
16,005,121 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Passing Data Betwen Forms Pin
Dave Kreskowiak14-Apr-08 8:31
mveDave Kreskowiak14-Apr-08 8:31 
GeneralRe: Passing Data Betwen Forms Pin
Christian Graus14-Apr-08 11:21
protectorChristian Graus14-Apr-08 11:21 
GeneralRe: Passing Data Betwen Forms [modified] Pin
Kit Fisto14-Apr-08 23:22
Kit Fisto14-Apr-08 23:22 
GeneralVS2005. Excel in MdiParent Pin
Member 364396113-Apr-08 20:12
Member 364396113-Apr-08 20:12 
Questionhow to create si/psi editor Pin
Member 402480013-Apr-08 17:25
Member 402480013-Apr-08 17:25 
AnswerRe: how to create si/psi editor Pin
Christian Graus13-Apr-08 17:30
protectorChristian Graus13-Apr-08 17:30 
GeneralRun command to repair (fix the system files), unable to locate component Pin
Knowledgestudent13-Apr-08 8:47
Knowledgestudent13-Apr-08 8:47 
Questionhow to Call WebBrowser class from a method in ASPx web page? Pin
BrownR12-Apr-08 11:18
BrownR12-Apr-08 11:18 
Hi,

I am trying to make a webpage with a link. When users click on this link, it launches a webbrowser on my server, do some stuff and return information.

Right now, I have successfully made my code for creating the webbrowser and processing data. But I cant seem to run it from an aspx webpage. It throws the exception :

ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.

So now, I m simply trying to instanciate the webbrowser from the webpage and this still crashes as well.

I would really appreciate any help you could give me.

Here is the code that I ve got on my webpage for the link:

<br />
<form id="form1" runat="server"><br />
    <div><br />
    <asp:linkbutton id="launchBro" text="Launch the Bro" runat="server"><br />
    OnClick="broMethod"></asp:linkbutton><br />
        <br /><br />
        <br /><br />
<br />
</div></form>



When clicked, the link launches this method in this class:

<br />
<br />
using System.Windows.Forms;<br />
using mshtml;<br />
<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
    protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
<br />
<br />
    }<br />
<br />
    [STAThread]<br />
    public void broMethod ( Object s, EventArgs e)<br />
    {<br />
<br />
        WebBrowser mybro = new WebBrowser();<br />
<br />
        <br />
    }<br />
<br />
}<br />
<br />



I also tryed to simply copy my class creating the webbrowser which is working into this project and instantiate it from this method, but it doesnt work either.



Thx,

Mathieu
AnswerRe: how to Call WebBrowser class from a method in ASPx web page? Pin
Ed.Poore12-Apr-08 11:39
Ed.Poore12-Apr-08 11:39 
GeneralRe: how to Call WebBrowser class from a method in ASPx web page? Pin
BrownR12-Apr-08 21:36
BrownR12-Apr-08 21:36 
GeneralRe: how to Call WebBrowser class from a method in ASPx web page? Pin
Ed.Poore12-Apr-08 22:53
Ed.Poore12-Apr-08 22:53 
Generalhelp for HtmlElement class.... Pin
Sasmi12-Apr-08 1:43
Sasmi12-Apr-08 1:43 
Questionhow to show windows form in fixed size. Pin
amit_8310-Apr-08 20:33
amit_8310-Apr-08 20:33 
AnswerRe: how to show windows form in fixed size. Pin
Christian Graus10-Apr-08 21:20
protectorChristian Graus10-Apr-08 21:20 
GeneralCombobox datasource remains null even after assigned with a dataset Pin
Ramya Bhaskaran10-Apr-08 2:53
Ramya Bhaskaran10-Apr-08 2:53 
GeneralRe: Combobox datasource remains null even after assigned with a dataset Pin
Pete O'Hanlon10-Apr-08 3:13
mvePete O'Hanlon10-Apr-08 3:13 
GeneralRe: Combobox datasource remains null even after assigned with a dataset Pin
Ramya Bhaskaran10-Apr-08 3:18
Ramya Bhaskaran10-Apr-08 3:18 
GeneralRe: Combobox datasource remains null even after assigned with a dataset Pin
darkelv10-Apr-08 3:50
darkelv10-Apr-08 3:50 
GeneralRe: Combobox datasource remains null even after assigned with a dataset [modified] Pin
Ramya Bhaskaran10-Apr-08 19:18
Ramya Bhaskaran10-Apr-08 19:18 
GeneralRe: Combobox datasource remains null even after assigned with a dataset Pin
Pete O'Hanlon10-Apr-08 22:23
mvePete O'Hanlon10-Apr-08 22:23 
GeneralUserControl and Backcolor Pin
RugbyLeague9-Apr-08 23:48
RugbyLeague9-Apr-08 23:48 
Questionto save xml files in a hidden folder Pin
Ahuja.bangalore9-Apr-08 23:46
Ahuja.bangalore9-Apr-08 23:46 
GeneralRe: to save xml files in a hidden folder Pin
Christian Graus10-Apr-08 0:11
protectorChristian Graus10-Apr-08 0:11 
GeneralGetting child windows Pin
d35tiny9-Apr-08 23:20
d35tiny9-Apr-08 23:20 
GeneralRe: Getting child windows Pin
Dave Kreskowiak10-Apr-08 3:50
mveDave Kreskowiak10-Apr-08 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.