Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Francesco 8 posts 20 karma points
    Jan 15, 2009 @ 15:32
    Francesco
    0

    Setting Page Directives

    Hi,

    i'm working on a small .net control to send email from umbraco. I would like to use the System.net.Mail.SmtpClient object. I need to use the SendAsync() method of the object but to do so i need to set the page directive Async to true

    [quote]<%@Page Async="true" @%>[/quote]

    Is it possibile from umbraco? Any alternative method to async send mails?

    thx in advance

    Francesco

  • Ruben Verborgh 379 posts 30 karma points
    Jan 15, 2009 @ 18:04
    Ruben Verborgh
    0

    Hi again Francesco,

    I have successfully sent a mail asynchronously without setting the Async property in the page directive actually... Would that be really necessary?

    Cheers,

    Ruben

  • Francesco 8 posts 20 karma points
    Jan 16, 2009 @ 11:31
    Francesco
    0

    Hi again Ruben :)

    In my page, when i invoke the SendAsync() method i recive this .net notification

    [quote]Server Error in '/' Application.
    Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
    [/quote]

    Anyway, all tutorials i found on internet say that the page directive must be set!

    cheers

    Francesco

  • Francesco 8 posts 20 karma points
    Jan 20, 2009 @ 15:10
    Francesco
    0

    hello, any news?

  • Ronny Birkeli 3 posts 20 karma points
    Apr 08, 2009 @ 21:25
    Ronny Birkeli
    0

    Hi!

    I also have the need to add a page directive, but having trouble doing this.

    I've created a form with some hidden fields that contains HTML code. When submitting the form get a HttpRequestValidationException. This can only be controlled by a page directive or web.config setting (as far as I know).

    When I open the default.aspx I see that validateRequest="false" is already set. But it doesn't seem to have any effect. I've also tried to set validateRequest="false"> in web.config - but with no luck.

    How exactly are page directives handled in Umbraco? Is it possible to set them on a individual page by page basis - or is it one for all?

    Thanks

    Ronny

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 27, 2009 @ 12:03
    Jan Skovgaard
    0

    Hi Ronny

    What version of Umbraco are you using? And is this still an issue for you?

    If you are using v4 you could add the following in you masterpage (in the templates section)

    <script runat="server"><br />
            protected void Page_Init(object sender, EventArgs e)<br />
            {<br />
                ((umbraco.UmbracoDefault)this.Page).ValidateRequest = false;<br />
            }<br />
    </script>
  • Dimitris Chrysomallis 21 posts 73 karma points
    Jun 14, 2011 @ 11:30
    Dimitris Chrysomallis
    0

    @Jan, the following?

Please Sign in or register to post replies

Write your reply to:

Draft