<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>All things .NET and beyond - General</title>
    <link>http://www.fluxtah.com/</link>
    <description>Ian (Fluxtah) Warwick's blog</description>
    <language>en-us</language>
    <copyright>Ian Warwick</copyright>
    <lastBuildDate>Sun, 08 Mar 2009 15:59:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>fluxtah@hotmail.com</managingEditor>
    <webMaster>fluxtah@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:comment>http://www.fluxtah.com/CommentView,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</wfw:comment>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A cool thing, did not realise this, you can use a @MasterType directive in an ASP.NET
page to strongly type the Master property, quite cool. 
</p>
        <pre>&lt;%@ MasterType TypeName="BaseMaster" %&gt;</pre>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e" />
      </body>
      <title>ASP.NET MasterType Directive</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</guid>
      <link>http://www.fluxtah.com/2009/03/08/ASPNETMasterTypeDirective.aspx</link>
      <pubDate>Sun, 08 Mar 2009 15:59:00 GMT</pubDate>
      <description>&lt;p&gt;
A&amp;nbsp;cool thing, did not realise this, you can use a @MasterType directive in an&amp;nbsp;ASP.NET
page to strongly type the Master property, quite cool. 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;%@ MasterType TypeName="BaseMaster" %&amp;gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</comments>
      <category>General</category>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=55aa0d00-c6e8-4ddd-a310-02b88cc99e01</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,55aa0d00-c6e8-4ddd-a310-02b88cc99e01.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.fluxtah.com/CommentView,guid,55aa0d00-c6e8-4ddd-a310-02b88cc99e01.aspx</wfw:comment>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=55aa0d00-c6e8-4ddd-a310-02b88cc99e01</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I had a second interview today for a job that I am very keen on getting, after the
interview it struck me that somehow I must have done something wrong, infact it was
during the question 'Do you have any questions?' I realised that I had somehow
missed an opportunity or somehow screwed up. Even further it was after something said
to me along the lines of 'well, you are just one of a number and we will have
some feedback for you as soon as possible', followed again by 'Do you
have any questions?'. 
</p>
        <p>
This sounded a lot like 'This is your last chance to ask us some deal breaking
questions right now?' but I am hoping that this is just the way that I percieved
it. Still I had no questions. Well, saying that I did have one question but that was
asking wether they had used LINQ to NHibernate and then following up on that by saying
how great LINQ is, which ended up sounding like an instruction (according to one of
the interviewers, I am not sure if it was meant literaly however it made me feel uncomfortable,
like I just gave an instruction to use LINQ to NHibernate, but this is not what I
was indicating). 
</p>
        <p>
Although this was the only question I did ask, I don't think it was the right
question, I failed to ask about the job, about what I might be doing, what my responsibilities
would be and where I would fit into the team, it stands to reason that if your going
to a job and the job details do not specifically answer these questions then maybe they should
be asked. 
</p>
        <p>
The thing that I think stopped me from asking them is that I just assumed that, since
I am going for a C# Developer role that I would pretty much be involved in writing
C# Code in answer to some business idea, plan or problem, which is infact the case
since I was already told that the position involves writing B2B enterprise applications. 
</p>
        <p>
Reflecting on myself after this interview, I think I may have babbled to much, when
asked a direct questions, I seem to have gave an entire story rather than a direct
answer, I am not sure why I did this, I think it may have been that I felt I had to
prove something, which, I guess I did since thats what your supposed to do in job
interviews? right? 
</p>
        <p>
I still feel, that getting this job will be the next step in my career, even though
it ended on an anti-climax, assuming that the interview was a climax or a superficial
climax for me and an anti-climax for them with me babbling on that
it made me seem as if I am some big head who knows it all. 
</p>
        <p>
Anyway, I hope I get this job! 
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=55aa0d00-c6e8-4ddd-a310-02b88cc99e01" />
      </body>
      <title>Job Interview Blues</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,55aa0d00-c6e8-4ddd-a310-02b88cc99e01.aspx</guid>
      <link>http://www.fluxtah.com/2009/02/19/JobInterviewBlues.aspx</link>
      <pubDate>Thu, 19 Feb 2009 11:43:00 GMT</pubDate>
      <description>&lt;p&gt;
I had a second interview today for a job that I am very keen on getting, after the
interview it struck me that somehow I must have done something wrong, infact it was
during the question &amp;#39;Do you have any questions?&amp;#39; I realised that I had somehow
missed an opportunity or somehow screwed up. Even further it was after something said
to me along the lines of &amp;#39;well, you are just one of a number and we will have
some feedback for you as soon as&amp;nbsp;possible&amp;#39;, followed again by &amp;#39;Do you
have any questions?&amp;#39;. 
&lt;/p&gt;
&lt;p&gt;
This sounded a lot like &amp;#39;This is your last chance to ask us some deal breaking
questions right now?&amp;#39; but I am hoping that this is just the way that I percieved
it. Still I had no questions. Well, saying that I did have one question but that was
asking wether they had used LINQ to NHibernate and then following up on that by saying
how great LINQ is, which ended up sounding like an instruction (according to one of
the interviewers, I am not sure if it was meant literaly however it made me feel uncomfortable,
like I just gave an instruction to use LINQ to NHibernate, but this is not what I
was indicating). 
&lt;/p&gt;
&lt;p&gt;
Although this was the only question I did ask, I don&amp;#39;t think it was the right
question, I failed to ask about the job, about what I might be doing, what my responsibilities
would be and where I would fit into the team, it stands to reason that if your going
to a job and the job details do not specifically answer these questions then maybe&amp;nbsp;they&amp;nbsp;should
be asked. 
&lt;/p&gt;
&lt;p&gt;
The thing that I think stopped me from asking them is that I just assumed that, since
I am going for a C# Developer role that I would pretty much be involved in writing
C# Code in answer to some business idea, plan or problem, which is infact the case
since I was already told that the position involves writing B2B enterprise applications. 
&lt;/p&gt;
&lt;p&gt;
Reflecting on myself after this interview, I think I may have babbled to much, when
asked a direct questions, I seem to have gave an entire story rather than a direct
answer, I am not sure why I did this, I think it may have been that I felt I had to
prove something, which, I guess I did since thats what your supposed to do in job
interviews? right? 
&lt;/p&gt;
&lt;p&gt;
I still feel, that getting this job will be the next step in my career, even though
it ended on an anti-climax, assuming that the interview was a climax or a superficial
climax for me and an&amp;nbsp;anti-climax for them&amp;nbsp;with me&amp;nbsp;babbling on that
it made me seem as if I am some big head who knows it all. 
&lt;/p&gt;
&lt;p&gt;
Anyway, I hope I get this job! 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=55aa0d00-c6e8-4ddd-a310-02b88cc99e01" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,55aa0d00-c6e8-4ddd-a310-02b88cc99e01.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=96799bdf-58d2-4274-8b80-7a21ce1d66a6</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,96799bdf-58d2-4274-8b80-7a21ce1d66a6.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=96799bdf-58d2-4274-8b80-7a21ce1d66a6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In an SnippetCallback, when defining mapping between a web service method parameter
and a control, there is a client-side function for each control type that deals
with extracting the value from the control and passing it as the web service methods
parameter. 
</p>
        <p>
By default most of the simple web controls (TextBox, Checkbox, RadioButtonList,
etc) that come out-of-the-box with ASP.NET already have a corresponding client-side
value extractor function defined, but obviously this is not good enough if you want
to use custom controls. 
</p>
        <p>
To override these or add new ones there are two things that need to be done, first
off a new extractor function would have to be defined in configuration. 
</p>
        <pre>&lt;configSections&gt;<br />
  &lt;section name="ajaxSnippets" type="AjaxSnippets.Configuration.AjaxSnippetsConfigurationSection,
AjaxSnippets"/&gt;<br />
&lt;/configSections&gt;<br />
&lt;ajaxSnippets&gt;<br />
  &lt;extractors&gt;<br />
    &lt;add controlType="System.Web.UI.WebControls.TextBox" functionName="myCustomTextBoxExtractor"
/&gt;<br />
    &lt;add controlType="My.Custom.Control" functionName="fromMyCustomControl"
/&gt;<br />
  &lt;/extractors&gt;<br />
&lt;/ajaxSnippets&gt;</pre>
        <p>
In this example, I am overriding the textbox extractor with my own function myCustomTextBoxExtractor,
secondly I am defining a new value extractor fromMyCustomControl for My.Custom.Control. 
</p>
        <p>
Now the next thing that needs to be done is to write the client functions, this can
be done by creating a new javascript file, which would need to be included in the
page that Ajax Snippets are being used. 
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">AjaxSnippets.ValueExtractors.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span>.myCustomTextBoxExtractor <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id){ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Extract value from el and return it here </span> } AjaxSnippets.ValueExtractors.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span>.fromMyCustomControl <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id){ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Extract value from el and return it here </span> } </span>
        </pre>
        <p>
Ajax Snippets has a ValueExtractors class, and its simply just a job of adding functions
to its prototype. 
</p>
        <p>
To give a better example, the ValueExtractors default prototype is below
in full, in its current state from Ajax Snippets 0.3a release. 
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">AjaxSnippets.ValueExtractors.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> {
fromAny: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> id;
}, fromTextBox: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> $get(id).value;
}, fromDropDown: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> el.options[el.selectedIndex].value;
}, fromRadioList: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> i,
els <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id).getElementsByTagName('<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">input</span>'); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; els.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">length</span>;
i++) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (els[i].<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">checked</span>)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> els[i].value;
} } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> null;
}, fromCheckList: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> i,
els <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id).getElementsByTagName('<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">input</span>'),
vals <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> new <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">Array</span>(); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; els.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">length</span>;
i++) { vals.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">push</span>(els[i].<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">checked</span>);
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> vals;
}, fromListBox: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> i,
el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id),
vals <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> new <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">Array</span>(); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; el.options.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">length</span>;
i++) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (el.options[i].selected)
{ vals.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">push</span>(el.options[i].value);
} } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> vals;
}, fromCheckBox: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> $get(id).<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">checked</span>;
} };</span>
        </pre>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=96799bdf-58d2-4274-8b80-7a21ce1d66a6" />
      </body>
      <title>Overriding client value extractors in Ajax Snippets, and adding new ones</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,96799bdf-58d2-4274-8b80-7a21ce1d66a6.aspx</guid>
      <link>http://www.fluxtah.com/2008/10/05/OverridingClientValueExtractorsInAjaxSnippetsAndAddingNewOnes.aspx</link>
      <pubDate>Sun, 05 Oct 2008 16:19:00 GMT</pubDate>
      <description>&lt;p&gt;
In an SnippetCallback, when defining mapping between a web service method&amp;nbsp;parameter
and a&amp;nbsp;control, there is a client-side function for each control type that deals
with extracting the value from the control and passing it as the web service methods
parameter. 
&lt;/p&gt;
&lt;p&gt;
By default most of the simple&amp;nbsp;web controls (TextBox, Checkbox,&amp;nbsp;RadioButtonList,
etc)&amp;nbsp;that come out-of-the-box with ASP.NET already have a corresponding client-side
value extractor function defined, but obviously this is not good enough if you want
to use custom controls. 
&lt;/p&gt;
&lt;p&gt;
To override these or add new ones there are two things that need to be done, first
off a new extractor function would have to be defined in configuration. 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;configSections&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;section name="ajaxSnippets" type="AjaxSnippets.Configuration.AjaxSnippetsConfigurationSection,
AjaxSnippets"/&amp;gt;&lt;br&gt;
&amp;lt;/configSections&amp;gt;&lt;br&gt;
&amp;lt;ajaxSnippets&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;extractors&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add controlType="System.Web.UI.WebControls.TextBox" functionName="myCustomTextBoxExtractor"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add controlType="My.Custom.Control" functionName="fromMyCustomControl"
/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/extractors&amp;gt;&lt;br&gt;
&amp;lt;/ajaxSnippets&amp;gt;&lt;/pre&gt;
&lt;p&gt;
In this example, I am overriding the textbox extractor with my own function myCustomTextBoxExtractor,
secondly I am defining a new value extractor fromMyCustomControl for My.Custom.Control. 
&lt;/p&gt;
&lt;p&gt;
Now the next thing that needs to be done is to write the client functions, this can
be done by creating a new javascript file, which would need to be included in the
page that Ajax Snippets are being used. 
&lt;/p&gt;
&lt;pre&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;AjaxSnippets.ValueExtractors.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt;.myCustomTextBoxExtractor &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id){ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Extract value from el and return it here &lt;/span&gt; } AjaxSnippets.ValueExtractors.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt;.fromMyCustomControl &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id){ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Extract value from el and return it here &lt;/span&gt; } &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Ajax Snippets has a ValueExtractors class, and its simply just a job of adding functions
to its prototype. 
&lt;/p&gt;
&lt;p&gt;
To give a better example, the ValueExtractors&amp;nbsp;default prototype&amp;nbsp;is below
in full, in its current state from Ajax Snippets 0.3a release. 
&lt;/p&gt;
&lt;pre&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;AjaxSnippets.ValueExtractors.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; {
fromAny: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; id;
}, fromTextBox: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; $get(id).value;
}, fromDropDown: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; el.options[el.selectedIndex].value;
}, fromRadioList: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; i,
els &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id).getElementsByTagName('&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;input&lt;/span&gt;'); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;for&lt;/span&gt; (i &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0;
i &amp;lt; els.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;length&lt;/span&gt;;
i++) { &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (els[i].&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;checked&lt;/span&gt;)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; els[i].value;
} } &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; null;
}, fromCheckList: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; i,
els &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id).getElementsByTagName('&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;input&lt;/span&gt;'),
vals &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; new &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;Array&lt;/span&gt;(); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;for&lt;/span&gt; (i &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0;
i &amp;lt; els.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;length&lt;/span&gt;;
i++) { vals.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;push&lt;/span&gt;(els[i].&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;checked&lt;/span&gt;);
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; vals;
}, fromListBox: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; i,
el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id),
vals &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; new &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;Array&lt;/span&gt;(); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;for&lt;/span&gt; (i &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0;
i &amp;lt; el.options.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;length&lt;/span&gt;;
i++) { &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (el.options[i].selected)
{ vals.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;push&lt;/span&gt;(el.options[i].value);
} } &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; vals;
}, fromCheckBox: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; $get(id).&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;checked&lt;/span&gt;;
} };&lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=96799bdf-58d2-4274-8b80-7a21ce1d66a6" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,96799bdf-58d2-4274-8b80-7a21ce1d66a6.aspx</comments>
      <category>ASP.NET</category>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=5ae41684-2662-4f26-be62-f23503638972</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,5ae41684-2662-4f26-be62-f23503638972.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.fluxtah.com/CommentView,guid,5ae41684-2662-4f26-be62-f23503638972.aspx</wfw:comment>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5ae41684-2662-4f26-be62-f23503638972</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After a busy weekend I finally got a wizard working to help with the configuration
of a SnippetCallback. In the latest build of <a href="http://www.codeplex.com/ajaxsnippets" title="Ajax Snippets">Ajax
Snippets</a> there is now an option from the action list of a SnippetCallback on the
designer named 'Configure...'. 
</p>
        <p>
          <img src="/image.axd?picture=2008%2f10%2fSnippetCallbackConfigureOption2.jpg" alt="" />
        </p>
        <p>
After clicking this option a wizard will popup where an asmx file can be selected
and a web method from this service. 
</p>
        <p>
          <img src="/image.axd?picture=2008%2f10%2fChoooseServiceWizardStep.jpg" alt="" />
        </p>
        <p>
One problem with this is that the web application must be compiled before the wizard
can get access to the web service method list, the wizard basically pulls out web
service type defined by the class attribute in the asmx file and tries to use Type.GetType()
on it, if the web application is not compiled with asmx file then the methods do not
show up in the wizards list, but I did stick in a red warning label under the drop-down-list
if this happens. 
</p>
        <p>
The next step allows the mapping of controls to the selected web methods parameters. 
</p>
        <p>
          <img src="/image.axd?picture=2008%2f10%2fMapParametersWizardStep.jpg" alt="" />
        </p>
        <p>
The main benefit of the wizard is it avoids any mapping mistakes and typos, it could
also do with a page to configure other options of a SnippetCallback but at least these
two steps cover the main options. 
</p>
        <p>
  
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=5ae41684-2662-4f26-be62-f23503638972" />
      </body>
      <title>SnippetCallback configuration wizard</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,5ae41684-2662-4f26-be62-f23503638972.aspx</guid>
      <link>http://www.fluxtah.com/2008/10/05/SnippetCallbackConfigurationWizard.aspx</link>
      <pubDate>Sun, 05 Oct 2008 15:41:00 GMT</pubDate>
      <description>&lt;p&gt;
After a busy weekend I finally got a wizard working to help with the configuration
of a SnippetCallback. In the latest build of &lt;a href="http://www.codeplex.com/ajaxsnippets" title="Ajax Snippets"&gt;Ajax
Snippets&lt;/a&gt; there is now an option from the action list of a SnippetCallback on the
designer named &amp;#39;Configure...&amp;#39;. 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="/image.axd?picture=2008%2f10%2fSnippetCallbackConfigureOption2.jpg" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;
After clicking this option a wizard will popup where an asmx file can be selected
and a web method from this service. 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="/image.axd?picture=2008%2f10%2fChoooseServiceWizardStep.jpg" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;
One problem with this is that the web application must be compiled before the wizard
can get access to the web service method list, the wizard basically pulls out web
service type defined by the class attribute in the asmx file and tries to use Type.GetType()
on it, if the web application is not compiled with asmx file then the methods do not
show up in the wizards list, but I did stick in a red warning label under the drop-down-list
if this happens. 
&lt;/p&gt;
&lt;p&gt;
The next step allows the mapping of controls to the selected web methods parameters. 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="/image.axd?picture=2008%2f10%2fMapParametersWizardStep.jpg" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;
The main benefit of the wizard is it avoids any mapping mistakes and typos, it could
also do with a page to configure other options of a SnippetCallback but at least these
two steps cover the main options. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=5ae41684-2662-4f26-be62-f23503638972" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,5ae41684-2662-4f26-be62-f23503638972.aspx</comments>
      <category>General</category>
    </item>
  </channel>
</rss>