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 July 20th, 2007, 10:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. you should have this file on your own pc on the root folder of your site..
the file is an xml file.. you just add the tag like the error refered to you and upload it...

HTH

Gonzalo

================================================== =========
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
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old July 20th, 2007, 06:04 PM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

I have done what was asked and all to no avail...still the same screen.
Actually if you read the error message it is spoken in a way that makes it sound like it's on the host servers...

BTW

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Sqlclient" %>
<%@ Import Namespace="System.Text"%>

What is the deal with namespaces? I presume they are files held on the providers server? How do you see whether the server you are on has them?

Also when you run a web page with script in and you get <%@ Import Namespace="System.Data" %> at the top does it mean that the script is not being seen as script...

 
Old July 20th, 2007, 10:28 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Jim,

A Namespace in .NET is construct for organizing entities. It is not an entity itself, but rather the "name" of a conceptual "space" where entities are defined. When you use some class for SQL Server data access, you use the classes that "live" in the "System.Data.SqlClient" namespace.

This wikipedia article actually has a relatively good analogy:
http://en.wikipedia.org/wiki/Namespa...ter_science%29

All of the namespaces that start with "System" are part of the .NET framework. Any server that claims to have .NET on it will have all the entities within the System namespace. All of the System namespace entities are accessible throughout the environment because they are globally available as part of the .NET framework runtime (they actually live in the Global Assembly Cache, but that is another subject).

The "Import" directive that you have in your page is a way to permit shorthand of entity names. Keeping with the example above, if I want to use the SqlConnection class that lives within the System.Data.SqlClient namespace I have two options:

Without using "Import" directives:

   System.Data.SqlClient.SqlConnection objMyConnection = new System.Data.SqlClient.SqlConnection();

with "Import" directives:

   SqlConnection objMyConnection = new SqlConnection();

The import essentially exposes all entities of the namespace directly so you can use just their names in your code instead of the fully qualified entity name. This saves lots of typing and makes for cleaner code.


Regarding the error you are getting:
As Gonzalo suggested, you should have a web.config file as part of your web site project. This is a standard file used to configure a web application (hence the file name). This file can override the standard default system settings of ASP.NET web applications. There is a collection of settings that affect ASP.NET in the framework config files that apply to the whole server. Your web.config file can override these settings. You need to place a web.config file in your web host application that contains that XML provided by the error message. Google for web.config and you should have no problem finding a syntax reference or samples of files. By adding the suggested configuration, you can turn off custom error display and be able to see the full error message. Then you can proceed to track down the problem.



-Peter
 
Old July 21st, 2007, 01:33 PM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

HAHA! Victory is mine!!! (Ish...)

I created my web pages in notepad/firefox. I therefore did not create a web.config file. I had no idea that you were supposed to create and upload one into your website - now I understand how and why!!

So the new error is...

c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc .exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Service s\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dl l" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\ 2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__ b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 \Temporary ASP.NET Files\root\371c5b07\e3f654eb\App_Web_directinput.a spx.cdcab7d2.lrodag3g.dll" /debug- /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\ v2.0.50727\Temporary ASP.NET Files\root\371c5b07\e3f654eb\dcoyxrz2.res" /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collec tions,System.Collections.Specialized,System.Config uration,System.Text,System.Text.RegularExpressions ,System.Web,System.Web.Caching,System.Web.SessionS tate,System.Web.Security,System.Web.Profile,System .Web.UI,System.Web.UI.WebControls,System.Web.UI.We bControls.WebParts,System.Web.UI.HtmlControls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\root\371c5b07\e3f654eb\App_Web_directinput.a spx.cdcab7d2.lrodag3g.0.vb" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\root\371c5b07\e3f654eb\App_Web_directinput.a spx.cdcab7d2.lrodag3g.1.vb"


Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(31) : error BC30451: Name 'FirstName' is not declared.

      If (FirstName.Value = "" Or Surname.Value = "" _
          ~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(31) : error BC30451: Name 'Surname' is not declared.

      If (FirstName.Value = "" Or Surname.Value = "" _
                                  ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(32) : error BC30451: Name 'PrimaryEmail' is not declared.

         Or PrimaryEmail.Value = "") Then
            ~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(33) : error BC30451: Name 'Message' is not declared.

         Message.InnerHtml = "ERROR: Null values not allowed for " _
         ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(35) : error BC30451: Name 'Message' is not declared.

         Message.Style("color") = "red"
         ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(36) : error BC30451: Name 'Annual' is not declared.

       Elseif (Annual.value = "" And Quarterly.value = "")Then
               ~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(36) : error BC30451: Name 'Quarterly' is not declared.

       Elseif (Annual.value = "" And Quarterly.value = "")Then
                                     ~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(37) : error BC30451: Name 'Message' is not declared.

       Message.InnerHtml = "ERROR: You must select a memberhip type"
       ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(38) : error BC30451: Name 'Message' is not declared.

       Message.Style("color") = "red"
       ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(39) : error BC30035: Syntax error.

       Else (AcceptT&C.value = "")Then
            ~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(40) : error BC30451: Name 'Message' is not declared.

       Message.InnerHtml = "ERROR:You must indicate that you accept the terms and conditions in order to procede"
       ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(41) : error BC30451: Name 'Message' is not declared.

       Message.Style("color") = "red"
       ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(55) : error BC30456: 'Value' is not a member of 'String'.

      myCommand.Parameters("@Title").Value = Title.Value
                                             ~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(58) : error BC30451: Name 'FirstName' is not declared.

      myCommand.Parameters("@FirstName").Value = FirstName.Value
                                                 ~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(61) : error BC30451: Name 'Surname' is not declared.

      myCommand.Parameters("@Surname").Value = Surname.Value
                                               ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(64) : error BC30451: Name 'Username' is not declared.

      myCommand.Parameters("@Username").Value = Username.Value
                                                ~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(67) : error BC30451: Name 'Password' is not declared.

      myCommand.Parameters("@Password").Value = Password.Value
                                                ~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(70) : error BC30451: Name 'Address1' is not declared.

      myCommand.Parameters("@Address1").Value = Address1.Value
                                                ~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(73) : error BC30451: Name 'Address2' is not declared.

      myCommand.Parameters("@Address2").Value = Address2.Value
                                                ~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(76) : error BC30451: Name 'Address3' is not declared.

      myCommand.Parameters("@Address3").Value = Address3.Value
                                                ~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(79) : error BC30451: Name 'Postcode' is not declared.

      myCommand.Parameters("@Postcode").Value = Postcode.Value
                                                ~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(82) : error BC30451: Name 'JoinedDate' is not declared.

      myCommand.Parameters("@JoinedDate").Value = JoinedDate.Value
                                                  ~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(85) : error BC30451: Name 'Quarterly' is not declared.

      myCommand.Parameters("@Quarterly").Value = Quarterly.Value
                                                 ~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(88) : error BC30451: Name 'Annual' is not declared.

      myCommand.Parameters("@Annual").Value = Annual.Value
                                              ~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(91) : error BC30451: Name 'Dob' is not declared.

      myCommand.Parameters("@DoB").Value = Dob.Value
                                           ~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(94) : error BC30451: Name 'Gender' is not declared.

      myCommand.Parameters("@Gender").Value = Gender.Value
                                              ~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(97) : error BC30451: Name 'TelHome' is not declared.

      myCommand.Parameters("@TelHome").Value = TelHome.Value
                                               ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(100) : error BC30451: Name 'TelWork' is not declared.

      myCommand.Parameters("@TelWork").Value = TelWork.Value
                                               ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(103) : error BC30451: Name 'TelMobile' is not declared.

      myCommand.Parameters("@TelMobile").Value = TelMobile.Value
                                                 ~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(106) : error BC30451: Name 'PrimaryEmail' is not declared.

      myCommand.Parameters("@PrimaryEmail").Value = PrimaryEmail.Value
                                                    ~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(109) : error BC30451: Name 'AlternativeEmail' is not declared.

      myCommand.Parameters("@AlternativeEmail").Value = AlternativeEmail.Value
                                                        ~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(112) : error BC30451: Name 'EmployerName' is not declared.

      myCommand.Parameters("@EmployerName").Value = EmployerName.Value
                                                    ~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(115) : error BC30451: Name 'Trade' is not declared.

      myCommand.Parameters("@Trade").Value = Trade.Value
                                             ~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(118) : error BC30451: Name 'InterestWalking' is not declared.

      myCommand.Parameters("@InterestWalking").Value = InterestWalking.Value
                                                       ~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(121) : error BC30451: Name 'InterestMountaineering' is not declared.

      myCommand.Parameters("@InterestMountaineering").Va lue = InterestMountaineering.Value
                                                              ~~~~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(124) : error BC30451: Name 'InterestCaving' is not declared.

      myCommand.Parameters("@InterestCaving").Value = InterestCaving.Value
                                                      ~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(127) : error BC30451: Name 'InterestMountainBiking' is not declared.

      myCommand.Parameters("@InterestMountainBikinging") .Value = InterestMountainBiking.Value
                                                                 ~~~~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(130) : error BC30451: Name 'LandOther' is not declared.

      myCommand.Parameters("@InterestLandOther").Value = LandOther.Value
                                                         ~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(133) : error BC30451: Name 'InterestFlying' is not declared.

      myCommand.Parameters("@InterestFlying").Value = InterestFlying.Value
                                                      ~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(136) : error BC30451: Name 'InterestGliding' is not declared.

      myCommand.Parameters("@InterestGliding").Value = InterestGliding.Value
                                                       ~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(139) : error BC30451: Name 'InterestParachuting' is not declared.

      myCommand.Parameters("@InterestParachuting").Value = InterestParachuting.Value
                                                           ~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(142) : error BC30451: Name 'InterestHangliding' is not declared.

      myCommand.Parameters("@InterestHangliding").Value = InterestHangliding.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(145) : error BC30451: Name 'InterestAirOther' is not declared.

      myCommand.Parameters("@InterestAirOther").Value = InterestAirOther.Value
                                                        ~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(148) : error BC30451: Name 'InterestPowerBoats' is not declared.

      myCommand.Parameters("@InterestPowerBoats").Value = InterestPowerBoats.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(151) : error BC30451: Name 'SailClimbing' is not declared.

      myCommand.Parameters("@InterestSailing").Value = SailClimbing.Value
                                                       ~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(154) : error BC30451: Name 'InterestSurfing' is not declared.

      myCommand.Parameters("@InterestSurfing").Value = InterestSurfing.Value
                                                       ~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(157) : error BC30451: Name 'InterestWindSurfing' is not declared.

      myCommand.Parameters("@InterestWindSurfing").Value = InterestWindSurfing.Value
                                                           ~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(160) : error BC30451: Name 'InterestCanoeKayak' is not declared.

      myCommand.Parameters("@InterestCanoeKayak").Value = InterestCanoeKayak.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(163) : error BC30451: Name 'InterestSubAqua' is not declared.

      myCommand.Parameters("@InterestSubAqua").Value = InterestSubAqua.Value
                                                       ~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(166) : error BC30451: Name 'InterestWaterOther' is not declared.

      myCommand.Parameters("@InterestWaterOther").Value = InterestWaterOther.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(169) : error BC30451: Name 'InterestRacing' is not declared.

      myCommand.Parameters("@InterestRacing").Value = InterestRacing.Value
                                                      ~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(172) : error BC30451: Name 'InterestMotorbikes' is not declared.

      myCommand.Parameters("@InterestMotorbikes").Value = InterestMotorbikes.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(175) : error BC30451: Name 'InterestQuadBiking' is not declared.

      myCommand.Parameters("@InterestQuadBiking").Value = InterestQuadBiking.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(178) : error BC30451: Name 'InterestMotorOther' is not declared.

      myCommand.Parameters("@InterestMotorOther").Value = InterestMotorOther.Value
                                                          ~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(181) : error BC30451: Name 'ExperienceLandSports' is not declared.

      myCommand.Parameters("@ExperienceLandSports").Valu e = ExperienceLandSports.Value
                                                            ~~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(184) : error BC30451: Name 'ExperienceAirSports' is not declared.

      myCommand.Parameters("@ExperienceAirSports").Value = ExperienceAirSports.Value
                                                           ~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(187) : error BC30451: Name 'ExperienceWaterSports' is not declared.

      myCommand.Parameters("@ExperienceWaterSports").Val ue = ExperienceWaterSports.Value
                                                             ~~~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(190) : error BC30451: Name 'ExperienceMotorSports' is not declared.

      myCommand.Parameters("@ExperienceMotorSports").Val ue = ExperienceMotorSports.Value
                                                             ~~~~~~~~~~~~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(196) : error BC30451: Name 'Message' is not declared.

         Message.InnerHtml = "<b>Record Added</b><br>" & insertCmd
         ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(199) : error BC30451: Name 'Message' is not declared.

            Message.InnerHtml = "ERROR: A record already exists with " _
            ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(202) : error BC30451: Name 'Message' is not declared.

            Message.InnerHtml = "ERROR: Could not add record, please " _
            ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(204) : error BC30451: Name 'Message' is not declared.

            Message.Style("color") = "red"
            ~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(230) : error BC30451: Name 'MyDataGrid' is not declared.

      MyDataGrid.DataSource = ds
      ~~~~~~~~~~
\\nas38ent\domains\m\mytimeweekends.com\user\htdoc s\directinput.aspx(231) : error BC30451: Name 'MyDataGrid' is not declared.

      MyDataGrid.DataBind()
      ~~~~~~~~~~

Gee, I wonder if I failed to declare anything...

OK how do you declare something - I built the form at the bottom of the code which names each textbox, checkbox, etc... should that be at the top?

 
Old July 23rd, 2007, 06:28 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Jim,

Perhaps you should look into using Microsoft's free version of .NET web development: Visual Studio Express: Visual Web Developer

http://msdn.microsoft.com/vstudio/express/vwd/

This might help eliminate lots of the problems you are having. It will help to get everything organized and you can debug your code much easier.

While it is true you can write .NET applications in notepad, using much better tools would be considerably easier.

-Peter
 
Old July 23rd, 2007, 09:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Also you are having errors that can be easily correct with the help of the parser inside VS express.. you better get it...

HTH

Gonzalo

================================================== =========
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
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old July 23rd, 2007, 10:44 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Afternoon Fellas,

For this page I am using MVWD 2005 express -

I've changed the code a lot using dim statements to define properties

I've done a lot of defining like so Dim FirstName = FirstName.value trying to say that the FirstName value comes from what the user enters into the textbox ID FirstName - is this the way to do it?

The compiler error statements keeps saying that I need to define 'message' from message.innerhtml = "blah"; have I not loaded something which will show message.innerhtml to be a function not a variable?

I'm sorry the code is so long - I know it's a pain...but I've included where I'm up to below - I feel like I'm close but without guidance I may end up with a load of ....... instead of a simple input form

Guys, your help is as always appreciated - I have recommended the forum (as a source of knowledge) to at least 2 people this weekend...



<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Sqlclient" %>
<%@ Import Namespace="System.Text"%>

<html>
<head></head>
<script language="VB" runat="server" >
   Dim MyConnection As SqlConnection

   Sub Page_Load(Src As Object, e As EventArgs)

      myConnection = New SqlConnection("server=213.171.193.1;" _
         & "initial catalog=MyTime;User ID=jmsherry; password=Lich1977")

    End Sub

    Dim Prefix = Prefix.value
    Dim FirstName = FirstName.value
    Dim Surname = Surname.value
    Dim PrimaryEmail = PrimaryEmail.value
    Dim Annual = Annual.value
    Dim Quarterly = Quarterly.value
    Dim Username = ""
    Dim Password = ""
    Dim Address1 = Address1.value
    Dim Address2 = Address2.value
    Dim Address3 = Address3.value
    Dim Postcode = Postcode.value
    Dim JoinedDate = Today()
    Dim DoB = DoB.value
    Dim Gender = Gender.value
    Dim TelHome = TelHome.value
    Dim TelWork = TelWork.value
    Dim TelMobile = TelMobile.value
    Dim AlternativeEmail = AlternativeEmail.value
    Dim EmployerName = Employername.value
    Dim Trade = Trade.value
    Dim InterestWalking = InterestWalking.value
    Dim InterestMountaineering = InterestMountaineering.value
    Dim InterestCaving = InterestCaving.value
    Dim InterestMountainBiking = InterestMountainBiking.value
    Dim InterestLandOther = InterestLandOther.value
    Dim InterestFlying = InterestFlying.value
    Dim InterestGliding = InterestGliding.value
    Dim InterestParachuting = InterestParachuting.value
    Dim InterestHangliding = InterestHangliding.value
    Dim InterestAirOther = InterestAirOther.value
    Dim InterestPowerBoats = InterestPowerBoats.value
    Dim InterestSailing = InterestSailing.value
    Dim InterestSurfing = InterestSurfing.value
    Dim InterestWindSurfing = InterestWindSurfing.value
    Dim InterestCanoeKayak = InterestCanoeKayak.value
    Dim InterestSubAqua = InterestSubAqua.value
    Dim InterestWaterOther = InterestWaterOther.value
    Dim InterestRacing = InterestRacing.value
    Dim InterestMotorbikes = InterestMotorbikes.value
    Dim InterestQuadBiking = InterestQuadBiking.value
    Dim InterestMotorOther = InterestMotorOther.value
    Dim ExperienceLandSports = ExperienceLandSports.value
    Dim ExperienceAirSports = ExperienceAirsports.value
    Dim ExperienceWaterSports = ExperienceWaterSports.value
    Dim ExperienceMotorSports = ExperienceMotorSports.value
    Dim TC = TC.value



   ' Implement an AddAuthor_Click function. This function does some data
   ' validation on the input form and builds a parameterized command containing
   ' all the fields of the input form. Then it executes this command to the
   ' database and tests (using the try command) whether the data was added.
   ' Finally, it rebinds the DataGrid to show the new data.

   Sub AddAuthor_Click(Sender As Object, e As EventArgs)
      Dim myCommand As SqlCommand
      Dim insertCmd As String
      ' Check that four of the input values are not empty. If any of them
      ' is empty, show a message to the user and rebind the DataGrid.
        If (FirstName.Value = "" Or Surname.Value = "" _
           Or PrimaryEmail.Value = "") Then
            Message.InnerHtml = "ERROR: Null values not allowed for " _
              & "Membership Type, First Name, Surname, Primary Email."
            Message.Style("color") = "red"
        ElseIf (Annual.value = "" And Quarterly.value = "") Then
            Message.InnerHtml = "ERROR: You must select a memberhip type"
            Message.Style("color") = "red"

        Else (TC.value = "")Then Message.InnerHtml = "ERROR:You must indicate that you accept the terms and conditions in order to procede"
            Message.Style("color") = "red"

            Exit Sub
        End If
      ' Build a SQL INSERT statement string for all the input-form
      ' field values.
        insertCmd = "INSERT INTO Members (@Prefix, @FirstName, @Surname, @Username , @Password, @Address1, @Address2, @Address3, @Postcode, @JoinedDate, @Quarterly, @Annual, @DoB, @Gender, @TelHome, @TelWork, @TelMobile, @PrimaryEmail, @AlternativeEmail, @EmployerName, @Trade, @InterestClimbing, @InterestWalking, @InterestMoutaineering, @InterestCaving, @InterestMoutainBiking, @InterestLandOther, @InterestFlying, @InterestGliding, @InterestParachuting, @InterestHangliding, @InterestAirOther, @InterestPowerBoats, @InterestSailing, @InterestSurfing, @InterestWindSurfing, @interestCanoeKayak, @InterestSubAqua, @InterestWaterOther, @InterestRacing, @InterestMotorbikes, @InterestQuadBiking, @InterestMotorOther, @ExperienceLandSports, @ExperienceAirSports, @ExperienceWaterSports, @ExperienceMotorSports" _
           & "AcceptT&C);"
      ' Initialize the SqlCommand with the new SQL string.
      myCommand = New SqlCommand(insertCmd, myConnection)
      ' Create new parameters for the SqlCommand object and
      ' initialize them to the input-form field values.
        myCommand.Parameters.Add(New SqlParameter("@Prefix", _
         SqlDbType.VarChar, 50))
        myCommand.Parameters("@Prefix").Value = Prefix.Value
      myCommand.Parameters.Add(New SqlParameter("@FirstName", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@FirstName").Value = FirstName.Value
      myCommand.Parameters.Add(New SqlParameter("@Surname", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Surname").Value = Surname.Value
      myCommand.Parameters.Add(New SqlParameter("@Username", _
         SqlDbType.Char, 50))
      myCommand.Parameters("@Username").Value = Username.Value
      myCommand.Parameters.Add(New SqlParameter("@Password", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Password").Value = Password.Value
      myCommand.Parameters.Add(New SqlParameter("@Address1", _
         SqlDbType.VarChar, 20))
      myCommand.Parameters("@Address1").Value = Address1.Value
      myCommand.Parameters.Add(New SqlParameter("@Address2", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Address2").Value = Address2.Value
       myCommand.Parameters.Add(New SqlParameter("@Address3", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Address3").Value = Address3.Value
      myCommand.Parameters.Add(New SqlParameter("@Postcode", _
         SqlDbType.Char, 50))
      myCommand.Parameters("@Postcode").Value = Postcode.Value
      myCommand.Parameters.Add(New SqlParameter("@JoinedDate", _
         SqlDbType.VarChar,10))
      myCommand.Parameters("@JoinedDate").Value = JoinedDate.Value
      myCommand.Parameters.Add(New SqlParameter("@Quarterly", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@Quarterly").Value = Quarterly.Value
      myCommand.Parameters.Add(New SqlParameter("@Annual", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@Annual").Value = Annual.Value
      myCommand.Parameters.Add(New SqlParameter("@DoB", _
         SqlDbType.VarChar,10))
      myCommand.Parameters("@DoB").Value = Dob.Value
      myCommand.Parameters.Add(New SqlParameter("@Gender", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@Gender").Value = Gender.Value
      myCommand.Parameters.Add(New SqlParameter("@TelHome", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@TelHome").Value = TelHome.Value
      myCommand.Parameters.Add(New SqlParameter("@TelWork", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@TelWork").Value = TelWork.Value
      myCommand.Parameters.Add(New SqlParameter("@TelMobile", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@TelMobile").Value = TelMobile.Value
      myCommand.Parameters.Add(New SqlParameter("@PrimaryEmail", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@PrimaryEmail").Value = PrimaryEmail.Value
      myCommand.Parameters.Add(New SqlParameter("@AlternativeEmail", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@AlternativeEmail").Value = AlternativeEmail.Value
      myCommand.Parameters.Add(New SqlParameter("@EmployerName", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@EmployerName").Value = EmployerName.Value
      myCommand.Parameters.Add(New SqlParameter("@Trade", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@Trade").Value = Trade.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestWalking", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestWalking").Value = InterestWalking.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMountaineering", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMountaineering").Va lue = InterestMountaineering.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestCaving", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestCaving").Value = InterestCaving.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMountainBikinging", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMountainBikinging") .Value = InterestMountainBiking.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestLandOther", _
         SqlDbType.VarChar,1))
        myCommand.Parameters("@InterestLandOther").Value = InterestLandOther.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestFlying", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestFlying").Value = InterestFlying.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestGliding", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestGliding").Value = InterestGliding.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestParachuting", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestParachuting").Value = InterestParachuting.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestHangliding", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestHangliding").Value = InterestHangliding.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestAirOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestAirOther").Value = InterestAirOther.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestPowerBoats", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestPowerBoats").Value = InterestPowerBoats.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestSailing", _
         SqlDbType.VarChar,1))
        myCommand.Parameters("@InterestSailing").Value = InterestSailing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestSurfing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestSurfing").Value = InterestSurfing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestWindSurfing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestWindSurfing").Value = InterestWindSurfing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestCanoeKayak", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestCanoeKayak").Value = InterestCanoeKayak.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestSubAqua", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestSubAqua").Value = InterestSubAqua.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestWaterOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestWaterOther").Value = InterestWaterOther.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestRacing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestRacing").Value = InterestRacing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMotorbikes", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMotorbikes").Value = InterestMotorbikes.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestQuadBiking", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestQuadBiking").Value = InterestQuadBiking.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMotorOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMotorOther").Value = InterestMotorOther.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceLandSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceLandSports").Valu e = ExperienceLandSports.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceAirSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceAirSports").Value = ExperienceAirSports.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceWaterSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceWaterSports").Val ue = ExperienceWaterSports.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceMotorSports", _
         SqlDbType.VarChar,1000))
        myCommand.Parameters("@ExperienceMotorSports").Val ue = ExperienceMotorSports.Value
        myCommand.Parameters.Add(New SqlParameter("@TC", _
         SqlDbType.Bit, 1))
        myCommand.Parameters("@TC").Value = TC.Value
      myCommand.Connection.Open()
      ' Test whether the new row can be added and display the
      ' appropriate message box to the user.
      Try
         myCommand.ExecuteNonQuery()
         Message.InnerHtml = "<b>Record Added</b><br>" & insertCmd
      Catch ex As SqlException
         If ex.Number = 2627 Then
            Message.InnerHtml = "ERROR: A record already exists with " _
               & "the same primary key"
         Else
            Message.InnerHtml = "ERROR: Could not add record, please " _
               & "ensure the fields are correctly filled out"
            Message.Style("color") = "red"
         End If
     End Try

     myCommand.Connection.Close()

    End Sub


</script>

<body>
<table width="100%" align="center" cellpadding="0" cellspacing="0">

<tr height="40" valign="top">
<td colspan="7"><h3>Membership Type:</h3></td></tr>

<tr height="40" valign="top">
<td>Quarterly (£90)
<br /><br />Annually (£315)
<td colspan="6">
<input type="radio" name="MembershipType" id="quarterly" value="quarterly"><br /><br />
<input type="radio" name="MembershipType" id="annual" value="annual" checked>
</td>
</tr>

<tr height="40" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7"><h3>Contact Details:</h3></td></tr>

<tr height="40" valign="top">
<td>Title:</td>
<td colspan="6"><select name="Prefix" id="Prefix">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr height="40" valign="top">
<td>First Name:</td>
<td colspan="2"><input type="text" name="FirstName" style="width: 240px" id="FirstName" />
</td><td width="10"></td>
<td>Surname:</td>
<td colspan="2">
<input type="text" name="Surname" style="width: 240px" id="Surname" />
</td>
</tr>
<tr height="40" valign="top">
<td>Primary Email:</td>
<td colspan="2"><input type="text" name="PrimaryEmail" style="width: 240px" id="PrimaryEmail" />
</td><td></td>
<td>Alternative Email:</td>
<td colspan="2">
<input type="text" name="AlternativeEmail" style="width: 240px" id="AlternativeEmail" />
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td>
Address:
</td>
<td colspan="2">
<input type="text" name="Address1" style="width: 240px" id="Address1" />
</td><td></td>
<td>Home Telephone:</td>
<td colspan="2">
<input type="text" name="TelHome" style="width: 240px" id="TelHome" />
</td>
</tr>
<tr height="30" valign="top">
<td></td>
<td colspan="2">
<input type="text" name="Address2" style="width: 240px" id="Address2" />
</td><td></td>
<td>Mobile Telephone:</td>
<td colspan="2">
<input type="text" name="TelMobile" style="width: 240px" id="TelMobile" />
</td>
</tr>
<tr height="30" valign="top">
<td></td>
<td colspan="2">
<input type="text" name="Address3" style="width: 240px" id="Address3" />
</td><td></td>
<td>Work Telephone:</td>
<td colspan="2">
<input type="text" name="TelWork" style="width: 240px" id="TelWork" />
</td>
</tr>
<tr height="30" valign="top">
<td>Postcode:</td>
<td colspan="2">
<input type="text" name="Postcode" style="width: 100px" id="Postcode" />
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Date of Birth (dd/mm/19yy):</td>
<td colspan="2">
<input type="text" name="DoB" maxlength="10" id="DoB" />
</td><td></td>
<td>Gender:</td>
<td colspan="2"><select name="Gender" id="Gender">
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Employer / Company:</td>
<td colspan="2">
<input type="text" name="EmployerName" style="width: 240px" id="EmployerName" />
</td><td></td>
<td>Profession / Job Title:</td>
<td colspan="2">
<input type="text" name="Trade" style="width: 240px" id="Trade" />
</td>
</tr>

<tr height="40" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7"><h3>Interests:</h3>
    <p>
        Please indicate the activities you are interested in below.&nbsp; This is by no
        means an exhaustive list of the activities which we hope to run - feel free to contact
        us with your own suggestions and requirements.</p>

</td></tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestClimbing" id="InterestClimbing" /></td>
<td>
    &nbsp; Climbing</td>
<td align="right"><input type="checkbox" name="InterestWalking" id="InterestWalking" /></td>
<td colspan="2">
    &nbsp; Walking</td>
<td align="right"><input type="checkbox" name="InterestMountaineering" id="InterestMoutaineering" /></td>
<td>
    &nbsp; Mountaineering</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestCaving" id="InterestCaving" /></td>
<td>
    &nbsp; Caving / Potholing</td>
<td align="right"><input type="checkbox" name="InterestMountainbiking" id="InterestMountainBiking" /></td>
<td colspan="2">
    &nbsp; Mountainbiking</td>
<td align="right"><input type="checkbox" name="InterestLandOther" id="InterestLandOther" /></td>
<td>
    &nbsp; Other land sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestFlying" id="InterestFlying" /></td>
<td>
    &nbsp; Flying</td>
<td align="right"><input type="checkbox" name="InterestGliding" id="InterestGliding" /></td>
<td colspan="2">
    &nbsp; Gliding</td>
<td align="right"><input type="checkbox" name="InterestParachuting" id="InterestParachuting" /></td>
<td>
    &nbsp; Parachuting / Skydiving</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestHangliding" id="InterestHangliding" /></td>
<td>
    &nbsp; Hangliding</td>
<td align="right"><input type="checkbox" name="InterestAirOther" value="1" id="InterestAirOther" /></td>
<td colspan="2">
    &nbsp; Other air sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestPowerBoats" id="InterstPowerBoats" /></td>
<td>
    &nbsp; Powerboats</td>
<td align="right"><input type="checkbox" name="InterestSailing" id="IntestSailing" /></td>
<td colspan="2">
    &nbsp; Sailing</td>
<td align="right"><input type="checkbox" name="InterestSurfing" id="InterestSurfing" /></td>
<td>
    &nbsp; Surfing</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestWindsurfing" id="InterestWindsurfing" /></td>
<td>
    &nbsp; Windsurfing</td>
<td align="right"><input type="checkbox" name="InterestCanoeKayak" id="InterestCanoeKayak" /></td>
<td colspan="2">
    &nbsp; Canoeing / Kayaking</td>
<td align="right"><input type="checkbox" name="interestcoasteering" id="InterestCoasteering" /></td>
<td>
    &nbsp; Coasteering</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestSubAqua" id="InterestSubAqua" /></td>
<td>
    &nbsp; Sub-Aqua / Diving</td>
<td align="right"><input type="checkbox" name="InterestWaterOther" id="InterestWaterOther" /></td>
<td colspan="2">
    &nbsp; Other aqua sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestRacing" id="InterestRacing" /></td>
<td>
    &nbsp; Racing</td>
<td align="right"><input type="checkbox" name="InterestMotorbikes" id="InterestMotorbikes" /></td>
<td colspan="2">
    &nbsp; Motorbikes</td>
<td align="right"><input type="checkbox" name="InterestQuadBiking" id="InterestQuadBiking" /></td>
<td>
    &nbsp; Quad Biking</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestMotorOther" id="InterestMotorOther" /></td>
<td>
    &nbsp; Other motor sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestSkiing" id="InterestSkiing" /></td>
<td>
    &nbsp; Skiing</td>
<td align="right"><input type="checkbox" name="InterestSnowboarding" id="InterestSnowboarding" /></td>
<td colspan="2">
    &nbsp; Snowboarding</td>
<td align="right"><input type="checkbox" name="InterestWinterOther" id="InterestWinterOther" /></td>
<td>
    &nbsp; Other winter sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestSocial" id="InterestSocial" /></td>
<td>
    &nbsp; Social Activities</td>
<td align="right"><input type="checkbox" name="InterestOther" id="Interest Other" /></td>
<td colspan="2">
    &nbsp; Other</td>
<td>Please describe:</td>
<td align="right"><input type="text" name="OtherDescription" id="Other" /></td>
</tr>

<tr height="40" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7"><h3>Experience/Qualifications:</h3></td></tr>
<tr height="40" valign="top">
<td>Do you have any experience or qualifications in land sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceLandSports" cols="28" rows="5" id="ExperienceLandSports"></textarea>
</td><td></td>
<td>Do you have any experience or qualifications in air sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceAirSports" cols="28" rows="5" id="ExperienceAirSports"></textarea>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Do you have any experience or qualifications in aqua sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceWaterSports" cols="28" rows="5" id="ExperienceWaterSports"></textarea>
</td><td></td>
<td>Do you have any experience or qualifications in motor sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceMotorSports" cols="28" rows="5" id="ExperienceMotorSports"></textarea>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Do you have any experience or qualifications in winter sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceWinterSports" cols="28" rows="5" id="ExperienceWintersports"></textarea>
</td><td></td>
<td>Do you have any other experience or qualifications you would like to tell us about?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceOther" cols="28" rows="5" id="ExperienceOther"></textarea>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td colspan="7" class="style4"><br />
<p>MyTime respects your privacy and will <b>never</b> share any of your personal details with a third party.</p>
<p>I confirm that I have read and accept the <a href="T&C.html" target="_blank"><b>Terms & Conditions</b></a> of MyTime membership. <input type="checkbox" name="T&C" id="T&C" /></p>
</td></tr>

<tr height="20" valign="top"></tr>
<tr height="20" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7" class="style4" align="center">
<input type="submit" value="I accept the terms and conditions and wish to proceed to payment" id="Add_member" name="Add Member">
</td>
</tr>

   </table>


</body>
</html>

 
Old July 23rd, 2007, 12:28 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Jim,

You are going to run into problems with the way you are doing this. The placement of your variables where you pull the values from the controls will dictate that their values will only be the what the control defaults are when the instance of this page class is created. You don't have them in a useful location. More importantly however, you should just use the object properties as they are.

The core of your problem is that you are using literal HTML in your page instead of the server controls. If you use the appropriate server controls then you get all the code-behind support of those controls in order to get at their properties (display and data).

The whole idea of web controls is to provide linkage between the UI (raw HTML) and logic (code-behind) while also letting the ASP.NET framework deal with the mundane details of generating the output HTML.

For example, instead of this:

    <input type="text" name="FirstName" style="width: 240px" id="FirstName" />

you should be doing this:

    <asp:textbox runat="server" id="FirstName" width="240" />

Also, instead of this:

    <input type="checkbox" name="InterestCaving" id="InterestCaving" />

you should be doing this:

    <asp:checkbox runat="server" id="InterestCaving" />

I would also recommend using some simply prefixes for the server controls to make the code easier to read and work with, such as:

   chkMyCheckbox, txtMyTextField

Once you have real server controls on your page, working with them is easy:

chkMyCheckbox.Checked
txtMyTextField.Text

I imagine you got on this track because you were doing this initially in a plain text editor. You might be best served to just create a brand new web form in VWD and start dragging controls onto it so you can see how to configure them appropriately to meet your needs. Then use the markup that VWD creates to see how you need to change your existing page to create the controls properly.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand for some contents... jay0715 BOOK: Ivor Horton's Beginning Visual C++ 2005 0 November 4th, 2007 07:39 AM
Trying to understand execution flow jnbutler BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 1 August 4th, 2007 04:55 PM
I still do not understand aude_poullain ASP.NET 1.0 and 1.1 Basics 2 February 7th, 2007 09:11 PM
Who can understand this book? HandSomeLi All Other Wrox Books 2 October 20th, 2004 04:12 PM
i can't understand this error! ion Classic ASP Databases 2 September 23rd, 2003 03:57 PM





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