Expresion web forms submit

Discussion in 'ASP.NET 2.0' started by cae, Apr 4, 2007.

  1. cae

    cae

    I created a feedback asp.net form with expresion web - all validations work like entercorrect email, required fields etc. work- including when you hit the submit button it takes you to a specific page - However not sure if content going anywhere at all - how do I make the form content to be mailed to a specific email address? - with frontpage I was able to do this at form properties - EW, I could not find this -
     
  2. You should be able to open EWD, and open your forms page via Design view. Right click on your Submit button and you should get a windows that allows you to access the properties of that object. This will then give you the ability to set the target email address.




    Raymond


    DiscountASP.NET
    http://www.DiscountASP.NET
     
  3. cae

    cae

    This is not HTML form, it is a ASP form. When I right click submit key it gives a menu of tag properties. In this I was able to put postback url but there is no place for email. Are we talking the same thing if yes can you give me the name and location because I can not see it. When I push the submit button it works takes the user to the confirmation.aspx page. However, I need a way to get the input. I prefer to a specific email. Do you know how?
     
  4. Unfortunate the feature you are looking for requires frontpage server extensions. You can install it on your account by logging into your dasp control panel and under IIS Maanger/FrontPage Extensions Install FrontPage Server Extensions. Once this is done, you should be able to open your web page, go to design view, left click on the Submit button then right click it to open the menu bar. On the list you will see Form Properties. It will open the Form Properties window where you can add the email address and the location of the file where the data will be sent to. Please review the screen shots I have provided.

    Keep in mind although this is an option that is available on our shared hosting environment, it may not be available in the future. It appears that microsoft has plans of dropping frontpage server extensions. There has been some discussions with the community forum whether the EWD developement team will replace frontpage server extensions with another tool. My guess on this is as good as yours. I myself do not care too much for frontpage extensions. Some of the features it comes with is nice, but the difficulties of managing it, and the inherent properties of altering file systems security out weights the benefits.



    Raymond


    DiscountASP.NET
    http://www.DiscountASP.NET
     

    Attached Files:

    • ewd.JPG
      ewd.JPG
      File size:
      27.6 KB
      Views:
      311
  5. Cae,
    Try modifying your code from..

    SmtpClient("smtp.xxxx.com");


    SmtpClient("localhost");
















    Raymond


    DiscountASP.NET
    http://www.DiscountASP.NET
     
  6. cae

    cae

    Raymond:


    Thank you for your help.


    I did and it works fine now.
     
  7. cae

    cae

    Raymond:


    Thank you but the one you are talking is a HTML component of EW. It works like old front page, piece of cake. Of course, I installed frontpage extension. If you check the asp.net component, you will see that you can not do this. I guess ASP.net send the form to itself and you need a code. I got the code, discountasp.net says you need to use "localhost" instead of smtp. Not sure if it is as easy as to change the words to the below code. Can you help? Than you.


    The code from<a target="_blank" href="http://Jimcobooks.com">http://Jimcobooks.comside</A> from Jim Cheshire. It works. But support is saying, I must use "localhost" instead of "smtp". I will try but not sure if it as easy as replacing words. Let me know if you can help. Thanks.
    <script runat="server">
    >>
    >> protected void Page_Load(object sender, EventArgs e)
    >> {
    >>
    >> if (IsPostBack)
    >> {
    >>
    >> SmtpClient sc = new
    >> SmtpClient("smtp.xxxx.com");
    >> StringBuilder sb = new StringBuilder();
    >> MailMessage msg = null;
    >>
    >> sb.Append("Email from: " + txtEmail.Text + "\n");
    >> sb.Append("Message : " + txtMessage.Text + "\n");
    >>
    >> try
    >> {
    >> msg = new MailMessage(txtEmail.Text,
    >> "xxxxxxxx", "Message
    >> from Web Site",
    >> sb.ToString());
    >>
    >> sc.Send(msg);
    >> }
    >> catch(Exception ex)
    >> {
    >>
    >> // something bad happened
    >> Response.Write("Something bad happened!");
    >>
    >> }
    >> finally
    >> {
    >>
    >> if (msg != null)
    >> {
    >> msg.Dispose();
    >>
    >> }
    >>
    >> }
    >>
    >> }
    >>
    >> }
    >>
    >> </script>
     

Share This Page