I have a slight problem my code works fine but it re-sizes my entire page. The code I have is:
else if (searchString == "")
{
Response.Write("<script>window.alert('Nothing Has Been Entered.' </script>");
}
Now the thing is i have a search box if it is empty this message appears but when i press the ok button on the message that appears it re-sizes my page layout and makes everything bigger. Is there a way to stop this from happening I am using C# and in ASP.NET and MVC3
Do not use
Response.Writein asp.net mvc. MVC doesn’t work like that. Instead, set your message in the ViewData like this:Then in your .cshtml page, show it like this: