| | |
Simple ASP.NET form
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 42
Reputation:
Solved Threads: 0
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
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.
•
•
Join Date: Nov 2008
Posts: 42
Reputation:
Solved Threads: 0
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?
Is the form function hidden somewhere in aspx?
In anothre file perhaps?
asp.net Syntax (Toggle Plain Text)
<%@ page language="VB" masterpagefile="~/pages/airedale911.master" autoeventwireup="false" inherits="feedback, App_Web_i5ksdbwd" title="airedale911.org: Feedback" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server"> <h1> Airedale911's New Adoption Form In Progress</h1> <p> <strong>Instructions</strong> <p>All fields that require an answer will prompt you if you leave them blank or enter an invalid value. If there is no answer, please enter "n/a" into the field.</p> <p>Note that if you leave the form page without completing the on-line application, your answers will not be saved.</p> <p>If your form does not get submitted, check the error message shown and return to that field.</p><br /> </p> <table> <tr> <td class="Listings" valign="top" width="62"> Comments2 </td> <td class="Listings" width="303"> <asp:TextBox cssclass="inputTXT" TextMode="MultiLine" Rows="5" ID="txtComments2" runat="server"></asp:TextBox> </td> <td class="Listings" valign="top" width="50"> <asp:RequiredFieldValidator ID="rfvMailBody2" runat="server" ControlToValidate="txtComments" ErrorMessage="Required" Display="Dynamic"></asp:RequiredFieldValidator></td> </tr> <tr> <td class="Listings" valign="top" width="62"> Comments </td> <td class="Listings" width="303"> <asp:TextBox cssclass="inputTXT" TextMode="MultiLine" Rows="5" ID="txtComments" runat="server"></asp:TextBox> </td> <td class="Listings" valign="top" width="50"> <asp:RequiredFieldValidator ID="rfvMailBody" runat="server" ControlToValidate="txtComments" ErrorMessage="Required" Display="Dynamic"></asp:RequiredFieldValidator></td> </tr> <tr> <td class="Listings"> Category </td> <td class="Listings"> <asp:DropDownList runat="server" cssclass="inputDDL" ID="ddlCategory"> <asp:ListItem Selected="true">Web site</asp:ListItem> <asp:ListItem>Adoptions</asp:ListItem> <asp:ListItem>Events</asp:ListItem> <asp:ListItem>Donations</asp:ListItem> </asp:DropDownList> </td> <td class="Listings"> </td> </tr> <tr> <td colspan="3" class="Listings"> <b>Your Contact Information</b></td> </tr> <tr> <td class="Listings"> Name </td> <td> <asp:TextBox cssclass="inputTXT" ID="txtName" runat="server"></asp:TextBox></td> <td class="Listings"> <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName" Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator></td> </tr> <tr> <td class="Listings"> How many in your household? </td> <td> <asp:TextBox cssclass="inputTXT2" ID="txtName2" runat="server"></asp:TextBox></td> <td class="Listings"> <asp:RequiredFieldValidator ID="rfvName2" runat="server" ControlToValidate="txtName2" Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator></td> </tr> <tr> <td class="Listings"> Phone</td> <td> <asp:TextBox cssclass="inputTXT" ID="txtPhone" runat="server"></asp:TextBox> <ajax:TextBoxWatermarkExtender ID="wmxPhone" runat="server" WatermarkCssClass="faintTXT" TargetControlID="txtPhone" WatermarkText="nnn-nnn-nnnn"> </ajax:TextBoxWatermarkExtender> </td> <td class="Listings"> <asp:RequiredFieldValidator ID="rfvPhone" runat="server" ControlToValidate="txtPhone" Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="rxvPhone" runat="server" ControlToValidate="txtPhone" Display="Dynamic" ErrorMessage="Invalid" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"></asp:RegularExpressionValidator></td> </tr> <tr> <td class="Listings"> Fax </td> <td> <asp:TextBox cssclass="inputTXT" ID="txtFax" runat="server"></asp:TextBox> <ajax:TextBoxWatermarkExtender ID="wmxFax" runat="server" WatermarkCssClass="faintTXT" TargetControlID="txtFax" WatermarkText="nnn-nnn-nnnn"> </ajax:TextBoxWatermarkExtender> </td> <td class="Listings"> <asp:RegularExpressionValidator ID="rxvFax" runat="server" ControlToValidate="txtFax" Display="Dynamic" ErrorMessage="Invalid" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"></asp:RegularExpressionValidator></td> </tr> <tr> <td class="Listings"> E-mail</td> <td> <asp:TextBox cssclass="inputTXT" ID="txtEmail" runat="server"></asp:TextBox> <ajax:TextBoxWatermarkExtender ID="wmxEmail" runat="server" WatermarkCssClass="faintTXT" TargetControlID="txtEmail" WatermarkText="user@domain.com"> </ajax:TextBoxWatermarkExtender> </td> <td class="Listings"> <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail" Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="rxvEmail" runat="server" ControlToValidate="txtEmail" Display="Dynamic" ErrorMessage="Invalid" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td> </tr> <tr> <td colspan="2" align="center"> <asp:Button ID="btnSubmit" runat="server" Text="Send" Width="100px" /> <input id="Reset1" size="" style="width: 100px" type="reset" value="Clear" /></td> </tr> </table> <!--</form>--> </asp:Content>
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.
•
•
Join Date: Nov 2008
Posts: 63
Reputation:
Solved Threads: 10
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
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
•
•
Join Date: Nov 2008
Posts: 42
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Nov 2008
Posts: 63
Reputation:
Solved Threads: 10
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)
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)
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Simple ASP.Net Login Page using C# (C#)
- ASP.Net Security 101 Part 1 (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: How can i use Radiobutton in Asp.net using vb
- Next Thread: How to read text file and display it in a messagebox
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose feedback flash flv form formatdecimal forms formview gridview homeedition hosting iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols radio ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql-server sqlserver2005 suse textbox tracking typeof unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webarchitecture webdevelopemnt webservice xml youareanotmemberofthedebuggerusers






