MarcGraff
asked on
import html file
Good Morning Experts,
Using the code behind, how would I import an html file into a aspx page on_load?
Thanks!
- Marc
Using the code behind, how would I import an html file into a aspx page on_load?
Thanks!
- Marc
ASKER
Good Afternoon strickdd,
We have different menus depending on the user. the menus are done in html because they are used in multiple languages. The reason I need this in the codebehind is so I can pull the correct menu for the correct user.
- Marc
We have different menus depending on the user. the menus are done in html because they are used in multiple languages. The reason I need this in the codebehind is so I can pull the correct menu for the correct user.
- Marc
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I wouldn't recommend using a Literal control instead of the <%=Menu_HTML%>. It is the more ".Net way" of doing things. All you have to do is set the literalObj.Text = HTMLText.
To get the HTML text just use a streamreader on whatever file you have it saved as.
To get the HTML text just use a streamreader on whatever file you have it saved as.
Another option, which is probably even better would be to use a masterpage with the different menus in it. Have the menues be in panels and then you can set the visibility to true or false depending on the user type.
Another way is to display HTML page in the label control
https://www.experts-exchange.com/questions/21780226/how-can-I-write-or-include-an-aspx-page-to-an-ASP-label-on-my-page-dynamically.html
https://www.experts-exchange.com/questions/21780226/how-can-I-write-or-include-an-aspx-page-to-an-ASP-label-on-my-page-dynamically.html
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks so much! I have it up are running perfectly!
<!-- #include virtual="/somefile.html" -->
But if you need to include it in the code behind, you can use a streamreader.