Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I am taking a Visual Basic.Net class and we have to build a webform. I can build the form in Visual Studio and I can see the web controls, but as soon as I try to view it in a browser, I can't see the web controls. I can only see the text, but no buttons or text boxes. The file has an aspx extension. Any ideas??

 

I am running Windows 2000 Professional as my OS. I installed IIS first and then installed Visual Studio. I have an inetpub folder and a wwwroot folder that is shared.

 

Thanks for your help!!!

Posted

Are you doing any coding, or chaning any of the control parameters?

I say that because if a control, such as a datagrid, is not correctly populated, it can just come up as blank, without an error (because syntactically there is no error) and stop the rest of the page from loading.

 

I started a new .net project c# web application on my local mahcine, then on the default web page dragged a button, calendar view and text box onto the page. Ran it and it worked... If you do these steps does it work for you?

The idea here is rather than the application being at fault, perhaps there's something dodgy in your configuration.

Posted

here is the code, it is right out of the book, and i still cannot view it with my web browser.

 

 

I get this error.

 

Server Error in '/' Application.

--------------------------------------------------------------------------------

 

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

 

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

 

Source Error:

 

 

Line 23: "Forms", "Passport" and "None"

Line 24: -->

Line 25: <authentication mode="Windows" />

Line 26:

Line 27:

 

 

Source File: c:\inetpub\wwwroot\Ch09WebHello\web.config Line: 25

 

 

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

----------------------------------------------------------------------------

**********HERE IS THE CODE*************************

 

 

'Description: Display the user name concatenated to a label.

' This is the step-by-step program for creating

' Web Forms.

 

Public Class WebForm1

Inherits System.Web.UI.Page

Protected WithEvents txtName As System.Web.UI.WebControls.TextBox

Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button

Protected WithEvents lblMessage 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()

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

 

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

'Display the name in the label

 

lblMessage.Text = "Hello " & txtName.Text

End Sub

End Class

Posted

did you just load the code off a CD and onto the hard drive through explorer? If so, you'll need to make sure it's added as a virtual directory to IIS.

 

Perhaps the best way to do this is to create a new Visual Basic Web Application with the name, Ch09WebHello.

 

From here, goto the project menu, and select "Add existing item".

 

find your files from the project you want to add, and select them all, and select add.

 

final step, to make sure your default file is the project default, right click on the file you want to be your "index" file, i.e. initial file to load when the directory is pointed at, and select "Set as Start File".

 

Now goto Debug -> Start and see if it correctly compiles and loads up your program in the web browser.

 

Good luck!

Posted

i copy the entire folder to the inetpub/wwwroot

 

and then i execute the WebForm1.aspx file

 

when i do that, i just can see the hello world text, but not the button

Posted
wow you are a genius. you are the only person who could figure this out. i have asked about 10 people about this, even the professor. it works great now. thank you so much.

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