Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I created a new ASP .NET application, dragged a label onto the form design, then went to code and put this simple line (I'm starting the first chapter of a book)

 

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
       Label1.Text = DateTime.Now
   End Sub

 

Then I hit ctrl-F8 for Build and Browse. No errors, but it simply displays the word "Label" instead of the time and date I expected.

 

I'm wondering if I missed something on the IIS configuration. I'm very familiar with running IIS and developing in classic ASP. I installed Visual Studio .NET with all the options selected, had nothing fishy happen, it was all quite smooth.

 

I have Windows 2000 professional and have IIS installed with the default settings. I used all the defaults in creating the project and experienced no errors.

 

Is there something I'm supposed to do to make .NET applications actually execute code?

Posted
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="myWebApp.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<title>WebForm1</title>
	<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
	<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
	<meta content="JavaScript" name="vs_defaultClientScript">
	<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
	<form id="Form1" method="post" runat="server">
		<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 222px; POSITION: absolute; TOP: 148px" runat="server" Width="214px" Height="16px">Label</asp:label></form>
</body>
</HTML>

  • Administrators
Posted

looks like the framework didn't register with IIS (happens from time to time)

 

what you'll need to do is the following.

Open a new command prompt

Change to the drive windows is installed in (e.g. c:\)

cd Windows\microsoft.net\framework

depending on the version of the frame work you have you will have to cd into either v1.0.3705 or v1.1.4322 - if both folders are present go for the v1.1.4322 one

 

then type aspnet_regiis /i and let it do it's stuff.

when it finishes - try to run the web app again and see what happens.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
chaduke, your sample source code is copy from your real source code in VS.NET or you copy from Browser (IE) view source property? because the first line should not appear even framework did not register with IIS right?
Posted

Plausibly -

 

Thanks much. Once I did that I was getting a few security errors, access to c:\inetpub\wwwroot was being denied, but after adding some accounts it worked correctly, the problem is I'm not sure which one did the trick. I guess I should have added them in one by one.

 

I was noticing a few new accounts. Theres one called ASPNET, one called VS Developers.

 

Theres also SQL Debugger, Debugger Users, VUSER_MACHINENAME.

 

I'm not quite sure all of them are brand new but I don't recognize them. I don't epect anyone to explain those, I can look them up today, but how about a suggestion on what the minimum access settings should be on wwwroot?

 

In other words, what accounts should have access to that folder and should it be read, write or both? In the past all I've ever had to do is work with the IUSR account, but apparently things have gotten a bit more complex with .NET

 

bungpeng -

 

I posted the source from inside VS .NET by right clicking on the web form browse tab and doing "view source".

 

Thanks for the response, much appreciated. In the meantime I started learning some C#. I think it will be interesting to see what the differences are because most places I've read suggest C# was pretty much designed for .NET

 

I'm much more familiar with VB but I've written a few things in C/C++ so I don't expect it to be too difficult to learn both. Most books and guides are giving examples in both languages side by side.

Posted

one thing I just remembered.

 

I added in IIS to my machine AFTER installing VS.NET. It wasn't until I started working on my first example that I realized it wasn't installed.

 

Could that have caused the problem? If so I'll make sure to have IIS going before installing VS .NET on other machines.

 

Ideally, I'd like to connect to and work on my projects directly on the webserver. I'm hoping there's some way to do this remotely like thru FTP, but I haven't gotten to that part of the book yet ;)

  • Administrators
Posted

That would have been the problem - if IIS is installed then it integrates as part of the VS installation, if it isn't the n you need to do the fix I posted above.

 

As to working remotely if the server has .NET framework and Frontpage extensions installed then when you create a new project you can enter a url of http://remote server/websitename and it should work.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...