Quantcast
Viewing all articles
Browse latest Browse all 3509

Running Visual Basic code in a Web Form

A really simple question that needs only a simple answer, folks.

I am trying to run a simple VB code in a Web Form, but when Visual Basic build the webpage, I only get the code displayed as text.

This is the only code in the default.aspx file:

@Code  
    Dim greeting = "Welcome to our site!" 
    Dim weekDay = DateTime.Now.DayOfWeek 
    Dim greetingMessage = greeting & " Today is: " & weekDay.ToString() 
End Code  
<p>The greeting is: @greetingMessage</p>

 

 

 


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>