I have an application that must return a value to the method that invokes it, I have been researching but most examples are of console applications and mine is of Forms.
I have tried this way:
Program.cs
[STAThread]
static string Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Formulario());
response = Formulario.resp;
return response;
}
and in Formulario.cs:
internal static string resp;
protected void Page_Load(object sender, EventArgs e)
{
resp = "valor devuelto";
}
I even tried:
protected string Page_Load(object sender, EventArgs e)
{
return resp = "valor devuelto";
}
But when trying to execute it, it marks me:
"El programa no contiene ningún método Main estático adecuado para un punto de entrada"
Any idea how I could send the value to the method that my application invokes? Thanks