I've got the following code block. I'm confused how the code can go past the
Response.Redirect("~..")
Indeed it does. I thought any lines past that would automatically not execute. Am I missing somethig basic here? I find the debugger actually executing the next lines.
public ActionResult Index()
{
Response.Redirect("~/Default.aspx", true);
string year =
Utils.ConvertCodeCampYearToActualYear(
Utils.GetCurrentCodeCampYear().ToString(CultureInfo.InvariantCulture));
var viewModel = GetViewModel(year);
return View(viewModel);
}
You need to return
it. It's a function. In your case you can use Redirect
:
return Redirect("~/Default.aspx");
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