Microsoft
Software
Hardware
Network
Question : ASP.net 3.5 Using VB.net function to generate HTLM code on aspx page
I would like to use a VB.net function to generate html code on an aspx page. In the past I have used a vbscript function to generate asp code in classic asp. I like this approach because it allows me to generate standard blocks of code based on parameters, e.g. Page Headers. This was easy in classic asp but seems to be hard in asp.net.
Here's what I have done. Unfortunately it does not work.
1. I created a VBnet function in a Class to generate Page Headers. It creates a string with all my HTML code. THe HTML code was copied from an existing aspx page and so I know the HTML code is correct. It includes one parameter for the title of the page that should be displayed.
2. On the pages page_load event, I set the function to a public string.
3. On the aspx page, I attempt to display the page header using
<% =strPageHeader %>
RESULTS
THe only thing that is displayed is the Page Title that is passed as a parameter.
WHen I try to view the htlm using view source, all the html is there and it looks correct.
I have searched many sites for a resolution to this issue and have not found anything. This leads me to believe that this may not be the best way to do this in asp.net.
Any suggestions to get my approach working or a better approach would be greatly appreciates.
Answer : ASP.net 3.5 Using VB.net function to generate HTLM code on aspx page
select concat(year(YourDate), '-',Month(YourDate)) from table
Random Solutions
Windows Service crashing on one machine, not on the other
Wireless LAN , Larger Scale
how to enable java in ipad sfari
Whats wrong with my css?
Perl script taking too long
interactive services detection stopped working
Reading data off Raid 0
Workstation Primary Group ID set as Domain Controller
Additional domain controller
Converting Hexadecimal to RGB