Using Response.Write and Response.Redirect at the same time

shanethegooner

New Member
Below is Asp.net mvc code,\[code\] public void Index() { Response.Write("Hey"); Response.Redirect("https://www.google.com"); } OR public void Index() { Response.Redirect("https://www.google.com"); Response.Write("Hey"); }\[/code\]Here, Redirecting is working but not the Write(). Why Redirect is being given a preference? I mean why 302 and why not 200 in http response.Note: This is not for addressing any real time scenario. Just have curiosity to know the reason or underlying behavior.
 
Back
Top