FORM

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dancer

    FORM

    I have created a form in ASP.NET.
    Now how do I get the results on another page (a pretty one) and email to
    myself?


  • Jon  Paal [MSMD]

    #2
    Re: FORM

    what you need is in here:





    "dancer" <dancer@microso ft.comwrote in message news:ucnWzEXkHH A.208@TK2MSFTNG P05.phx.gbl...
    >I have created a form in ASP.NET.
    Now how do I get the results on another page (a pretty one) and email to myself?
    >

    Comment

    • dancer

      #3
      Re: FORM

      This link will not appear on my computer. I rebooted to see if I had too
      many things open. Still not. Only the hour glass forever.
      I entered the site by hand and received the following message:

      We're sorry. The Web address you entered is not a functioning page on our
      site

      ????

      "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere dot comwrote in message
      news:eLkuSPXkHH A.3656@TK2MSFTN GP06.phx.gbl...
      what you need is in here:
      >

      >
      >
      >
      "dancer" <dancer@microso ft.comwrote in message
      news:ucnWzEXkHH A.208@TK2MSFTNG P05.phx.gbl...
      >>I have created a form in ASP.NET.
      >Now how do I get the results on another page (a pretty one) and email to
      >myself?
      >>
      >
      >

      Comment

      • Alexey Smirnov

        #4
        Re: FORM

        On May 8, 3:02 pm, "dancer" <dan...@microso ft.comwrote:
        I have created a form in ASP.NET.
        Now how do I get the results on another page (a pretty one) and email to
        myself?
        you can use the same "page"

        <% @Import Namespace="Syst em.Web.Mail" %>
        <script language="vb" runat="server">

        Sub btnSendFeedback _Click(sender as Object, e as EventArgs)

        'Create an instance of the MailMessage class
        Dim objMM as New MailMessage()

        'Set the properties - send the email to the person who filled out
        the
        'feedback form.
        objMM.To = "webmaster@your site.com"
        objMM.From = txtEmail.Text

        'If you want to CC this email to someone else, uncomment the line
        below
        'objMM.Cc = "someone@somead dress.com"

        'If you want to BCC this email to someone else, uncomment the line
        below
        'objMM.Bcc = "someone@somead dress.com"

        'Send the email in text format
        objMM.BodyForma t = MailFormat.Text
        '(to send HTML format, change MailFormat.Text to MailFormat.Html )

        'Set the priority - options are High, Low, and Normal
        objMM.Priority = MailPriority.No rmal

        'Set the subject
        objMM.Subject = "4GuysFromRolla .com - Feedback"

        'Set the body
        objMM.Body = "At " + DateTime.Now + " feedback was sent from an
        ASP.NET " & _
        "Web page. Below you will find the feedback message "
        & _
        "send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
        "---------------------------------------" & vbCrLf &
        vbCrLf & _
        txtMessage.Text & vbCrLf


        'Specify to use the default Smtp Server
        SmtpMail.SmtpSe rver = ""

        'Now, to send the message, use the Send method of the SmtpMail class
        SmtpMail.Send(o bjMM)


        panelSendEmail. Visible = false
        panelMailSent.V isible = true
        End Sub

        </script>

        <html>
        <body>
        <asp:panel id="panelSendEm ail" runat="server">
        <form runat="server">
        <h2>We are interested in your feedback! Please enter the
        following
        requested information below to send us your comments.</h2>

        <b>Your Name:</b>
        <asp:textbox id="txtName" runat="server" />
        <br>

        <b>Your Email Address:</b>
        <asp:textbox id="txtEmail" runat="server" />
        <p>

        <b>Your Message:</b><br>
        <asp:textbox id="txtMessage " TextMode="Multi Line"
        Columns="40" Rows="10" runat="server" />
        <p>

        <asp:button runat="server" id="btnSendFeed back" Text="Send
        Feedback!"
        OnClick="btnSen dFeedback_Click " />
        </form>
        </asp:panel>


        <asp:panel id="panelMailSe nt" runat="server" Visible="False" >
        An email has been sent to the email address you specified.
        Thanks!
        </asp:panel>
        </body>
        </html>

        eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 


        Comment

        • dancer

          #5
          Re: FORM

          This code works well alone. When I enter it into the page where I want to
          use it, I get this error:

          Unexpected end of file looking for </formtag.

          I HAVE a </formtag.
          I am not using Visual Studio. It is simple ASP.NET coded in notepad.

          Any ideas?




          "Alexey Smirnov" <alexey.smirnov @gmail.comwrote in message
          news:1178648486 .446319.3630@l7 7g2000hsb.googl egroups.com...
          On May 8, 3:02 pm, "dancer" <dan...@microso ft.comwrote:
          >I have created a form in ASP.NET.
          >Now how do I get the results on another page (a pretty one) and email to
          >myself?
          >
          you can use the same "page"
          >
          <% @Import Namespace="Syst em.Web.Mail" %>
          <script language="vb" runat="server">
          >
          Sub btnSendFeedback _Click(sender as Object, e as EventArgs)
          >
          'Create an instance of the MailMessage class
          Dim objMM as New MailMessage()
          >
          'Set the properties - send the email to the person who filled out
          the
          'feedback form.
          objMM.To = "webmaster@your site.com"
          objMM.From = txtEmail.Text
          >
          'If you want to CC this email to someone else, uncomment the line
          below
          'objMM.Cc = "someone@somead dress.com"
          >
          'If you want to BCC this email to someone else, uncomment the line
          below
          'objMM.Bcc = "someone@somead dress.com"
          >
          'Send the email in text format
          objMM.BodyForma t = MailFormat.Text
          '(to send HTML format, change MailFormat.Text to MailFormat.Html )
          >
          'Set the priority - options are High, Low, and Normal
          objMM.Priority = MailPriority.No rmal
          >
          'Set the subject
          objMM.Subject = "4GuysFromRolla .com - Feedback"
          >
          'Set the body
          objMM.Body = "At " + DateTime.Now + " feedback was sent from an
          ASP.NET " & _
          "Web page. Below you will find the feedback message "
          & _
          "send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
          "---------------------------------------" & vbCrLf &
          vbCrLf & _
          txtMessage.Text & vbCrLf
          >
          >
          'Specify to use the default Smtp Server
          SmtpMail.SmtpSe rver = ""
          >
          'Now, to send the message, use the Send method of the SmtpMail class
          SmtpMail.Send(o bjMM)
          >
          >
          panelSendEmail. Visible = false
          panelMailSent.V isible = true
          End Sub
          >
          </script>
          >
          <html>
          <body>
          <asp:panel id="panelSendEm ail" runat="server">
          <form runat="server">
          <h2>We are interested in your feedback! Please enter the
          following
          requested information below to send us your comments.</h2>
          >
          <b>Your Name:</b>
          <asp:textbox id="txtName" runat="server" />
          <br>
          >
          <b>Your Email Address:</b>
          <asp:textbox id="txtEmail" runat="server" />
          <p>
          >
          <b>Your Message:</b><br>
          <asp:textbox id="txtMessage " TextMode="Multi Line"
          Columns="40" Rows="10" runat="server" />
          <p>
          >
          <asp:button runat="server" id="btnSendFeed back" Text="Send
          Feedback!"
          OnClick="btnSen dFeedback_Click " />
          </form>
          </asp:panel>
          >
          >
          <asp:panel id="panelMailSe nt" runat="server" Visible="False" >
          An email has been sent to the email address you specified.
          Thanks!
          </asp:panel>
          </body>
          </html>
          >
          eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 

          >

          Comment

          • Jon  Paal [MSMD]

            #6
            Re: FORM

            the link is correct, try again later.


            "dancer" <dancer@microso ft.comwrote in message news:uvqvhqZkHH A.4248@TK2MSFTN GP06.phx.gbl...
            This link will not appear on my computer. I rebooted to see if I had too many things open. Still not. Only the hour glass
            forever.
            I entered the site by hand and received the following message:
            >
            We're sorry. The Web address you entered is not a functioning page on our site
            >
            ????
            >
            "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:eLkuSPXkHH A.3656@TK2MSFTN GP06.phx.gbl...
            >what you need is in here:
            >>
            >http://msconline.maconstate.edu/tuto...20/default.htm
            >>
            >>
            >>
            >"dancer" <dancer@microso ft.comwrote in message news:ucnWzEXkHH A.208@TK2MSFTNG P05.phx.gbl...
            >>>I have created a form in ASP.NET.
            >>Now how do I get the results on another page (a pretty one) and email to myself?
            >>>
            >>
            >>
            >
            >

            Comment

            • Alexey Smirnov

              #7
              Re: FORM

              On May 9, 1:43 am, "dancer" <dan...@microso ft.comwrote:
              This code works well alone.
              So, it works, and the problem is in your code
              When I enter it into the page where I want to
              use it, I get this error:
              Unexpected end of file looking for </formtag.
              >
              A code please.


              Comment

              • dancer

                #8
                Re: FORM

                Here is the code: I'll be very grateful if you can find my error.

                <html>
                <head>
                <% @Import Namespace="Syst em.Web.Mail" %>
                <script language="VB" runat="server">


                Sub btnSendFeedback _Click(sender as Object, e as EventArgs)

                'Create an instance of the MailMessage class
                Dim objMM as New MailMessage()

                'Set the properties - send the email to the person who filled out
                the
                'feedback form.
                objMM.To = "xxxxxxxx@xxxxx xxx.com"

                objMM.From = "xxxxxxxxx@xxxx xxxx.com"
                'send in html format
                objMM.BodyForma t = MailFormat.Html
                'Set the priority - options are High, Low, and Normal
                objMM.Priority = MailPriority.No rmal

                'Set the subject
                objMM.Subject = "4GuysFromRolla .com - Feedback"

                'Set the body
                objMM.Body = "At " + DateTime.Now + " feedback was sent from an
                ASP.NET " & _
                "Web page. Below you will find the feedback message " & _
                "send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
                "---------------------------------------" & vbCrLf &vbCrLf & _
                txtMessage.Text & vbCrLf

                'Specify to use the default Smtp Server
                SmtpMail.SmtpSe rver = ""
                'Now, to send the message, use the Send method of the SmtpMail class
                SmtpMail.Send(o bjMM)
                panelSendEmail. Visible = false
                panelMailSent.V isible = true
                End Sub


                </script>

                </head>


                <body>
                <table width="750" bgcolor="#E9EDF 4" table border="1"
                cellpadding="3" >
                <h3><center><fo nt face="Verdana"> Wheeler's Accident Investigation
                Form</font></h3>



                <hr>
                <%--_______________ _______________ _______________ _______________ _______________ _--% <%--ROW 1--% <td width="250" valign="top" <form runat="server" <font face="Verdana" Size="2" Location where accident occurred: <asp:textbox id="Location"ru nat=server Width="200"/ </td <td align="right" valign="top" width="225" <font face="Verdana" Size="2">Employ er's Premises <asp:CheckBox id=Check1 Text="yes" runat="server" / <asp:CheckBox id=Check2 Text="no" runat="server" / <br Job site <asp:CheckBox id=Check3 Text="yes" runat="server" / <asp:CheckBox id=Check4 Text="no" runat="server" / </td <td <font face="Verdana" Size="2">Date of accident</font><br<asp:te xtbox id="Date" runat=server Width="100"/ </td <%--_______________ _______________ _______________ _______________ _______________ _--%><%--ROW 2--% <tr<td <font face="Verdana" Size="2">Who was injured?</font><br<asp:te xtbox id="Who" runat=server width="200"/ </td <td align= "left" <font face="Verdana" Size="2">Employ ee <asp:CheckBox id=Check5runat= "server" / <br Non-employee <asp:CheckBox id=Check6 runat="server" / </td <td align="right">< font face="Verdana" Size="2" Time of accident a.m. <asp:textbox id="am" runat=server Width="90"/ p.m. <asp:textbox id="pm" runat=server Width="90"/ </TD<%--_______________ _______________ _______________ _______________ _______________ _--%><%--ROW 3--% <tr <td<font face="Verdana" Size="2">Date of Hire <br<asp:textb ox id="Hiredate"ru nat=server/ </td <td<font face="Verdana" Size="2">Job Title or Occupation <br><asp:textbo xid="occupation " runat=server width="200"/ </td <td <font face="Verdana" Size="2">How long has employee worked at jobwhere injury occurred?<br><a sp:textbox id="lengthofjob " runat=server/ </td<%--_______________ _______________ _______________ _______________ _______________ _--%><%--Row 4--% &nbsp&nbsp <p <asp:Label id=Label1 font-name="arial" font-size="10pt"runa t="server"/><!Copied from /smirnof<asp:pan el id="panelSendEm ail" runat="server"< h2>We are interested in your feedback! Please enter the following requested information below to send us your comments.</h2<b>Your Name:</b<asp:textbox id="txtName" runat="server" /<br<b>Your Message:</b><br<asp:textb ox id="txtMessage " TextMode="Multi Line" Columns="40" Rows="10" runat="server" /<p<asp:button runat="server" id="btnSendFeed back" Text="SendFeedb ack!" OnClick="btnSen dFeedback_Click " / </form </asp:panel <asp:panel id="panelMailSe nt" runat="server" Visible="False" An email has been sent to the email address you specified. Thanks! </asp:panel </body></html>"Alexey Smirnov" <alexey.smirnov @gmail.comwrote in messagenews:117 8697021.511875. 39630@y80g2000h sf.googlegroups .com...On May 9, 1:43 am, "dancer" <dan...@microso ft.comwrote:>Th is code works well alone.>So, it works, and the problem is in your code>>When I enter it into the page where I want to>use it, I get this error:>Unexpect ed end of file looking for </formtag.>>>A code please.>>

                Comment

                • Mark Rae

                  #9
                  Re: FORM

                  "dancer" <dancer@microso ft.comwrote in message
                  news:unJZGhkkHH A.4852@TK2MSFTN GP03.phx.gbl...
                  Here is the code: I'll be very grateful if you can find my error.
                  Hmm - I may be wrong here, but don't all webcontrols need to be inside the
                  <formtag...?

                  --


                  Comment

                  • dancer

                    #10
                    Re: FORM

                    Yep!
                    When I moved the </formto AFTER the other controls, it worked. Thank
                    you!
                    Now, how can I get it to send the info from the WHOLE form on the page, and
                    not just some text?


                    "Mark Rae" <mark@markNOSPA Mrae.netwrote in message
                    news:%23DHNatkk HHA.3264@TK2MSF TNGP04.phx.gbl. ..
                    "dancer" <dancer@microso ft.comwrote in message
                    news:unJZGhkkHH A.4852@TK2MSFTN GP03.phx.gbl...
                    >
                    >Here is the code: I'll be very grateful if you can find my error.
                    >
                    Hmm - I may be wrong here, but don't all webcontrols need to be inside the
                    <formtag...?
                    >
                    --
                    http://www.markrae.net

                    Comment

                    • Mark Rae

                      #11
                      Re: FORM

                      "dancer" <dancer@microso ft.comwrote in message
                      news:eMkbRGlkHH A.1340@TK2MSFTN GP04.phx.gbl...
                      When I moved the </formto AFTER the other controls, it worked. Thank
                      you!
                      Welcome.


                      --


                      Comment

                      • David

                        #12
                        Re: FORM

                        Mark,

                        Not quite... you can have literal outside. In fact, I have used it in the
                        header to change the page title or meta tags (though I have started a thread
                        related to literal tags.). There may be other controls as well that you can
                        have outside your form tag. (Obviously, buttons, form fields etc have to be
                        inside)

                        --
                        Best regards,
                        Dave Colliver.

                        ~~
                        http://www.FOCUSPortals.com - Local franchises available

                        "Mark Rae" <mark@markNOSPA Mrae.netwrote in message
                        news:%23DHNatkk HHA.3264@TK2MSF TNGP04.phx.gbl. ..
                        "dancer" <dancer@microso ft.comwrote in message
                        news:unJZGhkkHH A.4852@TK2MSFTN GP03.phx.gbl...
                        >
                        >Here is the code: I'll be very grateful if you can find my error.
                        >
                        Hmm - I may be wrong here, but don't all webcontrols need to be inside the
                        <formtag...?
                        >
                        --
                        http://www.markrae.net

                        Comment

                        • Alexey Smirnov

                          #13
                          Re: FORM

                          On May 9, 5:48 pm, "dancer" <dan...@microso ft.comwrote:
                          Yep!
                          When I moved the </formto AFTER the other controls, it worked. Thank
                          you!
                          Now, how can I get it to send the info from the WHOLE form on the page, and
                          not just some text?
                          >
                          "Mark Rae" <m...@markNOSPA Mrae.netwrote in message
                          >
                          news:%23DHNatkk HHA.3264@TK2MSF TNGP04.phx.gbl. ..
                          >
                          >
                          >
                          "dancer" <dan...@microso ft.comwrote in message
                          news:unJZGhkkHH A.4852@TK2MSFTN GP03.phx.gbl...
                          >
                          Here is the code: I'll be very grateful if you can find my error.
                          >
                          Hmm - I may be wrong here, but don't all webcontrols need to be inside the
                          <formtag...?
                          >
                          --
                          http://www.markrae.net- Hide quoted text -
                          >
                          - Show quoted text -
                          As in the given example you have to reference the controls on the ASPX
                          page

                          Date.Text gives a text of the Date control (Date of accident)
                          CheckBox1.Check ed gives true of false of the CheckBox1 (Employer's
                          Premises)
                          etc.

                          Comment

                          • dancer

                            #14
                            Re: FORM

                            OK, I did that. (Referenced the controls to get the other answers to the
                            form to appear.)
                            Now, how do I get the email to be formatted in the same fashion as the form
                            that the user fills out?
                            Thank you.


                            "Alexey Smirnov" <alexey.smirnov @gmail.comwrote in message
                            news:1178732903 .084951.269160@ w5g2000hsg.goog legroups.com...
                            On May 9, 5:48 pm, "dancer" <dan...@microso ft.comwrote:
                            >Yep!
                            >When I moved the </formto AFTER the other controls, it worked. Thank
                            >you!
                            >Now, how can I get it to send the info from the WHOLE form on the page,
                            >and
                            >not just some text?
                            >>
                            >"Mark Rae" <m...@markNOSPA Mrae.netwrote in message
                            >>
                            >news:%23DHNatk kHHA.3264@TK2MS FTNGP04.phx.gbl ...
                            >>
                            >>
                            >>
                            "dancer" <dan...@microso ft.comwrote in message
                            >news:unJZGhkkH HA.4852@TK2MSFT NGP03.phx.gbl.. .
                            >>
                            >Here is the code: I'll be very grateful if you can find my error.
                            >>
                            Hmm - I may be wrong here, but don't all webcontrols need to be inside
                            the
                            <formtag...?
                            >>
                            --
                            >http://www.markrae.net- Hide quoted text -
                            >>
                            >- Show quoted text -
                            >
                            As in the given example you have to reference the controls on the ASPX
                            page
                            >
                            Date.Text gives a text of the Date control (Date of accident)
                            CheckBox1.Check ed gives true of false of the CheckBox1 (Employer's
                            Premises)
                            etc.
                            >

                            Comment

                            Working...