•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,151 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,143 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 3569 | Replies: 2
![]() |
| |
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 0
My first attempt at ASP.NET...
I would like to convert my current website to .NET as a way to get the feel for the new environment. In my current website, I have code which checks a database to find out which menus to display and then loads them accordantly. I have tried to make this happen in ASP.NET with no success. Could some one please help?
What I would like to have help with is simple. I would like to have an ASP form which only says "Hello World", but the entire HTML page is generated in the WebForm1.aspx.vb Page_Load event. I thought this would be a rather easy process, but I have yet to have the ASP.NET call the Page_Load event. Is there something special which must be done?
Any help would be appreciated, and thanks in advance.
- Eric
I would like to convert my current website to .NET as a way to get the feel for the new environment. In my current website, I have code which checks a database to find out which menus to display and then loads them accordantly. I have tried to make this happen in ASP.NET with no success. Could some one please help?
What I would like to have help with is simple. I would like to have an ASP form which only says "Hello World", but the entire HTML page is generated in the WebForm1.aspx.vb Page_Load event. I thought this would be a rather easy process, but I have yet to have the ASP.NET call the Page_Load event. Is there something special which must be done?
Any help would be appreciated, and thanks in advance.
- Eric
•
•
Join Date: Jul 2003
Location: Bamberg, Germany
Posts: 117
Reputation:
Rep Power: 6
Solved Threads: 2
Ok, well I'm assuming you know you're running your scripts on a .NET enabled server. Also, I'm assuming you're using your WebForm1.aspx.vb as your code behind page (which is loaded at the top of the *.aspx page. If this isn't the case, take off the .vb
I.e. don't type in a URL like http://www.somesite.com/someDir/somePage.aspx.vb it shouldn't have the .vb
As for the page load, there should be a method in your aspx file that's something like (forgive me if it's wrong because I don't have my docs to look at right now)
That's all in C# but you should get the idea. Once I check my docs, I'll get back to you if it's wrong
I.e. don't type in a URL like http://www.somesite.com/someDir/somePage.aspx.vb it shouldn't have the .vb
As for the page load, there should be a method in your aspx file that's something like (forgive me if it's wrong because I don't have my docs to look at right now)
public void OnPage_Load(object sender, EventArgs e){
if(Page.IsPostBack()){
// do stuff if the page is posted back
} else {
// Do stuff only the first time the page loads
}
// do stuff no matter which time the page loads
}That's all in C# but you should get the idea. Once I check my docs, I'll get back to you if it's wrong
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 0
Yes my server handles .NET. I have made small ASP.NET forms which display and work. Now I need to create the entire HTML dynamically. Whenever I run my code, .NET populates it's own HTML to run and never enters the Page_Load event. Here is all my code....
dynamic_page.aspx: (I have set the AutoEventWireup to both True and False...)
dynamic_page.aspx.vb:
HTML returned from server to client box:
*** On another note: Why does my VS.NET always place in the "<% @ Page" tag? It causes the page to display an error for line 1.
Thanks for your time and help.
- Eric
dynamic_page.aspx: (I have set the AutoEventWireup to both True and False...)
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="dynamic_page.aspx.vb" %>
dynamic_page.aspx.vb:
Public Class dynamic_page
Inherits System.Web.UI.Page
#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
Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
Response.Write("<html><head></head><body>Eric</body></html>")
End If
End Sub
End ClassHTML returned from server to client box:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD> <BODY></BODY></HTML>
*** On another note: Why does my VS.NET always place
Inherits="www.derivetech.us.dynamic_page"
Thanks for your time and help.
- Eric
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
- ASP.NET 2.0 Invalid attempt to FieldCount when reader is closed (ASP.NET)
- New to ASP. NET (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- asp.net tutorial (ASP)
- Forms Authorization/ Authentication using asp .net and vb .net (ASP.NET)
- Question for ASP.NET/Mozilla Users...or anyone... (ASP.NET)
- .NET Speech SDK for ASP.NET (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: ADO.NET Specified cast is not valid
- Next Thread: ASP.NET <--> XML <--> VB6.0


Hybrid Mode