-1

I am opening a modal window using

<a href="@Url.Action("SearchModal", "Myctrler",new { id =itemVal })"
                                   onclick="window.open('@Url.Action("SearchModal", "Myctrler",new { id = itemVal })',
                      'newwindow',
                      'width=300,height=250');
                                                        return false;">

In the My contoller i am returning Searchview using

public ActionResult SearchModal(string id)
        {
            ModalData msd = repository.getData(id);
            return View(msd);
        }

But none of the css is reflecting from sitecore in the view .Can anyone pls suggest?

0
1

The way you have the code setup, you are bypassing Sitecore and just rendering an MVC View using @Url.Action in a new window. If you want to take that approach, you would need to add a reference to the stylesheet in your view.

A better approach would be to build a JavaScript based modal that would then have the markup inline and pick up the styles of the site. Have a look at existing modals like the Bootstrap Modal that works in this way.

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