1-page ASP.NET project?

joe_pool_is

Contributor
Joined
Jan 18, 2004
Messages
507
Location
Longview, TX [USA]
How can I create a small, 1-page and 1-file ASP.NET project?

I am trying to eliminate the "code behind" by placing my code in ASP tags <% %>.

I put together a test page, uploaded it to the ISP, and attempted to load it in IE. I got a "no web.config file" error. I am sure there will be more errors I'll run into if I don't do it right.

Could someone show me how to put together a small, simple page with one textbox that gets filled from the Response.QueryString command? There are bits and pieces of info all over the web, but I can't seem to find anything that puts it all together.

For example:
http://www.my-website.com/page.aspx?name=John%20Doe
...would load page.aspx with the name "John Doe" in the txtName.Text field.

Doing this is either so simple it is baffling me, or it requires just as big of a project as any other ASP.NET application.

Thanks for helping.
~Joe
 
Go to www.asp.net. It is a Microsoft website. Download the free ASP.NET IDE called Web Matrix. Create a new .ASPX page, and it will give you a section at the top <script runat="server"> </script>. Drop and drag a textbox on the web form. Back in the code, put in that script section:
Code:
Sub Page_Load()
    TextBox1.Text = Response.QueryString("name")
End Sub

That should get you started! You can also run, within Web Matrix, the ASPX pages because it initiates a virtual web server for you :) .
 
You don't need Web Matrix to put in-line server tags in the aspx file, you can even do this in Notepad.

Whatever tool you use you will still end up with a DLL once you compile it. Your page will not run without this DLL.
 
Robby said:
If you already have VS.NET why would you use Web Matrix?
VS.NET wants a big, complex system with dll's and ... I can't for the life of me seem to get "code on page" (as opposed to "code behind") to work in the VS.NET debugger.

I just want one page that is all inclusive, easy and simple.

Why? The page, ultimately, will be given to our IT guys to generate an ASP (not ASP.NET) page, and they do not have VS.NET. With it all in one page, I can print out the HTML view, and let them edit it as needed to run their ASP, add their pretty graphics, etc.
 
Back
Top