I have a link which opens my visual webpart inside Modal Dialog. I need to change the background color of Modal Dialog content area..dont want to make change in my custom css which is overiding corev4.css ..just want to make a change for a specific modal dialog.


Apply this css..

.ms-dialog body #s4-workspace {



You could write out the CSS as part of your web part if that's the only place that web part is shown. Unfortunately, you can't reliably target CSS for a child frame, so you can't include that background color as part of the link (and have it work across all browsers).

You could also add a user control to the masterpage that checks for a query string. If that query string is set, override the background color. That's likely a bit overkill for what you want (if it's a one off scenario), but that would allow you to assign the background color through the URL to the dialog source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.