Click here to Skip to main content
15,885,869 members
Home / Discussions / C#
   

C#

 
QuestionCan a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 0:12
arnold_w5-Sep-20 0:12 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
OriginalGriff5-Sep-20 0:30
mveOriginalGriff5-Sep-20 0:30 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 0:36
arnold_w5-Sep-20 0:36 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
OriginalGriff5-Sep-20 0:54
mveOriginalGriff5-Sep-20 0:54 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Gerry Schmitz5-Sep-20 3:50
mveGerry Schmitz5-Sep-20 3:50 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 4:33
arnold_w5-Sep-20 4:33 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Gerry Schmitz5-Sep-20 4:58
mveGerry Schmitz5-Sep-20 4:58 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Dave Kreskowiak5-Sep-20 5:39
mveDave Kreskowiak5-Sep-20 5:39 
An HTML button cannot directly call a C# method. The button is in one execution environment and the C# code is in another, even if your HTML and C# code are running client-side.

It sounds like you're trying to use an HTML page as an interface for a desktop app. That's a bad idea.

It can work, but there's a steep price. You'd have to host the ASP.NET runtime in your desktop app. This adds a LOT of overhead and complexity to your app, so it's usually not worth it.

If you're going to go through this pain, it's actually easier to just write up the app as an actual website and host in on the internet.

GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 8:30
arnold_w5-Sep-20 8:30 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Dave Kreskowiak5-Sep-20 9:04
mveDave Kreskowiak5-Sep-20 9:04 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
jsc426-Sep-20 11:31
professionaljsc426-Sep-20 11:31 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Luc Pattyn5-Sep-20 9:29
sitebuilderLuc Pattyn5-Sep-20 9:29 
QuestionSimple C# question - Begginer's lesson, please aid. Pin
Member 149309634-Sep-20 13:32
Member 149309634-Sep-20 13:32 
AnswerRe: Simple C# question - Begginer's lesson, please aid. Pin
Mycroft Holmes4-Sep-20 15:19
professionalMycroft Holmes4-Sep-20 15:19 
GeneralRe: Simple C# question - Begginer's lesson, please aid. Pin
Member 149309634-Sep-20 15:21
Member 149309634-Sep-20 15:21 
GeneralRe: Simple C# question - Begginer's lesson, please aid. Pin
Mycroft Holmes4-Sep-20 15:57
professionalMycroft Holmes4-Sep-20 15:57 
GeneralRe: Simple C# question - Begginer's lesson, please aid. Pin
Member 149309634-Sep-20 16:56
Member 149309634-Sep-20 16:56 
AnswerRe: Simple C# question - Begginer's lesson, please aid. Pin
OriginalGriff4-Sep-20 20:07
mveOriginalGriff4-Sep-20 20:07 
AnswerRe: Simple C# question - Begginer's lesson, please aid. Pin
Eddy Vluggen5-Sep-20 5:27
professionalEddy Vluggen5-Sep-20 5:27 
QuestionRunning Function from Task.Run with Cancellation Token gives infinite loop Pin
Exoskeletor4-Sep-20 12:41
Exoskeletor4-Sep-20 12:41 
AnswerRe: Running Function from Task.Run with Cancellation Token gives infinite loop Pin
Gerry Schmitz5-Sep-20 4:31
mveGerry Schmitz5-Sep-20 4:31 
GeneralRe: Running Function from Task.Run with Cancellation Token gives infinite loop Pin
Exoskeletor5-Sep-20 8:25
Exoskeletor5-Sep-20 8:25 
GeneralRe: Running Function from Task.Run with Cancellation Token gives infinite loop Pin
Gerry Schmitz5-Sep-20 9:05
mveGerry Schmitz5-Sep-20 9:05 
GeneralRe: Running Function from Task.Run with Cancellation Token gives infinite loop Pin
Exoskeletor5-Sep-20 10:17
Exoskeletor5-Sep-20 10:17 
GeneralRe: Running Function from Task.Run with Cancellation Token gives infinite loop Pin
Gerry Schmitz5-Sep-20 10:38
mveGerry Schmitz5-Sep-20 10:38 

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.