{"id":3945,"date":"2014-03-30T06:28:31","date_gmt":"2014-03-30T06:28:31","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-actionlink-collection-of-common-programming-errors\/"},"modified":"2014-03-30T06:28:31","modified_gmt":"2014-03-30T06:28:31","slug":"problem-about-actionlink-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-actionlink-collection-of-common-programming-errors\/","title":{"rendered":"problem about actionlink-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/63d970696f1ccbc9a3412ee8cd79be5e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonathan Wood<br \/>\nasp.net-mvc razor actionlink<br \/>\nI&#8217;m stumped on what seems to be a very strange issue.In my Razor markup, I have:@Html.ActionLink(&#8220;World&#8221;, &#8220;Browse&#8221;, &#8220;Destination&#8221;)But the HTML produced is:&lt;a href=&#8221;\/Destination\/Browse\/1\/africa-middle-east&#8221;&gt;World&lt;\/a&gt;Note that the additional data is, in fact, valid data that I&#8217;m using in other links. But why the heck does it show up here? I can even verify that the first line produces the second line by inspecting it in the debugger.I know I&#8217;m doing something really stupid here. I just<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/af59971a667995ea572527fabc9c59d5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nescist<br \/>\nasp.net-mvc actionlink<br \/>\nI have this Html.ActionLink in my code:@Html.ActionLink(&#8220;Up&#8221;, &#8220;GetCategory&#8221;, &#8220;Category&#8221;, new { C_ID = CID, D_ID = DID, E_ID = EID, F_ID = FID },new { id = &#8220;item-&#8221; + ItemID + &#8220;-getcategories-&#8221; + ItemLevel, @class = &#8220;getCategory&#8221; })I want to append a Javascript variable&#8217;s value to the route dictionary. For this, I used the solution specified in this SO question ASP.NET MVC 2 Html.ActionLink with JavaScript variableI attempted to customise the answer and this is what I have:$(function () {$(&#8216;a.getC<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/328526e9792177d3ae882f470402364a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsada<br \/>\nasp.net-mvc-3 actionlink unobtrusive-ajax<br \/>\nI want to use the Ajax.ActionLink Html helper therefore I need the jquery.unobtrusive-ajax.min.js library but IE is always showing this error: Microsoft JScript runtime error: Unable to set value of the property &#8216;unobtrusive&#8217;: object is null or undefinedI&#8217;ve read that the solution is usage of jquery.validate.min.js and jquery.validate.unobtrusive.min.js but then I can&#8217;t recognise the ajax call on server side.Hm?Please help me.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/67fe5c6c0f514fbd30dbdb24da08a3e2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCherian<br \/>\nasp.net-mvc actionlink actionresult<br \/>\nI have the following code in my Site.Master page of an almost empty ASP.NET MVC Project. &lt;li&gt;&lt;%= Html.ActionLink(&#8220;Home&#8221;, &#8220;Index&#8221;, &#8220;Home&#8221;)%&gt; &lt;\/li&gt; &lt;li&gt;&lt;%= Html.ActionLink(&#8220;Feed List&#8221;, &#8220;FeedList&#8221;, &#8220;Home&#8221;)%&gt; &lt;\/li&gt; &lt;li&gt;&lt;%= Html.ActionLink(&#8220;Monitored Feeds&#8221;, &#8220;MonitoredFeeds&#8221;, &#8220;Home&#8221;)%&gt; &lt;\/li&gt; &lt;li&gt;&lt;%= Html.ActionLink(&#8220;About&#8221;, &#8220;About&#8221;, &#8220;Home&#8221;)%&gt; &lt;\/li&gt;I haven&#8217;t added anything more than a Folder to the Views Folder called Feeds. In<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e2af3f60180a92a5917d02ade1070332?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRomias<br \/>\nasp.net-mvc query-string actionlink<br \/>\nHi,I am using ASP.NET MVC 3 and I need to generate a URL like this : MyURL.se\/?CS.C2=113I have tried this : &lt;%= Html.ActionLink(subItem.Name, &#8220;List&#8221;, &#8220;Ad&#8221;, new { CS.C2=subItem.Id}, null) %&gt;But this will throw a : CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.CS.C2 is part of the viewClass that the action needs.So how do I generate a proper URL for this link?Edit : public ActionResult List(AdL<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jonathan Wood asp.net-mvc razor actionlink I&#8217;m stumped on what seems to be a very strange issue.In my Razor markup, I have:@Html.ActionLink(&#8220;World&#8221;, &#8220;Browse&#8221;, &#8220;Destination&#8221;)But the HTML produced is:&lt;a href=&#8221;\/Destination\/Browse\/1\/africa-middle-east&#8221;&gt;World&lt;\/a&gt;Note that the additional data is, in fact, valid data that I&#8217;m using in other links. But why the heck does it show up here? I can even [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3945","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3945"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3945\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}