dexter
dexter

Reputation: 1207

how to render a .htm page into .aspx page

i have aspx page which has to render .htm page how can it be done

if possible then i want added feature that is i want to call a JavaScript after that .htm page is rendered

pls help

Upvotes: 0

Views: 284

Answers (1)

eglasius
eglasius

Reputation: 36035

If you were to just serve the original file, you could:

Response.Clear();
Response.WriteFile(localPathToHtmFile);

As you instead want to modify it, and assuming you need to stick to the full file, then you'd have to do some light parsing of it to add the script you want ran when the page is loaded in the browser. Instead of using WriteFile, you'd write the modified string to the response.

Another option, if you can have that file only include the html inside the body, is to load it in a literal control. Then you have the regular options to send / have the intended script to be ran at page load.

Upvotes: 1

Related Questions