I'm trying to stop the rest of a page loading based on some parameters; but am not sure of the correct syntax.
@if(dayRes + dayTri == 2){<text>Sorry, etc</text> @Response.End}
The above throws this error: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
Any ideas?
Your code tries to print Response.End to the page.
You can just write (in your code block)
return;
to stop running the generated Execute() method.
You can also call End as a method inside of your code block:
Response.End();
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