Note that there are some explanatory texts on larger screens.

plurals
  1. POVariables contain values but in action they equals NULL
    text
    copied!<p>I have the following js code:</p> <pre><code> $("#dateRange").change(function() { var date = $(this).attr("value"); var test = "1"; var eventId = $("div.movie").attr("eventid"); $("#scheduleList").load("/EventSchedule/GetSchedule/?date=" + date + "&amp;dayRange=" + test + "&amp;eventId=" + eventId); }); </code></pre> <p>This is action:</p> <pre><code>public EmptyResult GetSchedule(string date, string dayRange, string eventId) { // some code } </code></pre> <p>In the firebug all variable filled correctly: <code>date</code> contain date, <code>test</code> contain <code>1</code> and <code>eventId</code> contain <code>12</code>. But, in controller action <code>dayRange</code> and <code>evendId</code> equals <code>null</code>. The <code>date</code> param is filled.</p> <p>Where is problem? </p> <p><strong>UPDATE:</strong> div.movie:</p> <pre><code>&lt;div class="movie" eventid="12" type="Film"&gt; &lt;div class="poster"&gt; &lt;img src="/Image/GetImage"&gt; &lt;div class="btn_buy_ticket"&gt; &lt;div&gt; &lt;i&gt;&lt;/i&gt; &lt;span&gt; &lt;a href="#"&gt;Купить билет&lt;/a&gt; &lt;/span&gt; &lt;em&gt;&lt;/em&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>My routes:</p> <pre><code>public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); var entryRoute = new PageEntry("page/{name}/", new RouteValueDictionary( new { controller = "DynamicPage", action = "Index", name = string.Empty }), new RouteValueDictionary(new { name = @".+" }), new MvcRouteHandler()); routes.Add("display-page", entryRoute); routes.MapRoute( "Activate", "Account/Activate/{username}/{key}", new { controller = "Account", action = "Activate", username = UrlParameter.Optional, key = UrlParameter.Optional }); } </code></pre> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload