Custom Feature Code

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/12/2012 11:00:05 AM
Gravatar
Total Posts 148

Custom Feature Code

I am creating a custom feature that uses a setting to change the background of a div.

When I use code like this:

string s = @"background-image: url('App_Themes/MyTheme/MyImage.png')";

background.Attributes.Add("style",s);

 

The page source shows:

 

<div id="background" style="background-image: url(&#39;App_Themes/MyTheme/MyImage.png&#39;)"></div>

 

How do I keep the single quote ' from being replaced with &#39;?

I know this has nothing to do with the mojoPortal CMS but maybe another developer has had this same problem.

7/12/2012 11:37:40 AM
Gravatar
Total Posts 148

Re: Custom Feature Code

I did some research on the Internet about this problem and have found out that developers are calling this a bug in .Net 4.0.

Microsoft is calling it a "security issue".

7/12/2012 1:21:17 PM
Gravatar
Total Posts 2253

Re: Custom Feature Code

Hi,

Technically, you don't need the single quotes so you can remove them and it should work properly.

I caution you on doing this though because it makes it more difficult to customize the UI of your app later. I would add/change a class on the div in your code and then apply the background-image through CSS instead of inline style.

HTH,
Joe D.

You must sign in to post in the forums. This thread is closed to new posts.