0

I have some training modules which I want to load from my MVC site (SSL). I am trying run them as following but it does not load their css and images. Also I am not sure if it will let me to move to other html pages with in the same module by clicking the links on index.html.

Can anyone please suggest me a batter way of doing?

public ActionResult DisplayModule(string path)
{
    return new FilePathResult(path, "text/html");
}

Thanks in Advance.

2
  • 1
    Where are the css and images and how are included? Commented Apr 24, 2015 at 11:47
  • css and images are in folders. Each e-learning module is a separate folder (html project) which contains its own style and images. Commented Apr 24, 2015 at 12:25

1 Answer 1

1

If CSS and Images are all under one HTML package, I don't think you will get that sort of flexibility with FilePathResult. Also with that you will struggle to get links working because if you click on links they will be relative.

I think if you add your e-learning modules as virtual directory to your web application in IIS, and then redirect directly, that will sort your purpose.

<a href="\myVirtualDirectory\<%:model.Path %>">my Course</a>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.