My ASP.Net files dont work

A

Aparna

I have windows xp professional as my OS , IIS 5.5 installed
Now when later I installed ASP.NET then my aspx.net files dont work.In
the sense only HTML part is displayed but vb script(dot net) part does
not get displayed.
For Example

following is the timedisplay.aspx code
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="TimeDisplay.aspx.vb" Inherits="Diary.TimeDisplay"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>TimeDisplay</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Label id="displayLabel" style="Z-INDEX: 100; LEFT: 26px;
POSITION: absolute; TOP: 70px" runat="server" Width="273px">A Simple
Web Form Example</asp:Label>
<asp:Label id="timeLabel" style="Z-INDEX: 102; LEFT: 27px;
POSITION: absolute; TOP: 172px" runat="server"
Width="176px"></asp:Label>&nbsp;
</form>
</body>
</HTML>

The code behind file i.e. Timedisplay.aspx.vb for above aspx file is

Public Class TimeDisplay
Inherits System.Web.UI.Page
Protected WithEvents displayLabel As
System.Web.UI.WebControls.Label
Protected WithEvents timeLabel As System.Web.UI.WebControls.Label

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()
timeLabel.Text =
String.Format("{0:D2}:{1:D2}{2:D2}",DateTime.Now.Hour,
DateTime.Now.Minute, DateTime.Now.Second)
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

End Class

the output in the browser is
A Simple Web Form Example

Where as the expected output shud be
A Simple Web Form Example
10.23.14

that is both text and time.
Only text that is HTML part is displayed but time that is vb.net part
is not displayed..


I have tried a number of examples, but in all only HTML part works
like the one above.
Please give possible solutions to this problem.I cant proceed just
because of this
 
G

Germano

This usually happens when you install IIS after the .NET framework. Try
removing the framework and IIS, then install IIS followed by the framework.
 
M

Mike Smith

No NO dont remove it.. theres a more simple/faster option...

Just reinstall the asp.net thru the
followin command line

C:\> <windows dir>\Microsoft.Net\framework\<version
folder>\aspnet_regiis -i

do that in the dos prompt and see if that helps...
In your IIS settings, right click Default Web Site and go to properties,
Select Home Directory and click on the configuration button, verify that the
new extensions are registered (i.e aspx and other ...x are listed)

Its real odd.. ive seen this happen on machines that had IIS BEFORE .NET WAS
INSTALLED.. i noticed that it was mainly VS.NET 2002 running on XP Pros.
 
A

Aparna

I have compiled and also my IIs is running.What I expect is that the
output for my server side code shud be there in my web pages.In the
example which I posted the output shud be
This is a simple web example
12.32.48

that is display of text and time.
But time is not getting displayed as it involves server side sript.
Moreover in my virtual default web site the proprty sheet's documents
tab displays only .asp files and .htm files but no .aspx files.
So if there is any setting problem then please tell me.
I dont know how to go about it.I want my .net programs to work on my
PC.
 
A

Aparna

I reinstalled dot net.
In My IIs settings , when I right click Default Web Site and go to
properties,
Select Home Directory and click on the configuration button, then I
find only .asp,.asa extensions but not .aspx and other ...x extensions
How do I change the configuration of my IIS settings.
Please help as still my dot net programs are not working.
 
P

Paul C

Yes, just run the command line stuff. I had this problem once, and this
command fixes it.
 
A

Arun

Run aspnet_regiis -i, which is available as part of the .NET framework
tools. It should fix the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top