<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Networking and Web Services</title><link>http://forums.asp.net/1009.aspx</link><description>Discuss your issues with the client and server interaction in AJAX using web services and other transports used by AJAX</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: update cookie from webmethod (PageMethod) using ajax</title><link>http://forums.asp.net/thread/2589153.aspx</link><pubDate>Fri, 29 Aug 2008 14:53:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2589153</guid><dc:creator>shyamasndr</dc:creator><author>shyamasndr</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2589153.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2589153</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;Yes! &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;It is possible from server side if I remove line &amp;#39;throw ex&amp;#39; code in the below code.&amp;nbsp;but I&amp;nbsp;was trying to update the cookie on error in webmethod. Something likes this.&lt;/font&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;try&lt;/span&gt;
{ 

}
&lt;span class="kwd"&gt;catch&lt;/span&gt;(Exception ex)
{
   HttpContext.Current.Response.Cookies[“ck”].&lt;span class="kwd"&gt;value&lt;/span&gt;=”&lt;span class="kwd"&gt;value&lt;/span&gt;”;
   &lt;span class="kwd"&gt;throw&lt;/span&gt; ex;
}
&lt;/pre&gt;&amp;nbsp; 
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Times New Roman" size="3"&gt;On this scenario it is not updating.&lt;/font&gt; Thanks for your quick response. 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: update cookie from webmethod (PageMethod) using ajax</title><link>http://forums.asp.net/thread/2588790.aspx</link><pubDate>Fri, 29 Aug 2008 12:41:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2588790</guid><dc:creator>Sharbel_</dc:creator><author>Sharbel_</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2588790.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2588790</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I dont believe this is possible serverside, however, why not set the cookie in the OnSucess javascript method, with the key/value provided from the web-method?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>update cookie from webmethod (PageMethod) using ajax</title><link>http://forums.asp.net/thread/2588737.aspx</link><pubDate>Fri, 29 Aug 2008 12:13:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2588737</guid><dc:creator>shyamasndr</dc:creator><author>shyamasndr</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2588737.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2588737</wfw:commentRss><description>&lt;p&gt;I have one requirement&amp;nbsp; where I want to update cookie from a webmethod. The webmethod is called from ajax using PageMethods.&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Here is how my&amp;nbsp;.aspx page&amp;nbsp;looks like&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;In code behind&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;[webmethod]&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;static&lt;/font&gt;&lt;font size="2"&gt; void updateCookie(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; arg1)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;//some code to update cookie&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;in javascript I call the method using ajax&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;PageMethods.updateCookie(&lt;font size="2"&gt;arg1, OnSuccess, OnError, OnTimeout)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;but this does not updates cookie. Is their any way to update cookie from webmethod?&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>