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
Replacing Keyboard on Toshiba Portege A600
How do I assign a preview image to the TSavePictureDialog
Sysprep failed to set computername
How to declare the document I'm working in
extending jQuery autocomplete plugin functionality
how the BIOS read (load) the first 512 bytes of a bootable hard disk
Google Maps , ahhhh help pls!
VB6 - crytl32.ocx - Windows 7 Ultimate 64bits: Cannot load !
Can I use the SendKeys command in Excel VBA to interact with other applications other that Microsoft Office?
Blackberry browser 400 error - socketexception Connection reset