I am very new to ASP.NET. I just found something interesting when I try to create an ASP.NET application.
I created a button, and wrote the following code in a click event handler:
protected void Button1_Click(object sender, EventArgs e)
{
Form FormMain = new Form();
FormMain.Show();
}
I then tried to add a reference to System.Windows.Forms. I ran it, and it worked. When I click on the browser button, a WinForms form appears.
Can I use this technique to build a desktop application such that all the code is in the web?
No, Web applications run in the server.
Desktop Applications run in the client.
This only works because you're running it locally, but it will not work when deploying the ASP.Net Web Application to a Web Server.
If you need to create Web Applications, then use the standard ASP.Net techniques which deliver HTML [+ JavaScript + CSS] content to the browser. You may choose between "traditional" ASP.Net WebForms, or ASP.Net MVC.
If you need to create Windows Desktop Applications, use WPF.
If you need to create Windows 8 "Metro Style" Applications, use WinRT XAML.
winforms is completely useless at this point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With