TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ravi sharma
NA
87
16.5k
Issue when replacing string from html template to hyperlink
Jan 10 2017 4:11 AM
Hi All,
I have done some code which used html file as template and replace ##BG## from html template to url of image. Everything is working file on stage, but when I deployed on production, it is not showing any background images on production. Please suggest. Below is the code.
StreamReader stringHtml = System.IO.File.OpenText(System.Web.Hosting.HostingEnvironment.MapPath("~/assets/dictionary/lrn-cpets-certificate.html"));
string changeHtml = stringHtml.ReadToEnd();
if (certificateCount >= 1 && certificateCount <= 2)
{
changeHtml = changeHtml.Replace("##BG##", EnvironmentFrontEndUrl + "/assets/images/cpet/standard.jpg");
}
else if (certificateCount >= 3 && certificateCount <= 5)
{
changeHtml = changeHtml.Replace("##BG##", EnvironmentFrontEndUrl + "/assets/images/cpet/bronze.jpg");
}
else if (certificateCount >= 6 && certificateCount <= 9)
{
changeHtml = changeHtml.Replace("##BG##", EnvironmentFrontEndUrl + "/assets/images/cpet/silver.jpg");
}
else if (certificateCount == 10)
{
changeHtml = changeHtml.Replace("##BG##", EnvironmentFrontEndUrl + "/assets/images/cpet/gold.jpg");
}
changeHtml = changeHtml.Replace("##DictionaryListing##", Name.ToUpper());
changeHtml = changeHtml.Replace("##DictionaryListing2##", HttpUtility.UrlDecode(objCPETSCertificate[i].CourseName.ToUpper()));
if (objCPETSCertificate[i].CompletionDate != null)
{
DateTime dt = objCPETSCertificate[i].CompletionDate;
string strDate = String.Format("{0:d MMM yyyy}", dt);
changeHtml = changeHtml.Replace("##DictionaryListing3##", Convert.ToString(strDate));
}
else
{
changeHtml = changeHtml.Replace("##DictionaryListing3##", string.Empty);
}
Following is the code of html file which I am using as a template.
<style type="text/css">
.wrapper {
/*width: 1250px;
height: 870px;*/
width: 1250px;
height: 880px;
font-family: 'OpenSansRegular';
color: #092f57;
background-image: url(##BG##);
background-size: 100% 100%;
background-repeat: no-repeat;
}
</style>
Reply
Answers (
1
)
get parent id from parentTable to childTable
Datatable array