Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Browser Doesn't Display Server Side Data


Message #1 by Josephine Rong <josephiner@i...> on Tue, 5 Feb 2002 14:03:23 +1100
Hi



I've successfully installed Visual Studio .net Beta 2 on my PC. IIS works

fine for traditional .asp pages. But when I followed the ASP.NET Test

Exapmle on chapter on of "Beginning ASP.NET using C#", the browser displays

the message but not the time which ran on server. When I right clicked the

mouse button and chose "View Source", the source displayed what I exactly

typed from the development environment as in the following:



<HTML>

	<HEAD>

		<title>The Test Web Server</title><script language="C#"

runat="server">

	void Page_Load() {

		time.Text = DateTime.Now.Hour.ToString() + ":" + 

					DateTime.Now.Minute.ToString() + ":"

+

					DateTime.Now.Second.ToString();

	}

		</script>

	</HEAD>

	<body>

		<h1>

			Welcome

		</h1>

		In WebServerLand the time is currently:

		<asp:Label ID="time" Runat="server" />

	</body>

</HTML>



Could anyone give me hints on how to fix this problem? Thanks in advance.



Regards

Josephine



Message #2 by "Graham Dobson" <grahamdo@a...> on Mon, 4 Feb 2002 22:20:38 -0500
Did you save the file with an *.aspx extension.  If the code displayed it

means it wasn't executed on the server.  You have to store your file in a

virtual directory and have scripts enabled.

----- Original Message -----

From: "Josephine Rong" <josephiner@i...>

To: "aspx_beginners" <aspx_beginners@p...>

Sent: Monday, February 04, 2002 10:03 PM

Subject: [aspx_beginners] Browser Doesn't Display Server Side Data





> Hi

>

> I've successfully installed Visual Studio .net Beta 2 on my PC. IIS works

> fine for traditional .asp pages. But when I followed the ASP.NET Test

> Exapmle on chapter on of "Beginning ASP.NET using C#", the browser

displays

> the message but not the time which ran on server. When I right clicked the

> mouse button and chose "View Source", the source displayed what I exactly

> typed from the development environment as in the following:

>

> <HTML>

> <HEAD>

> <title>The Test Web Server</title><script language="C#"

> runat="server">

> void Page_Load() {

> time.Text = DateTime.Now.Hour.ToString() + ":" +

> DateTime.Now.Minute.ToString() + ":"

> +

> DateTime.Now.Second.ToString();

> }

> </script>

> </HEAD>

> <body>

> <h1>

> Welcome

> </h1>

> In WebServerLand the time is currently:

> <asp:Label ID="time" Runat="server" />

> </body>

> </HTML>

>

> Could anyone give me hints on how to fix this problem? Thanks in advance.

>

> Regards

> Josephine

>

>




$subst('Email.Unsub').

>



Message #3 by josephiner@i... on Tue, 5 Feb 2002 03:54:03
> Did you save the file with an *.aspx extension.  If the code displayed it

> means it wasn't executed on the server.  You have to store your file in a

> virtual directory and have scripts enabled.

> ----- Original Message -----

> From: "Josephine Rong" <josephiner@i...>

> To: "aspx_beginners" <aspx_beginners@p...>

> Sent: Monday, February 04, 2002 10:03 PM

> Subject: [aspx_beginners] Browser Doesn't Display Server Side Data

> 

> 

> > Hi

> >

> > I've successfully installed Visual Studio .net Beta 2 on my PC. IIS 

works

> > fine for traditional .asp pages. But when I followed the ASP.NET Test

> > Exapmle on chapter on of "Beginning ASP.NET using C#", the browser

> displays

> > the message but not the time which ran on server. When I right clicked 

the

> > mouse button and chose "View Source", the source displayed what I 

exactly

> > typed from the development environment as in the following:

> >

> > <HTML>

> > <HEAD>

> > <title>The Test Web Server</title><script language="C#"

> > runat="server">

> > void Page_Load() {

> > time.Text = DateTime.Now.Hour.ToString() + ":" +

> > DateTime.Now.Minute.ToString() + ":"

> > +

> > DateTime.Now.Second.ToString();

> > }

> > </script>

> > </HEAD>

> > <body>

> > <h1>

> > Welcome

> > </h1>

> > In WebServerLand the time is currently:

> > <asp:Label ID="time" Runat="server" />

> > </body>

> > </HTML>

> >

> > Could anyone give me hints on how to fix this problem? Thanks in 

advance.

> >

> > Regards

> > Josephine

> >

> >




> $subst('Email.Unsub').

> >

> 

I've saved this code to a file with .aspx extension in both physical and 

virtual directory. I've also assigned permissions to the virtual 

directory. I'm currently running IE6. I can view the message on the 

browser but not the time. Any ideas?



Thanks

Josephine
Message #4 by "McCloy, Russell" <Russell.McCloy@B...> on Tue, 5 Feb 2002 16:40:10 +1100
Are you using a Win2000 or XP machine? It doesn't work on NT!



RuSs



-----Original Message-----

From: Graham Dobson [mailto:grahamdo@a...]

Sent: Tuesday, 5 February 2002 2:21 PM

To: aspx_beginners

Subject: [aspx_beginners] Re: Browser Doesn't Display Server Side Data





Did you save the file with an *.aspx extension.  If the code displayed it

means it wasn't executed on the server.  You have to store your file in a

virtual directory and have scripts enabled.

----- Original Message -----

From: "Josephine Rong" <josephiner@i...>

To: "aspx_beginners" <aspx_beginners@p...>

Sent: Monday, February 04, 2002 10:03 PM

Subject: [aspx_beginners] Browser Doesn't Display Server Side Data





> Hi

>

> I've successfully installed Visual Studio .net Beta 2 on my PC. IIS works

> fine for traditional .asp pages. But when I followed the ASP.NET Test

> Exapmle on chapter on of "Beginning ASP.NET using C#", the browser

displays

> the message but not the time which ran on server. When I right clicked the

> mouse button and chose "View Source", the source displayed what I exactly

> typed from the development environment as in the following:

>

> <HTML>

> <HEAD>

> <title>The Test Web Server</title><script language="C#"

> runat="server">

> void Page_Load() {

> time.Text = DateTime.Now.Hour.ToString() + ":" +

> DateTime.Now.Minute.ToString() + ":"

> +

> DateTime.Now.Second.ToString();

> }

> </script>

> </HEAD>

> <body>

> <h1>

> Welcome

> </h1>

> In WebServerLand the time is currently:

> <asp:Label ID="time" Runat="server" />

> </body>

> </HTML>

>

> Could anyone give me hints on how to fix this problem? Thanks in advance.

>

> Regards

> Josephine

>

>




$subst('Email.Unsub').

>








$subst('Email.Unsub').



Message #5 by Elissa Setarehshenas <elissasetareh@y...> on Tue, 5 Feb 2002 05:54:10 -0800 (PST)
There is a problem with the way your page_load

function. Try this.



protected void Page_Load(Object sender, EventArgs e)



You should always have these two arguments in your

Page_Load. 



Elissa Setareh

--- josephiner@i... wrote:

> > Did you save the file with an *.aspx extension. 

> If the code displayed it

> > means it wasn't executed on the server.  You have

> to store your file in a

> > virtual directory and have scripts enabled.

> > ----- Original Message -----

> > From: "Josephine Rong" <josephiner@i...>

> > To: "aspx_beginners" <aspx_beginners@p...>

> > Sent: Monday, February 04, 2002 10:03 PM

> > Subject: [aspx_beginners] Browser Doesn't Display

> Server Side Data

> > 

> > 

> > > Hi

> > >

> > > I've successfully installed Visual Studio .net

> Beta 2 on my PC. IIS 

> works

> > > fine for traditional .asp pages. But when I

> followed the ASP.NET Test

> > > Exapmle on chapter on of "Beginning ASP.NET

> using C#", the browser

> > displays

> > > the message but not the time which ran on

> server. When I right clicked 

> the

> > > mouse button and chose "View Source", the source

> displayed what I 

> exactly

> > > typed from the development environment as in the

> following:

> > >

> > > <HTML>

> > > <HEAD>

> > > <title>The Test Web Server</title><script

> language="C#"

> > > runat="server">

> > > void Page_Load() {

> > > time.Text = DateTime.Now.Hour.ToString() + ":" +

> > > DateTime.Now.Minute.ToString() + ":"

> > > +

> > > DateTime.Now.Second.ToString();

> > > }

> > > </script>

> > > </HEAD>

> > > <body>

> > > <h1>

> > > Welcome

> > > </h1>

> > > In WebServerLand the time is currently:

> > > <asp:Label ID="time" Runat="server" />

> > > </body>

> > > </HTML>

> > >

> > > Could anyone give me hints on how to fix this

> problem? Thanks in 

> advance.

> > >

> > > Regards

> > > Josephine

> > >

> > >





> > $subst('Email.Unsub').

> > >

> > 

> I've saved this code to a file with .aspx extension

> in both physical and 

> virtual directory. I've also assigned permissions to

> the virtual 

> directory. I'm currently running IE6. I can view the

> message on the 

> browser but not the time. Any ideas?

> 

> Thanks

> Josephine





$subst('Email.Unsub').





__________________________________________________

Do You Yahoo!?

Send FREE Valentine eCards with Yahoo! Greetings!

http://greetings.yahoo.com

Message #6 by "Gerry Crowe" <gerry@g...> on Tue, 5 Feb 2002 19:03:32 -0000
> I've successfully installed Visual Studio .net Beta 2 on my PC. IIS works

> fine for traditional .asp pages. But when I followed the ASP.NET Test

> Exapmle on chapter on of "Beginning ASP.NET using C#", the browser

displays

> the message but not the time which ran on server. When I right clicked the

> mouse button and chose "View Source", the source displayed what I exactly

> typed from the development environment as in the following:



Just for confirmation, I cut & paste your code directly into a file and ran

it, and the time appeared just fine...so the problem is with your setup, not

your code.



Just thought it might help to have that confirmed...<shrug>



Gerry



Message #7 by josephiner@i... on Wed, 6 Feb 2002 01:51:59
I believe it is the setup problem. I've tried to run a few sample code 

that I downloaded from this web site. I have the same problem too.



When I run the Server Setup and follow through the instruction, I had no 

problem found and installation is successful. The operating system I'm 

running is Windows 2000 and service pack sp2.



Regards

Josephine



> > I've successfully installed Visual Studio .net Beta 2 on my PC. IIS 

works

> > fine for traditional .asp pages. But when I followed the ASP.NET Test

> > Exapmle on chapter on of "Beginning ASP.NET using C#", the browser

> displays

> > the message but not the time which ran on server. When I right clicked 

the

> > mouse button and chose "View Source", the source displayed what I 

exactly

> > typed from the development environment as in the following:

> 

> Just for confirmation, I cut & paste your code directly into a file and 

ran

> it, and the time appeared just fine...so the problem is with your setup, 

not

> your code.

> 

> Just thought it might help to have that confirmed...<shrug>

> 

> Gerry

> 

Message #8 by josephiner@i... on Thu, 7 Feb 2002 01:10:26
Thanks everyone. I've uninstall VS.NET and run the setup from scratch. 

This time it works.



Josephine



> I believe it is the setup problem. I've tried to run a few sample code 

> that I downloaded from this web site. I have the same problem too.

> 

> When I run the Server Setup and follow through the instruction, I had no 

> problem found and installation is successful. The operating system I'm 

> running is Windows 2000 and service pack sp2.

> 

> Regards

> Josephine

> 

> > > I've successfully installed Visual Studio .net Beta 2 on my PC. IIS 

> works

> > > fine for traditional .asp pages. But when I followed the ASP.NET Test

> > > Exapmle on chapter on of "Beginning ASP.NET using C#", the browser

> > displays

> > > the message but not the time which ran on server. When I right 

clicked 

> the

> > > mouse button and chose "View Source", the source displayed what I 

> exactly

> > > typed from the development environment as in the following:

> > 

> > Just for confirmation, I cut & paste your code directly into a file 

and 

> ran

> > it, and the time appeared just fine...so the problem is with your 

setup, 

> not

> > your code.

> > 

> > Just thought it might help to have that confirmed...<shrug>

> > 

> > Gerry

> > 


  Return to Index