daves1 Posted December 2, 2003 Posted December 2, 2003 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!!! Quote
dunesand Posted December 2, 2003 Posted December 2, 2003 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. Quote
daves1 Posted December 2, 2003 Author Posted December 2, 2003 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 Quote
dunesand Posted December 2, 2003 Posted December 2, 2003 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! Quote
daves1 Posted December 2, 2003 Author Posted December 2, 2003 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 Quote
dunesand Posted December 2, 2003 Posted December 2, 2003 you can't do that because it's not setup in IIS properly... follow the steps i suggested and try again. Quote
daves1 Posted December 2, 2003 Author Posted December 2, 2003 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. Quote
dunesand Posted December 2, 2003 Posted December 2, 2003 genius is pushing it... ;) professor hey, he's probably as new to .Net as you by the sounds of it. I'm sure he'd whoop me in complexity theory. ;) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.