Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2007, 02:40 PM
Registered User
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Submission Website by User

Here is what going on and I need a little help. I am not "new" to programming, been writing code for about 1.5 years now (not long I know but not really new either). I am new how ever to this forum, so as this is my first topic I would like to first say Hello and thanks for getting this far already in my post.

The Problem:
I run a website www.weymouthband.com. What I need to do is make a way for members of the organization (about 80 - 100) people make request for information to be put up on the website. So there would be a page called weymouthband.com/contentrequest.aspx. Now when I was writing the code for this I ran into some problems. I couldnt get the page to build because I needed a <form> tag on it. but when i put a form tag i couldn't get it to compile because it said there was more than one form tag (or something on those lines)

So what i need to some help trying to figure out the easiest way to have a user (they don't have to be authenticated there is no login) enter some data into some text boxes and when they hit the submit button it takes that data and puts it into a text file in a folder called Requests.

Also I would like to have the name of the file be submitted by the user as well.

Thanks for all the help.

Nick

 
Old November 25th, 2007, 12:47 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What IDE are you using? Visual Studio or the Express products? In either case, when you create a new page through the IDE you are giving some skeleton code on the UI side that will already include a <form runat="server"></form> set.

You should be placing all of your controls between the <form> and </form> for you page to build correctly. However, if you were to have code like this:

<form runat="server">
<div>
</div>
</form>
<asp:Label id="lbl" runat="server" />

This would cause a build failure because server controls need to be placed inside of a <form runat="server"> set.

That should correct your build problem. In so far as the I/O operations, show me what you have so far and we will work from there.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 25th, 2007, 10:52 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I just want to throw in one mod. Dan hit the really important point. Whenever you're building a .NET page, the body automatically has this structure because it's a webform.

<body>
  <form>
    .
    .
    .
  </form>
</body>

From your description it sounds like you tried to place a form onto your webpage, and normally that works fine, but not in .NET because then you're nesting a <form> tag inside another form tag. Oooo... that's bad.

What you need to do is remove the form tags that you put in because the form elements are already inside the standard set of form tags.

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

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old November 26th, 2007, 04:33 PM
Registered User
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok Thanks for the Help let me get that page built and what not and ill post it back on here. I have to go to work right now so I cant do it right now.

THANKS SO MUCH.

Also would there be a way for a user to type the data in. The that data would be directly put on a page. Like announcements and stuff like that.

Also just so you know I am using the Express Edition (me to poor to buy Visual Studio) and The page is built using site.master and content pages... Will this make a diffrence?

 
Old November 26th, 2007, 04:48 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

To get the annocnments and such to display that depends, are you using any form of a database or simply flat files?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 27th, 2007, 08:52 PM
Registered User
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:To get the announcements and such to display that depends, are you using any form of a database or simply flat files?
I could use a MySql for the database on the server, But knowing both ways could be useful I think. I wish I could use a standard SQL database (Like those created by VWD.

Thank's so much for all your help!!!!

 
Old November 27th, 2007, 11:20 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

MySQL is a Standard Database...it just has a different implementation of ANSI SQL then SQL Server and you will find that is it just as supported through the framework. (if you head over to the mysql website, you will find namespaces that you can add to your .NET framework that are optimizied to make MySQL calls, otherwise you can simply use the System.Data.ODBC namespace)

This SERP should tell you everything you need to know about hooking a MySQL Database up to your app and how to read/write/update to it!

http://www.google.com/search?hl=en&q...mysql+database

Let me know if you need anything else.

hth.



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 29th, 2007, 12:42 AM
Registered User
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks so much

I read it over followed the directions. Now how do i use that in ASP. I did read the code he gave but I am rather confused on what I have to include (like what using statements do i need), how to get data to the database using ASP, and text boxes and other controls and what not...

Thanks again so much!!!

 
Old November 29th, 2007, 09:54 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I am not sure what directions you followed or what code you read. If you have downloaded the namespace from the MySQL website, it has been awhile since i have used MySQL, but I think you need to add a reference to the class that you download from the MySQL site.

Your using directive will then be:
using System.Data.MySQL;

These links should be able to get you started with making calls to and from MySQL with your application.

http://aspnet101.com/aspnet101/tutorials.aspx?id=39
http://www.15seconds.com/issue/050210.htm

(I am not trying to dodge you by giving you links but Knowledge learned is better then knowledge told =] )

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 29th, 2007, 01:05 PM
Registered User
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 
Quote:
quote:(I am not trying to dodge you by giving you links but Knowledge learned is better then knowledge told =] )


I would love for you to give me a step by step, but that would mean you do all the work and I just copy and paste. Thats no good I want to learn as well, not just Ctrl-C Ctrl-V!

So I will look over those two websites.


 
Quote:
quote:it has been awhile since i have used MySQL


What do you use?






Similar Threads
Thread Thread Starter Forum Replies Last Post
form submission...help!? mdbrueckner ASP.NET 2.0 Basics 1 September 19th, 2007 06:16 PM
Dynamic website to Static website Aboal3ood ASP.NET 1.x and 2.0 Application Design 4 December 7th, 2006 11:46 AM
Stopping frequent submission rajuru Beginning PHP 1 August 20th, 2004 09:56 AM
conditional form submission moushumi Classic ASP Basics 1 March 30th, 2004 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.