help with puting jquery in the OnSuccess parameter of Ajaxoption when using ajax helpershttp://forums.asp.net/t/1775294.aspx/1?help+with+puting+jquery+in+the+OnSuccess+parameter+of+Ajaxoption+when+using+ajax+helpersThu, 01 Mar 2012 01:31:01 -050017752944857603http://forums.asp.net/p/1775294/4857603.aspx/1?help+with+puting+jquery+in+the+OnSuccess+parameter+of+Ajaxoption+when+using+ajax+helpershelp with puting jquery in the OnSuccess parameter of Ajaxoption when using ajax helpers <p>I am using this ajax helper:</p> <pre class="prettyprint">@Ajax.RouteLink(&quot;Make this the default location&quot;, &quot;defaultlocation&quot;, New With {.id = currentItem.ID}, New AjaxOptions With {.Confirm = &quot;Do you really want to delete this location?&quot;, .HttpMethod = &quot;Get&quot;, .OnFailure = &quot;alert('some error occured and could not set this location as the default')&quot;, .OnSuccess = &quot;$('.defaultbutton').show().$('#defaultlnk&quot; &#43; currentItem.ID.ToString &#43; &quot;').hide()&quot;}, New With {.class = &quot;rounded-6 botton w-142 defaultbutton&quot;, .rel = &quot;nofollow&quot;, .id = &quot;defaultlnk&quot; &#43; currentItem.ID.ToString})</pre> <pre class="prettyprint">the problem is that the OnSuccess parameter gets htmlencoded when rendered.</pre> <pre class="prettyprint">&nbsp;</pre> <pre class="prettyprint">How can I do this without having it encoded? </pre> <pre class="prettyprint">I dont want to declare an outside function. I really wish to keep all the functionality inside the attribute</pre> <pre class="prettyprint">this is the rendered output:</pre> <pre class="prettyprint">&lt;a class="rounded-6 botton w-142 defaultbutton" data-ajax="true" data-ajax-confirm="Do you really want to delete this location?" data-ajax-failure="alert(&amp;#39;some error occured and could not set this location as the default&amp;#39;)" data-ajax-method="Get" data-ajax-success="&#36;(&amp;#39;.defaultbutton&amp;#39;).show().&#36;(&amp;#39;#defaultlnk492&amp;#39;).hide()" href="/Location/MakeDefault/492" id="defaultlnk492" rel="nofollow"&gt;Make this the default location&lt;/a&gt; </pre> <p>&nbsp;</p> 2012-02-29T23:14:35-05:004857680http://forums.asp.net/p/1775294/4857680.aspx/1?Re+help+with+puting+jquery+in+the+OnSuccess+parameter+of+Ajaxoption+when+using+ajax+helpersRe: help with puting jquery in the OnSuccess parameter of Ajaxoption when using ajax helpers <p>hi,</p> <p></p> <p>try this....</p> <pre class="lang-cs prettyprint"><pre class="prettyprint"><strong>New AjaxOptions With {.OnSuccess = String.Format(&quot;removeRow({0})&quot;, item.Id) </strong><strong>}</strong></pre></pre> <p></p></pre> 2012-03-01T01:31:01-05:00