I posted this question yesterday but it is not there today. So I am posting it again.
I am looking to understand how to use a CSS in an HTML webresource. I am running into limitations with the dialogs so I am creating an HTML page and converting my dialog into just a standard HTML page where I can have full control over what is presented to the user. I have coded up a few test HTML pages but I cannot get the CSS to work. Here's what I am running into.
I am working with CRM 2011 on-premise and VS.Net 2010 (I can upgrade to 2012 or 2013 if it might help). I have created a CRM 2011 Package project (I also tested it via the solution, which adds a package) and added a simple HTML and CSS. In the HTML I added a link to my CSS file. I added CSS folder (also tried it without a folder) and put a simple CSS in there. I have played around with folders, names, etc. and I have gone through a couple of training videos (PluralSight and the Dynamics Vidoes from Microsoft) and I cannot see what I am missing here. It should not be this hard to figure out how CRM is working here. I know and suspect my problem is how CRM uses the actual name, display name, and how it deals with folders in VS.Net that when put into CRM no longer exists. But I cannot workout a solution.
So can someone explain this to me? It cannot be all that hard.
Also, what type of VS.Net project are you using? I created a CRM 2011 Package and when I save the CSS, the contents are grey'd out. So I think that is my hint that I am doing something wrong. But once it shows up in CRM, the files are there and seem like they should work regardless of what I do in VS.Net. I have tried editing it in CRM and nothing I do works.
Below is a simple Hello World HTML and a simple stylesheet. In my VS.Net project I have a WebResources folder, a folder called Dialogs (my own HTML dialogs) then I have my HTML page in that folder. From there, I also have CSS folder (inside my dialog folder) with the Stylesheet1.css file. Below are the contents of each of those.
- /TestProject (CRM 2011 Package)
- /TestProject/WebResources/Dialog/HTMLPage1.htm
- /TestProject/WebResources/Dialog/CSS/StyleSheet1.css
Can someone show me what I am doing wrong here? I think my problem is how you setup the properties (display name, actual name, etc.) for the files or maybe the VS.Net project type is causing me trouble.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title></title><link href="CSS/StyleSheet1.css" rel="stylesheet" type="text/css" /></head><body><div class="header"> Hello CRM 2011 World!</div></body></html>
.header { font-weight: bold; }
Jon Gregory Rothlander