Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


<% %> Render Blocks

 
Logged in as: Guest
arrSession:exec spGetSession 2,4,24351
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP.NET >> <% %> Render Blocks
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 <% %> Render Blocks - 7/31/2005 4:11:48 AM   
  satishbeh

 

Posts: 5
Score: 0
Joined: 7/31/2005
Status: offline
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
 
 
Post #: 1
 
 RE: <% %> Render Blocks - 7/31/2005 6:09:10 AM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
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

(in reply to satishbeh)
 
 
Post #: 2
 
 RE: <% %> Render Blocks - 8/1/2005 2:39:55 AM   
  satishbeh

 

Posts: 5
Score: 0
Joined: 7/31/2005
Status: offline
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 ?

(in reply to Snipah)
 
 
Post #: 3
 
 RE: <% %> Render Blocks - 8/1/2005 7:02:48 AM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
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

(in reply to satishbeh)
 
 
Post #: 4
 
 RE: <% %> Render Blocks - 8/2/2005 5:11:43 AM   
  satishbeh

 

Posts: 5
Score: 0
Joined: 7/31/2005
Status: offline
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?

(in reply to Snipah)
 
 
Post #: 5
 
 RE: <% %> Render Blocks - 8/2/2005 7:08:25 AM   
  Country73


Posts: 709
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
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

(in reply to satishbeh)
 
 
Post #: 6
 
 RE: <% %> Render Blocks - 8/4/2005 3:18:44 AM   
  satishbeh

 

Posts: 5
Score: 0
Joined: 7/31/2005
Status: offline
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.

(in reply to Country73)
 
 
Post #: 7
 
 RE: <% %> Render Blocks - 8/4/2005 6:23:06 AM   
  Country73


Posts: 709
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
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/

(in reply to satishbeh)
 
 
Post #: 8
 
 RE: <% %> Render Blocks - 9/28/2005 1:50:34 AM   
  Zifter


Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
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.

(in reply to satishbeh)
 
 
Post #: 9
 
 RE: <% %> Render Blocks - 2/16/2006 2:49:01 AM   
  venyaga

 

Posts: 2
Score: 0
Joined: 2/16/2006
Status: offline
Hi, I'm New Right Here

But I know how fix your problem,

try this --> <% response.write(now.tostring())%>

Good Luck

Venyaga

(in reply to satishbeh)
 
 
Post #: 10
 
 RE: <% %> Render Blocks - 4/13/2006 8:06:22 PM   
  tt77v1


Posts: 3
Score: 0
Joined: 4/13/2006
Status: offline
yes
i think it is correct

(in reply to venyaga)
 
 
Post #: 11
 
 RE: <% %> Render Blocks - 7/11/2007 2:46:52 PM   
  Rischip


Posts: 346
Score: 2
Joined: 3/26/2007
Status: offline
You must create the "application" in IIS for it to render .aspx pages


Thumbnail Image


Attachment (1)

< Message edited by Rischip -- 7/11/2007 2:49:00 PM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to tt77v1)
 
 
Post #: 12
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP.NET >> <% %> Render Blocks Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts