I am having a very weird issue with viewing an Asp.Net site in the browser while running my VS installations. It seems to have happened when I was trying to add an UpdatePanel over a table which contains some RadioButtonList controls, to keep them from flickering.
When I view a particular page in the site in a default browser using VS 2010, say... BuildIt.aspx, that page shows up and I can see the background I have for the page, being an image in the solution. I have it wired up in the CodeBehind like so:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Build_It : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
StringBuilder script = new StringBuilder();
script.Append("<script type=\"text/javascript\">");
script.Append("document.body.style.background = \"url('/Cyber7th/Images/BlueprintBuilder1.jpg')\";");
script.Append("document.body.style.backgroundRepeat = 'no-repeat';");
script.Append("</script>");
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "changeBackground", script.ToString());
}
}
This allows for the background image to change with the associated page upon navigation. This works just in VS 2010. However, when fiddling around in VS 2013 trying to add the AJAX controls to stop flicker, my implementation didn't produce the desired results, so I removed it. However, now when I run the same page in the default browser using VS 2013, my background image doesn't exist! How is this? Here's the same code for the page's CodeBehind via VS 2013:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Build_It : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
StringBuilder script = new StringBuilder();
script.Append("<script type=\"text/javascript\">");
script.Append("document.body.style.background = \"url('/Cyber7th/Images/BlueprintBuilder1.jpg')\";");
script.Append("document.body.style.backgroundRepeat = 'no-repeat';");
script.Append("</script>");
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "changeBackground", script.ToString());
}
}
No difference! Why does VS 2013 refuse to display the background images for the pages (missing on two pages which are ASCX controls), when no changes in the code behind exist which should affect this? I even copied over the code from the working solution. Thank you for your assistance and insight.
I resolved to fix this by simply re-installation the entire program. Success.