I have a RadEditor on a page in a password secured admin section of my website. When I load the page, I am loading the content from my SQL Server 2005 database. Any image included in the content comes up as a red x instead of displaying the image. If I go into the image manager and replace it, the image shows up fine until the page is reloaded, then it goes back to the red x. When I load the content into my home page, the images display correctly (I use an asp repeater control). How do I fix the red x issue in rad editor?
aspx code:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<span class="home_intro">Page Content:</span><br />
<telerik:radeditor ID="redPageContent" runat="server" Height="1050px"
Width="576">
<ImageManager UploadPaths="~/assets/images" ViewPaths="~/assets/images" />
<Content></Content>
</telerik:radeditor>
c# code:
protected void GetText()
{
string ID = Request.QueryString["ID"].ToString();
// Set variables & db connection
DataTable objDs = new DataTable();
SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["CMI"].ConnectionString);
SqlDataAdapter da = new SqlDataAdapter("SELECT ContentDesc, ContentSidebar, ContentPage, ContentSubPage FROM tblContent WHERE ContentID=" + ID + ";", myConnection);
myConnection.Open();
da.Fill(objDs);
if (objDs.Rows.Count > 0)
{
DataRow myRow = objDs.Rows[0];
redPageContent.Content = myRow["ContentDesc"].ToString();
redSidebarContent.Content = myRow["ContentSidebar"].ToString();
lblPageName.Text = myRow["ContentPage"].ToString() + " - " + myRow["ContentSubPage"].ToString();
}
myConnection.Close();
}
aspx code:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<span class="home_intro">Page Content:</span><br />
<telerik:radeditor ID="redPageContent" runat="server" Height="1050px"
Width="576">
<ImageManager UploadPaths="~/assets/images" ViewPaths="~/assets/images" />
<Content></Content>
</telerik:radeditor>
c# code:
protected void GetText()
{
string ID = Request.QueryString["ID"].ToString();
// Set variables & db connection
DataTable objDs = new DataTable();
SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["CMI"].ConnectionString);
SqlDataAdapter da = new SqlDataAdapter("SELECT ContentDesc, ContentSidebar, ContentPage, ContentSubPage FROM tblContent WHERE ContentID=" + ID + ";", myConnection);
myConnection.Open();
da.Fill(objDs);
if (objDs.Rows.Count > 0)
{
DataRow myRow = objDs.Rows[0];
redPageContent.Content = myRow["ContentDesc"].ToString();
redSidebarContent.Content = myRow["ContentSidebar"].ToString();
lblPageName.Text = myRow["ContentPage"].ToString() + " - " + myRow["ContentSubPage"].ToString();
}
myConnection.Close();
}