<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://serverx.esri.com/ESRIBlogs/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>Using the Callback control framework with a map resource</title><link>http://serverx.esri.com/ESRIBlogs/blogs/arcgisserver/archive/2006/12/18/Using-the-Callback-control-framework-with-a-map-resource.aspx</link><description>Let&amp;#39;s build on the sample that Ryan put together and use the callback control framework to refresh a map control. In this case we need to send back callback results of the map control to the control being called back to (the callback button). To illustrate</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>re: Using the Callback control framework with a map resource</title><link>http://serverx.esri.com/ESRIBlogs/blogs/arcgisserver/archive/2006/12/18/Using-the-Callback-control-framework-with-a-map-resource.aspx#52</link><pubDate>Tue, 26 Dec 2006 10:29:01 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:52</guid><dc:creator>Mohamed Moustafa</dc:creator><description>please where i can find callback control framework ?</description></item><item><title>re: Using the Callback control framework with a map resource</title><link>http://serverx.esri.com/ESRIBlogs/blogs/arcgisserver/archive/2006/12/18/Using-the-Callback-control-framework-with-a-map-resource.aspx#54</link><pubDate>Wed, 27 Dec 2006 19:01:26 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:54</guid><dc:creator>Bryan Baker</dc:creator><description>&lt;p&gt;The CallbackResult class is part of the Web ADF. It builds on the client callback framework that is part of ASP.NET 2.0. It makes transferring information between server and browser easier. &lt;/p&gt;
&lt;p&gt;The WebControl abstract class, in the ESRI.ArcGIS.Web.UI.WebControls assembly, extends the ASP.NET WebControl class by adding the CallbackResults property. So any control that extends the Web ADF's WebControl can take advantage of the CallbackResults to send data.&lt;/p&gt;
</description></item><item><title>re: Using the Callback control framework with a map resource</title><link>http://serverx.esri.com/ESRIBlogs/blogs/arcgisserver/archive/2006/12/18/Using-the-Callback-control-framework-with-a-map-resource.aspx#62</link><pubDate>Mon, 08 Jan 2007 14:37:45 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:62</guid><dc:creator>David Jones</dc:creator><description>This method works fine against the map control, but against other controls, it doesn't work.  For instance, the scalebar control, lets say you update the units from miles to kilometers in code.  That doesn't produce item in the callbacklist on the scalebar, so there is no way of causing it to redraw without having something happen to the map (such as zoom in in, which does cause a item to be added to the scalebars callbackresults list).  Perhaps I am wrong, but I would think that updating the units would then create a call back result because the scalebar would need to be redrawn.

Code:
    protected void CallbackButton1_Clicked(object sender, EventArgs args)
    {
        ScaleBar1.BarUnits = ScaleBarUnits.Kilometers;
        ScaleBar1.BarColor = System.Drawing.Color.BlueViolet;
        ScaleBar1.BarHeight = 50;
        ScaleBar1.Refresh();


        CallbackButton1.CallbackResults.CopyFrom(ScaleBar1.CallbackResults);
	//doesn't do anything, no call back result on scalebar.
    }</description></item><item><title>re: Using the Callback control framework with a map resource</title><link>http://serverx.esri.com/ESRIBlogs/blogs/arcgisserver/archive/2006/12/18/Using-the-Callback-control-framework-with-a-map-resource.aspx#63</link><pubDate>Mon, 08 Jan 2007 19:34:45 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:63</guid><dc:creator>Ryan Olson</dc:creator><description>That is a good find. We have logged a bug for this problem in the ScaleBar.Refresh() method. There are 2 things you need to do to work around this problem. First of all, you need to call InitializeFunctionalities() on the Map control you are working with. This is because the ScaleBar.Refresh() checks to see if there are functionalities associated with the map and it assumes they will be initialized first. This will allow the scalebar image to refresh in a callback. The second thing you should do to workaround the background color is use a similar method for refreshing a control&amp;rsquo;s html when working with non-ADF controls.&amp;nbsp;
&lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial"&gt;Here is such a method:&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&lt;/font&gt; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;CallbackResult&lt;/span&gt;&lt;/font&gt; RefreshControlHtml(&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;Control&lt;/span&gt;&lt;/font&gt; 
control)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;


&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.IO.&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;StringWriter&lt;/span&gt;&lt;/font&gt; sw = &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;/font&gt; System.IO.&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;StringWriter&lt;/span&gt;&lt;/font&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;HtmlTextWriter&lt;/span&gt;&lt;/font&gt; writer = 
&lt;font color="blue"&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;/font&gt; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;HtmlTextWriter&lt;/span&gt;&lt;/font&gt;(sw);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
control.RenderControl(writer);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&lt;/font&gt; htmlContent = 
sw.ToString();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
sw.Close();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt;&lt;/font&gt; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;/font&gt; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;CallbackResult&lt;/span&gt;&lt;/font&gt;(control, &lt;font color="#a31515"&gt;&lt;span style="color: #a31515"&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;/font&gt;, 
htmlContent);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial"&gt;&amp;nbsp;&lt;br /&gt;You should add this result to the 
callback results of your ScaleBar. Note, you can use the RefreshControlHtml 
function with many different controls, like GridView, etc. Your code will end up 
looking something like this:&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;


&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;protected&lt;/span&gt;&lt;/font&gt; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;void&lt;/span&gt;&lt;/font&gt; CallbackButton1_Clicked(&lt;font color="blue"&gt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&lt;/font&gt; sender, &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt;&lt;/font&gt; 
args)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
Map1.InitializeFunctionalities();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScaleBar1.BackColor 
= System.Drawing.&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;Color&lt;/span&gt;&lt;/font&gt;.Lime;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScaleBar1.BarUnits = 
ESRI.ArcGIS.ADF.Web.&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;ScaleBarUnits&lt;/span&gt;&lt;/font&gt;.Feet; 
&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="green"&gt;&lt;span style="color: green"&gt;// the following line is necessary to 
change the back color because that is not part of the 
image&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-left: 0.5in"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;CallbackButton1.CallbackResults.Add(RefreshControlHtml(ScaleBar1));&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
ScaleBar1.Refresh();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CallbackButton1.CallbackResults.CopyFrom(ScaleBar1.CallbackResults);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&lt;/font&gt; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;CallbackResult&lt;/span&gt;&lt;/font&gt; RefreshControlHtml(&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;Control&lt;/span&gt;&lt;/font&gt; 
control)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.IO.&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;StringWriter&lt;/span&gt;&lt;/font&gt; sw = &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;/font&gt; System.IO.&lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;StringWriter&lt;/span&gt;&lt;/font&gt;();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;HtmlTextWriter&lt;/span&gt;&lt;/font&gt; writer = 
&lt;font color="blue"&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;/font&gt; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;HtmlTextWriter&lt;/span&gt;&lt;/font&gt;(sw);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
control.RenderControl(writer);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&lt;/font&gt; htmlContent = 
sw.ToString();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
sw.Close();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt;&lt;/font&gt; &lt;font color="blue"&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;/font&gt; &lt;font color="#2b91af"&gt;&lt;span style="color: #2b91af"&gt;CallbackResult&lt;/span&gt;&lt;/font&gt;(control, &lt;font color="#a31515"&gt;&lt;span style="color: #a31515"&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;/font&gt;, 
htmlContent);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
</description></item><item><title>re: Using the Callback control framework with a map resource</title><link>http://serverx.esri.com/ESRIBlogs/blogs/arcgisserver/archive/2006/12/18/Using-the-Callback-control-framework-with-a-map-resource.aspx#64</link><pubDate>Wed, 10 Jan 2007 08:53:52 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:64</guid><dc:creator>karimhamdy</dc:creator><description>&lt;p&gt;This method works fine with the map control only if i made a sipmle proccessing at the server ,but if i made something which takes time (5 sec) or i made a big change to the map sometimes it dosen't work.&lt;/p&gt;
&lt;p&gt;my case is generating a service area which takes about 3 or 4 sec but most probably it dosen't work &amp;quot;no change in the map unless i made any action on it like zomming &amp;quot; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
</description></item></channel></rss>