<% %> Render Blocks

Author Message
satishbeh

  • Total Posts : 6
  • Scores: 0
  • Reward points : 0
  • Joined: 7/31/2005
  • Status: offline
<% %> Render Blocks Sunday, July 31, 2005 5:11 AM (permalink)
0
I am using WinXp. I have installed IIS and am trying to use ASP. When I write some code using HTML the results appear on the browser.
When I use any commands using render blocks i.e. <% %> nothing is dispalyed.
For example  when I enter the following:
<html>
<body>
The date is now <%= Now() %> .
</body>
</html>
 
The output is :
The date is now .
 
The date is not dispalyed. Can any one tell what the problem is.
 
Regards,
Satish
 
#1
    Snipah

    • Total Posts : 1339
    • Scores: 8
    • Reward points : 0
    • Joined: 11/1/2004
    • Location: Scotland
    • Status: offline
    RE: &lt;% %&gt; Render Blocks Sunday, July 31, 2005 7:09 AM (permalink)
    0
    Hiya Satishbeh.

    Are you saving your file as .ASP? Do you have your file under wwwroot? (or manually linked through Computer Managment (IIS))?

    Snipah
     
    PS my output is: The date is now 31-7-2005 20:10:39 .
     
    the file location i call is: http://localhost:8080/asp/date.asp
    For more information, please see the "Read me First" topic.

    http://www.visualbasicscript.com
     
    #2
      satishbeh

      • Total Posts : 6
      • Scores: 0
      • Reward points : 0
      • Joined: 7/31/2005
      • Status: offline
      RE: &lt;% %&gt; Render Blocks Monday, August 01, 2005 3:39 AM (permalink)
      0
      The file is saved as .aspx and it is under wwwroot.
      Any text written out of the <% %> block is displayed.
      i.e. The date is <%= now() %>

      output : The date is

      The actual date is not displayed.  Has it something to do with the browser. My browser is IE 6.0
      I your reply you have entered 8080. What does that stand for ?
       
       
      #3
        Snipah

        • Total Posts : 1339
        • Scores: 8
        • Reward points : 0
        • Joined: 11/1/2004
        • Location: Scotland
        • Status: offline
        RE: &lt;% %&gt; Render Blocks Monday, August 01, 2005 8:02 AM (permalink)
        0
        8080 is the port where my localhost is on, to use IIS on (Skype is hogging 80, so i had to change it)
         
        what is the full path what you open in your browser??? Try to rename it to .ASP and try it then....
        For more information, please see the "Read me First" topic.

        http://www.visualbasicscript.com
         
        #4
          satishbeh

          • Total Posts : 6
          • Scores: 0
          • Reward points : 0
          • Joined: 7/31/2005
          • Status: offline
          RE: &lt;% %&gt; Render Blocks Tuesday, August 02, 2005 6:11 AM (permalink)
          0
          When I renamed the file to .asp it works.
          Can you tell me what is the different between .asp and .aspx?
          When should either be used?
           
          #5
            Country73

            • Total Posts : 754
            • Scores: 10
            • Reward points : 0
            • Status: offline
            RE: &lt;% %&gt; Render Blocks Tuesday, August 02, 2005 8:08 AM (permalink)
            0
            The only thing I was able to find is that ASP.NET is referred to as ASPX.
            Here's a link that describes it a little more in detail.
             
            http://aerohost.com/aspx-net.htm
             
            #6
              satishbeh

              • Total Posts : 6
              • Scores: 0
              • Reward points : 0
              • Joined: 7/31/2005
              • Status: offline
              RE: &lt;% %&gt; Render Blocks Thursday, August 04, 2005 4:18 AM (permalink)
              0
              Does that mean that Asp.net does not support <% %> render blocks.  Can you try using the same in a file by name .aspx and let me know the results.
               
              #7
                Country73

                • Total Posts : 754
                • Scores: 10
                • Reward points : 0
                • Status: offline
                RE: &lt;% %&gt; Render Blocks Thursday, August 04, 2005 7:23 AM (permalink)
                0
                I haven't had a chance to check that out, not sure if I'll be able to get to it anytime soon, but I did come across another site that may be able to assist you a little more on this.
                 
                http://samples.gotdotnet.com/quickstart/aspplus/
                 
                 
                #8
                  Zifter

                  • Total Posts : 315
                  • Scores: 0
                  • Reward points : 0
                  • Joined: 1/5/2005
                  • Location: Belgium
                  • Status: offline
                  RE: &lt;% %&gt; Render Blocks Wednesday, September 28, 2005 2:50 AM (permalink)
                  0
                  Those <% %> blocks are no longer used in ASP.NET (althoug I think you still can use them)
                  In ASP.NET you are supposed to put all your code into pages so called "code behind". These pages reside on the server side, thus you no longer need those <% %> blocks. The "code behind" pages can be written in VB.NET  or C# or ... Providing a way to make your front end in HTML (ASP.NET) and your code in the language you prefer.
                   
                  I can't go into much detail about the differences between ASP and ASP.NET (both because I don't know enough about it and because it would be blogging in stead of posting on a forum), but there are lots of webpages convering this issue. Just do some googling.
                   
                  #9
                    venyaga

                    • Total Posts : 2
                    • Scores: 0
                    • Reward points : 0
                    • Joined: 2/16/2006
                    • Status: offline
                    RE: &lt;% %&gt; Render Blocks Thursday, February 16, 2006 3:49 AM (permalink)
                    0
                    Hi, I'm New Right Here
                     
                    But I know how fix your problem,
                     
                    try this --> <% response.write(now.tostring())%>
                     
                    Good Luck
                     
                    Venyaga

                     
                    #10
                      tt77v1

                      • Total Posts : 3
                      • Scores: 0
                      • Reward points : 0
                      • Joined: 4/13/2006
                      • Status: offline
                      RE: &lt;% %&gt; Render Blocks Thursday, April 13, 2006 9:06 PM (permalink)
                      0
                      yes
                      i think it is correct

                       
                      #11
                        Rischip

                        • Total Posts : 519
                        • Scores: 2
                        • Reward points : 0
                        • Joined: 3/26/2007
                        • Status: offline
                        RE: &lt;% %&gt; Render Blocks Wednesday, July 11, 2007 3:46 PM (permalink)
                        0
                        You must create the "application" in IIS for it to render .aspx pages

                        [image]local://13998/BB04411BDB4840E6A79E246970402F80.gif[/image]
                        <message edited by Rischip on Wednesday, July 11, 2007 3:49 PM>
                        Attachment(s)Attachments are not available: Download requirements not met
                         
                        #12

                          Online Bookmarks Sharing: Share/Bookmark

                          Jump to:

                          Current active users

                          There are 0 members and 1 guests.

                          Icon Legend and Permission

                          • New Messages
                          • No New Messages
                          • Hot Topic w/ New Messages
                          • Hot Topic w/o New Messages
                          • Locked w/ New Messages
                          • Locked w/o New Messages
                          • Read Message
                          • Post New Thread
                          • Reply to message
                          • Post New Poll
                          • Submit Vote
                          • Post reward post
                          • Delete my own posts
                          • Delete my own threads
                          • Rate post

                          2000-2012 ASPPlayground.NET Forum Version 3.9