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?
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!
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?
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
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
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
hello, any news?
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
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)
@Jan, the following?
is working on a reply...