You cannot run a console app from ASP.NET. I'm not sure what your
thinking is on this, but ASP.NET does web pages. Code behind is server
side code that is executed when something like a button placed in
the .aspx page is clicked from the client browser. Below is an example
of using code behind (I'm using c#, but it's the same principle), a
textbox and a button are placed in the page, click the button and a
post back to the sever executes the Button1_Click event and sent back
to the client with "Hello World" in TextBox1. You can work with it in
a similar way as a Windows Form application.
I hope this helps

ASPX page:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="Button" />

    </div>
    </form>
</body>
</html>
ASPX.CS file
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox1.Text = "Hello World";
    }
}

On Feb 10, 1:24 pm, Davej <[email protected]> wrote:
> > On Thu, Feb 10, 2011 at 3:35 AM, Davej <[email protected]> wrote:
> > In ASP.NET can the code-behind aspx.vb files contain any VB.NET code?
> > Thanks.
>
> On Feb 10, 11:39 am, KeidrickP <[email protected]> wrote:
>
> > sure it can..
> > what are you really trying to ask?
>
> > On Thu, Feb 10, 2011 at 10:57 AM, Stephen Russell 
> > <[email protected]>wrote:
>
> > > Please reread your question and then say I guess so.
>
> I'm just getting started with ASP.NET and I don't know what I'm doing
> yet. I've never written console mode VB.NET code but I guess that is
> what you need to work with ASP.NET?

Reply via email to