943,584 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1418
  • ASP.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Dec 4th, 2008
0

Simple ASP.NET form

Expand Post »
I am using an existing .aspx form that will submit a few fields and a comment box. It actually works! Now, I open that form in Dreamweaver and copy...let's say...the NAME field and all its guts in the td section for it, and reinstance it to NAME2 in a few places.

When I upload and check it out, sure enough the field is there.
But when the form is submitted, there is no mention of the new field NAME2 or of course the data that was placed in it.

Why?

How can the text box show up in the generated HTML but when filled with data, the date doesn't get sent in the email?

I hope the answer lies in the aspx file that we're talking about and not that...oh, you have to go into XXXXXX.aspx and tell that file to expect NAME2 or something crazy like that.

If anyone is interested here's the url
http://www.airedale911.org/a.aspx
and I can email them the aspx code also.

Thanks
Last edited by squarkman; Dec 4th, 2008 at 3:00 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
squarkman is offline Offline
42 posts
since Nov 2008
Dec 4th, 2008
0

Re: Simple ASP.NET form

why do you use dreamweaver but not visual studio?
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Dec 4th, 2008
0

Re: Simple ASP.NET form

Not sure. So do you have any idea why the field won't send data?
Thx
Reputation Points: 10
Solved Threads: 0
Light Poster
squarkman is offline Offline
42 posts
since Nov 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

no, i only used aspx page with dreamweaver once in my life and it sucked. download visual web express 2008 for free from microsoft, then we can discuss..
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

Form-method Post setted instead of Get?
Reputation Points: 33
Solved Threads: 10
Junior Poster in Training
4advanced is offline Offline
67 posts
since Nov 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

Not sure I understand what you said. Here is the exact code for the aspx form. The html generated will send an email even though there is no real form statement in the code. Plus the copied fields will not send their data but the non copied ones will send their data.
Is the form function hidden somewhere in aspx?
In anothre file perhaps?

asp.net Syntax (Toggle Plain Text)
  1. <%@ page language="VB" masterpagefile="~/pages/airedale911.master" autoeventwireup="false" inherits="feedback, App_Web_i5ksdbwd" title="airedale911.org: Feedback" %>
  2. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
  3. <h1>
  4. Airedale911's New Adoption Form In Progress</h1>
  5. <p>
  6. <strong>Instructions</strong>
  7.  
  8. <p>All fields that require an answer will prompt you if you leave them blank or enter an invalid value.&nbsp; If there is no answer,
  9. please enter "n/a" into the field.</p>
  10.  
  11. <p>Note that if you leave the form page without completing the on-line application,
  12. your answers will not be saved.</p>
  13.  
  14. <p>If your form does not get submitted, check the error message shown and return to that field.</p><br />
  15. </p>
  16.  
  17.  
  18. <table>
  19. <tr>
  20. <td class="Listings" valign="top" width="62">
  21. Comments2
  22. </td>
  23. <td class="Listings" width="303">
  24. <asp:TextBox cssclass="inputTXT" TextMode="MultiLine" Rows="5" ID="txtComments2" runat="server"></asp:TextBox>
  25. </td>
  26. <td class="Listings" valign="top" width="50">
  27. <asp:RequiredFieldValidator ID="rfvMailBody2" runat="server" ControlToValidate="txtComments"
  28. ErrorMessage="Required" Display="Dynamic"></asp:RequiredFieldValidator></td>
  29. </tr>
  30.  
  31. <tr>
  32. <td class="Listings" valign="top" width="62">
  33. Comments
  34. </td>
  35. <td class="Listings" width="303">
  36. <asp:TextBox cssclass="inputTXT" TextMode="MultiLine" Rows="5" ID="txtComments" runat="server"></asp:TextBox>
  37. </td>
  38. <td class="Listings" valign="top" width="50">
  39. <asp:RequiredFieldValidator ID="rfvMailBody" runat="server" ControlToValidate="txtComments"
  40. ErrorMessage="Required" Display="Dynamic"></asp:RequiredFieldValidator></td>
  41. </tr>
  42.  
  43.  
  44. <tr>
  45. <td class="Listings">
  46. Category
  47. </td>
  48. <td class="Listings">
  49. <asp:DropDownList runat="server" cssclass="inputDDL" ID="ddlCategory">
  50. <asp:ListItem Selected="true">Web site</asp:ListItem>
  51. <asp:ListItem>Adoptions</asp:ListItem>
  52. <asp:ListItem>Events</asp:ListItem>
  53. <asp:ListItem>Donations</asp:ListItem>
  54. </asp:DropDownList>
  55. </td>
  56. <td class="Listings">&nbsp;</td>
  57. </tr>
  58. <tr>
  59. <td colspan="3" class="Listings">
  60. <b>Your Contact Information</b></td>
  61. </tr>
  62. <tr>
  63. <td class="Listings">
  64. Name
  65. </td>
  66. <td>
  67. <asp:TextBox cssclass="inputTXT" ID="txtName" runat="server"></asp:TextBox></td>
  68. <td class="Listings">
  69. <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
  70. Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator></td>
  71. </tr>
  72.  
  73. <tr>
  74. <td class="Listings">
  75. How many in your household?
  76. </td>
  77. <td>
  78. <asp:TextBox cssclass="inputTXT2" ID="txtName2" runat="server"></asp:TextBox></td>
  79. <td class="Listings">
  80. <asp:RequiredFieldValidator ID="rfvName2" runat="server" ControlToValidate="txtName2"
  81. Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator></td>
  82. </tr>
  83.  
  84.  
  85. <tr>
  86. <td class="Listings">
  87. Phone</td>
  88. <td>
  89. <asp:TextBox cssclass="inputTXT" ID="txtPhone" runat="server"></asp:TextBox>
  90. <ajax:TextBoxWatermarkExtender ID="wmxPhone" runat="server" WatermarkCssClass="faintTXT"
  91. TargetControlID="txtPhone" WatermarkText="nnn-nnn-nnnn">
  92. </ajax:TextBoxWatermarkExtender>
  93. </td>
  94. <td class="Listings">
  95. <asp:RequiredFieldValidator ID="rfvPhone" runat="server" ControlToValidate="txtPhone"
  96. Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="rxvPhone" runat="server" ControlToValidate="txtPhone"
  97. Display="Dynamic" ErrorMessage="Invalid" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"></asp:RegularExpressionValidator></td>
  98. </tr>
  99. <tr>
  100. <td class="Listings">
  101. Fax
  102. </td>
  103. <td>
  104. <asp:TextBox cssclass="inputTXT" ID="txtFax" runat="server"></asp:TextBox>
  105. <ajax:TextBoxWatermarkExtender ID="wmxFax" runat="server" WatermarkCssClass="faintTXT"
  106. TargetControlID="txtFax" WatermarkText="nnn-nnn-nnnn">
  107. </ajax:TextBoxWatermarkExtender>
  108.  
  109. </td>
  110. <td class="Listings">
  111. <asp:RegularExpressionValidator ID="rxvFax" runat="server" ControlToValidate="txtFax"
  112. Display="Dynamic" ErrorMessage="Invalid" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"></asp:RegularExpressionValidator></td>
  113. </tr>
  114. <tr>
  115. <td class="Listings">
  116. E-mail</td>
  117. <td>
  118. <asp:TextBox cssclass="inputTXT" ID="txtEmail" runat="server"></asp:TextBox>
  119. <ajax:TextBoxWatermarkExtender ID="wmxEmail" runat="server" WatermarkCssClass="faintTXT"
  120. TargetControlID="txtEmail" WatermarkText="user@domain.com">
  121. </ajax:TextBoxWatermarkExtender>
  122. </td>
  123. <td class="Listings">
  124. <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail"
  125. Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="rxvEmail" runat="server" ControlToValidate="txtEmail"
  126. Display="Dynamic" ErrorMessage="Invalid" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>
  127. </tr>
  128. <tr>
  129. <td colspan="2" align="center">
  130. <asp:Button ID="btnSubmit" runat="server" Text="Send" Width="100px" />&nbsp;
  131. <input id="Reset1" size="" style="width: 100px" type="reset" value="Clear" /></td>
  132. </tr>
  133. </table>
  134. <!--</form>-->
  135. </asp:Content>
  136.  
Last edited by peter_budo; Dec 5th, 2008 at 12:29 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Light Poster
squarkman is offline Offline
42 posts
since Nov 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

The FORM is really there but you got to notice that this page is within a Masterpage. The FORM is declared within the Masterpage.
The current page you posted will be shown within the masterpage on the ContentPlaceHolder. So actually the form will be posted, does the customer get any response from the page?
Besides the response, the page will be posted back to itself (i think) after the button is being clicked. The data in the form will be lost if no viewstate is being set. Viewstate can be switched on and of. Either you can check within the form_load() event if the page is postedback. The actions can be to fill a new viewstate with the current field-values and reload the values from the viewstate after the page.IsPostback. That depends on how the fields are responding on the userinput. Reading your code the fields don't respond after the text has been changed so you can fill a viewstate in the button_click() event.

Regards,
Richard
The Netherlands
Reputation Points: 33
Solved Threads: 10
Junior Poster in Training
4advanced is offline Offline
67 posts
since Nov 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

yes the customer does.
Reputation Points: 10
Solved Threads: 0
Light Poster
squarkman is offline Offline
42 posts
since Nov 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

Hi,
I just checked the masterpage and found some <form> </form> tags but no real input this or input that stuff. What is the value of separating the <form> tags from the input stuff on aspx file?
Anyway I can't be concerned with that. Just trying to figure what I have to do to add a stupid field or two to this overgrown overdone coding which noone but the author can figure out.
Can anyone tell me how to add...let's say a new comment box..THAT'S ALL...just a new comment box to this a.asp file listed above?
Must I really edit the masterpage and six other pages just so I can add field. What has programming become? This is insane if you ask me.

I have wasted two days just trying to figure this out by myself. The idiot who wrote the site refuses to give the customer her backups which would solve every issue I'm trying to fix.

Please, help would be so appreciated.
Last edited by squarkman; Dec 5th, 2008 at 12:48 pm.
Reputation Points: 10
Solved Threads: 0
Light Poster
squarkman is offline Offline
42 posts
since Nov 2008
Dec 5th, 2008
0

Re: Simple ASP.NET form

First, nothing weird about the programmingstyle. Referring to inherits="feedback, App_Web_i5ksdbwd" i assume its being a compiled application.

If 'the idiot' which you are referring to, doesn't sent you or the client the uncompiled codepages I think you'll have a problem because the underlying code has been done in a code-behind page which (in design mode) functions besides the aspx page but after compiling it's unreadable..... (for hyjacking code)
Reputation Points: 33
Solved Threads: 10
Junior Poster in Training
4advanced is offline Offline
67 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How can i use Radiobutton in Asp.net using vb
Next Thread in ASP.NET Forum Timeline: How to read text file and display it in a messagebox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC