Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ASP.NET core razor pages c# equivalent to php echo and die

$
0
0

In a model behind I want to see if a variable has what it is supposed to have.

In php I can:

echo $myvariable;
die;

In the model behind I tried:

Response.Write(somevar);
Response.End();

And got:

Severity Code Description Project File Line Suppression State
Error CS1061 'HttpResponse' does not contain a definition for 'Write' and no accessible extension method 'Write' accepting a first argument of type 'HttpResponse' could be found (are you missing a using directive or an assembly reference?) pcore31 C:\Users\kpskl_000\source\repos\pcore31\pcore31\Pages\petnew\Create.cshtml.cs 58 Active


Severity Code Description Project File Line Suppression State
Error CS1061 'HttpResponse' does not contain a definition for 'End' and no accessible extension method 'End' accepting a first argument of type 'HttpResponse' could be found (are you missing a using directive or an assembly reference?) pcore31 C:\Users\kpskl_000\source\repos\pcore31\pcore31\Pages\petnew\Create.cshtml.cs 59 Active

Okay, in a .net core project, how do I echo then die? 


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>