head and body variables

Discussion in 'C#' started by dolin88, Jul 27, 2008.

  1. #1
    Hi i place this code between my head tags <% int x = 2; %>
    then i put this in the body tags <%= x %>. It gets error. This is frustrating. If i put those two codes between the body tags. It works. What is wrong with asp.net? In php i can place all my codes whereever i want on the page and it works.
     
    dolin88, Jul 27, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    That is very strange; in ASP it doesn't matter where you put the tags. What exactly is the error you are getting?
     
    itcn, Jul 28, 2008 IP