<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating a Page method (ScriptMethod) within an ASCX user control using AJAX, JSON, base classes and reflection</title>
	<atom:link href="http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/</link>
	<description>It&#039;s always time to upgrade!</description>
	<lastBuildDate>Sat, 19 Nov 2011 23:30:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Chad</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-2005</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Fri, 14 Oct 2011 21:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-2005</guid>
		<description>I&#039;m glad you figured that out. I was going to take a look at this weekend if I had time but that makes sense. I wrote this post before I started tooling around with jQuery and it&#039;s honestly nerveracking to look back at some of the hideous ASP.NET AJAX stuff I did before wondering how I did anything before using the jQuery framework.</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad you figured that out. I was going to take a look at this weekend if I had time but that makes sense. I wrote this post before I started tooling around with jQuery and it&#8217;s honestly nerveracking to look back at some of the hideous ASP.NET AJAX stuff I did before wondering how I did anything before using the jQuery framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-2002</link>
		<dc:creator>William</dc:creator>
		<pubDate>Fri, 14 Oct 2011 20:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-2002</guid>
		<description>Using jQuery to call the pagemethod solved the issue. The jQuery.ajax method includes the option to provide a custom xmlhttprequest, which I did, in order to keep the wanted settings enabling upload progress. I do not know the finer aspects of how jQuerys handles the xmlhttprequest object, but it is more robust than my initial approach.</description>
		<content:encoded><![CDATA[<p>Using jQuery to call the pagemethod solved the issue. The jQuery.ajax method includes the option to provide a custom xmlhttprequest, which I did, in order to keep the wanted settings enabling upload progress. I do not know the finer aspects of how jQuerys handles the xmlhttprequest object, but it is more robust than my initial approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1989</link>
		<dc:creator>William</dc:creator>
		<pubDate>Fri, 07 Oct 2011 12:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1989</guid>
		<description>By the way that only happens in IE, I am using version 9.</description>
		<content:encoded><![CDATA[<p>By the way that only happens in IE, I am using version 9.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1988</link>
		<dc:creator>William</dc:creator>
		<pubDate>Fri, 07 Oct 2011 12:42:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1988</guid>
		<description>I found that the xmlhttprequest should target the page that is hosting the usercontrol and more specifically the pagemethod &quot;PageServiceRequest&quot; webmethod of that page, for example TestPage.aspx/PageServiceRequest.

However this gives me another problem. the xmlhttprequest only works once after building the project. After that I get xmlhttprequest status 401 when calling the pagemethod (only when using xmlhttprequest). Any ideas?</description>
		<content:encoded><![CDATA[<p>I found that the xmlhttprequest should target the page that is hosting the usercontrol and more specifically the pagemethod &#8220;PageServiceRequest&#8221; webmethod of that page, for example TestPage.aspx/PageServiceRequest.</p>
<p>However this gives me another problem. the xmlhttprequest only works once after building the project. After that I get xmlhttprequest status 401 when calling the pagemethod (only when using xmlhttprequest). Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1987</link>
		<dc:creator>William</dc:creator>
		<pubDate>Thu, 06 Oct 2011 12:34:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1987</guid>
		<description>Hi, 

Normally a pagemethod can be called with an xmlhttprequest. This can be a benefit, if you for instance want to use a pagemethod to upload a file and you need some events of the xmlhttprequest for monitoring upload progress.

Do you think it would be possible to call this pagemethod as well from javascript using an xmlhttprequest? What would the URL be?</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>Normally a pagemethod can be called with an xmlhttprequest. This can be a benefit, if you for instance want to use a pagemethod to upload a file and you need some events of the xmlhttprequest for monitoring upload progress.</p>
<p>Do you think it would be possible to call this pagemethod as well from javascript using an xmlhttprequest? What would the URL be?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1976</link>
		<dc:creator>William</dc:creator>
		<pubDate>Fri, 23 Sep 2011 21:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1976</guid>
		<description>&gt; SafeControl Assembly=&quot;PageNameSpace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d4071b2b4b2b638&quot; Namespace=&quot;PageNameSpace&quot; TypeName=&quot;*&quot; Safe=&quot;True&quot; SafeAgainstScript=&quot;False&quot; /&lt;</description>
		<content:encoded><![CDATA[<p>&gt; SafeControl Assembly=&#8221;PageNameSpace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d4071b2b4b2b638&#8243; Namespace=&#8221;PageNameSpace&#8221; TypeName=&#8221;*&#8221; Safe=&#8221;True&#8221; SafeAgainstScript=&#8221;False&#8221; /&lt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1975</link>
		<dc:creator>William</dc:creator>
		<pubDate>Fri, 23 Sep 2011 21:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1975</guid>
		<description>Hi, 

I got it to work with SharePoint. 

I could not get the pageBaseType attribute in web.config to work in SharePoint. However that is not necessarily a problem. 

I changed the inherits attribute on the particular webpartpage where I wanted your functionality to:
Inherits=&quot;PageNameSpace.BasePage,PageNameSpace,Version=1.0.0.0,Culture=neutral,PublicKeyToken=1d4071b2b4b2b638&quot; %&gt;

And added a safeControls entry in web.config:


Now i have a visual webpart with pagemethods. Great! I appreciate your work.</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I got it to work with SharePoint. </p>
<p>I could not get the pageBaseType attribute in web.config to work in SharePoint. However that is not necessarily a problem. </p>
<p>I changed the inherits attribute on the particular webpartpage where I wanted your functionality to:<br />
Inherits=&#8221;PageNameSpace.BasePage,PageNameSpace,Version=1.0.0.0,Culture=neutral,PublicKeyToken=1d4071b2b4b2b638&#8243; %&gt;</p>
<p>And added a safeControls entry in web.config:</p>
<p>Now i have a visual webpart with pagemethods. Great! I appreciate your work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1779</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Wed, 22 Jun 2011 13:57:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1779</guid>
		<description>I&#039;m not sure what you would have to do to get this working in SharePoint. I imagine it would be possible, however you will want to ensure that the library/assembly that you&#039;ve implemented the base page in is in your SharePoint \bin\ directory or is strongly named and stored in the GAC. You may also have to modify the logic to no longer use a base page but rather a base web part and ensure the mappings are correct.

Also, with SharePoint I believe there is a different type of base page that the pages in SharePoint use, so your new base page (ScharfHoldings.BasePage) would need to inherit from that in order for it to be usable by any SharePoint page. 

I imagine this is what the app is gawking at in the web.config, and that would only be becuase the runtime cannot find the type listed:
&lt;...pages &lt;em&gt;pageBaseType=&quot;ScharfHoldings.BasePage&quot;&lt;/em&gt; userControlBaseType=&quot;ScharfHoldings.BaseUserControl&quot; ... /&gt;
I would suggest putting the base page and page user control in thier own assembly project, then putting that assembly in the \bin\ directory for your sharepoint instance, otherwise it wouldn&#039;t be able to find that from your web-part project. You will also probably want to ensure BaseUserControl inherits from WebPart instead of UserControl if you&#039;re building a web-part project.

Thanks,
Chad</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure what you would have to do to get this working in SharePoint. I imagine it would be possible, however you will want to ensure that the library/assembly that you&#8217;ve implemented the base page in is in your SharePoint \bin\ directory or is strongly named and stored in the GAC. You may also have to modify the logic to no longer use a base page but rather a base web part and ensure the mappings are correct.</p>
<p>Also, with SharePoint I believe there is a different type of base page that the pages in SharePoint use, so your new base page (ScharfHoldings.BasePage) would need to inherit from that in order for it to be usable by any SharePoint page. </p>
<p>I imagine this is what the app is gawking at in the web.config, and that would only be becuase the runtime cannot find the type listed:<br />
&lt;&#8230;pages <em>pageBaseType=&#8221;ScharfHoldings.BasePage&#8221;</em> userControlBaseType=&#8221;ScharfHoldings.BaseUserControl&#8221; &#8230; /&gt;<br />
I would suggest putting the base page and page user control in thier own assembly project, then putting that assembly in the \bin\ directory for your sharepoint instance, otherwise it wouldn&#8217;t be able to find that from your web-part project. You will also probably want to ensure BaseUserControl inherits from WebPart instead of UserControl if you&#8217;re building a web-part project.</p>
<p>Thanks,<br />
Chad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: govind</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-1778</link>
		<dc:creator>govind</dc:creator>
		<pubDate>Wed, 22 Jun 2011 08:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-1778</guid>
		<description>Hi,

Thanks for wonderful article. I am trying to implement the above logic in SHarePoint environment. Is it possible to get it done or not. I get get for the web.confg entry.Error message &quot;Could not load type &#039;ScharfHoldings.BasePage&#039;.
&quot;.
Do i need to pass the assembly details. If yes then in which attribute should i pass on. 

Kindly let me know if it is possible tough.

Thanks 
Govind.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for wonderful article. I am trying to implement the above logic in SHarePoint environment. Is it possible to get it done or not. I get get for the web.confg entry.Error message &#8220;Could not load type &#8216;ScharfHoldings.BasePage&#8217;.<br />
&#8220;.<br />
Do i need to pass the assembly details. If yes then in which attribute should i pass on. </p>
<p>Kindly let me know if it is possible tough.</p>
<p>Thanks<br />
Govind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manpreet Padam</title>
		<link>http://www.chadscharf.com/index.php/2009/11/creating-a-page-method-scriptmethod-within-an-ascx-user-control-using-ajax-json-base-classes-and-reflection/comment-page-1/#comment-580</link>
		<dc:creator>Manpreet Padam</dc:creator>
		<pubDate>Fri, 23 Apr 2010 18:59:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.chadscharf.com/?p=51#comment-580</guid>
		<description>Hi,

I was trying webmethods in a similar scenario that you explained it and I tumbled upon your neat solution. Works like a charm.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I was trying webmethods in a similar scenario that you explained it and I tumbled upon your neat solution. Works like a charm.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

