Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've used ASP before, but not ASP.NET, so this morning I tryed to see what I could whip up with this new product. My results have been disappointing. I'm sorry if this has been asked before, but I can't see a ASP.NET faq around here anywhere...

 

Anyway, first I went to http://www.ASP.NET, seemed like the logical place to go, except they seem intent on ruining ASP.NET by putting all the server side script in the HTML, instead of using the aspx.vb file. So I've created a simple .NET dll that contains a class that contains a simple property that returns "Hello World" (cheesy I know). I've created a new ASP.NET project. Copied the Dll into the /BIN folder. Added a label and a textbox to the aspx file, and added this code to the page_load event:

 

   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
       Dim objCustomer As CustomerDll.clsCustomer

       objCustomer = New CustomerDll.clsCustomer()

       txtName.Text = objCustomer.Name

   End Sub

 

and heres the code for the Class (which you probably don't know, but just in case:

 

Public Class clsCustomer

   Private strName As String

   Public Property Name() As String
       Get
           Name = strName
       End Get
       Set(ByVal Value As String)
           strName = Value
       End Set
   End Property

   Public Sub New()
       strName = "Hello World!"
   End Sub
End Class

 

And heres an attachment of what I see: But What do I see? I see the Name label, no textbox, no Hello World, my heading is in a weird place and theres no styles applied to what I see. Whats up? What did I forget?

 

PS: I've also added to the screenshot to show what the design view of my ASP page looks like:

 

thanks

 

Sam

Posted

this is what I see, looks like ASP to me:

 

<%@ Import Namespace="CustomerDll.clsCustomer" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="Test.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<title>Test ASP.NET Document</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">
	<style>DIV {
BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: black 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; FONT: 8pt verdana; BORDER-LEFT: black 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #cccccc
}
	</style>
</HEAD>
<body text="black" MS_POSITIONING="GridLayout">
	<form id="Form1" method="post" runat="server">
		<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 215px; POSITION: absolute; TOP: 72px" runat="server" Width="108px" Height="9px" Font-Names="Verdana" Font-Size="Medium">Name:</asp:label><asp:textbox id="txtName" style="Z-INDEX: 102; LEFT: 331px; POSITION: absolute; TOP: 68px" runat="server" Width="205px" Height="27px" Font-Names="Verdana" Font-Size="Medium"></asp:textbox>
		<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 217px; POSITION: absolute; TOP: 19px" runat="server" Width="299px" Height="29px" Font-Names="Verdana" Font-Size="Medium">Heading!!!</asp:Label></form>
</body>
</HTML>

  • Administrators
Posted

Looks like the server doesn't have the framework installed (or it isn't registered properly)

 

If you look on the webserver is there a folder

 

\Microsoft.NET\Framework\

?

 

if so run the aspnet_regiis.exe /I utility from that folder - if not you will need to install the framework on the server.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
The problem is you need to install Internet Information Services before you install .Net. Try uninstalling .Net and IIS then adding IIS first. If you understand what i mean.

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...