Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8906041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:32:57+00:00 2026-06-15T02:32:57+00:00

I will bring code first. Controller: public ActionResult VideoList(int page) { } [HttpPost] public

  • 0

I will bring code first.

Controller:

    public ActionResult VideoList(int page)
    {
    }
    [HttpPost]
    public ActionResult SaveWindowWidth(string width)
    {
        return Json(new { success = true });
    }

JS:

$(document).ready(function ()
{
var width = $("#Window").width();

$.ajax(
    {
        type: "POST",
        url: '/Video/SaveWindowWidth',
        async: "true",
        data: { "width": width },
        dataType: 'text json',
        contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
        success: function (data, status)
        {
            if (data)
            {
                alert(data.status);
            }
        },
        error: function (data, status)
        {
            if (data)
            {
                alert(data.status);
            }
        }
    })
})

Routes:

            routes.MapRoute(
            "Home", // Route name
            "Home", // URL with parameters
            new { controller = "Home", action = "Index" }
        );

        routes.MapRoute(
            "BookPage", // Route name
            "BookPage/{page}", // URL with parameters
            new { controller = "Book", action = "Page" }
        );

        routes.MapRoute(
            "BlogMember", // Route name
            "BlogMember/{id}/{page}", // URL with parameters
            new { controller = "Blog", action = "Member" }
        );

        routes.MapRoute(
            "BlogPost", // Route name
            "BlogPost/{id}/{page}", // URL with parameters
            new { controller = "Blog", action = "Post" }
        );

        routes.MapRoute(
            "BlogPage", // Route name
            "BlogPage/{page}", // URL with parameters
            new { controller = "Blog", action = "Page" }
        );

        routes.MapRoute(
            "BlogTag", // Route name
            "BlogTag/{tag}/{page}", // URL with parameters
            new { controller = "Blog", action = "Tag" }
        );

        routes.MapRoute(
            "NewBlogPostComment", // Route name
            "NewBlogPostComment", // URL with parameters
            new { controller = "Blog", action = "NewBlogPostComment" }
        );

        routes.MapRoute(
            "NewBlogPost", // Route name
            "NewBlogPost", // URL with parameters
            new { controller = "Blog", action = "NewBlogPost" }
        );

        routes.MapRoute(
            "EditBlogPost", // Route name
            "EditBlogPost/{id}", // URL with parameters
            new { controller = "Blog", action = "EditBlogPost" }
        );

        routes.MapRoute(
            "Account", // Route name
            "Account", // URL with parameters
            new { controller = "Account", action = "Update" }
        );

        routes.MapRoute(
            "LogOff", // Route name
            "LogOff", // URL with parameters
            new { controller = "Account", action = "LogOff" }
        );

        routes.MapRoute(
            "LogOn", // Route name
            "LogOn", // URL with parameters
            new { controller = "Account", action = "LogOn" }
        );

        routes.MapRoute(
            "Register", // Route name
            "Register", // URL with parameters
            new { controller = "Account", action = "Register" }
        );

        //routes.MapRoute(
        //    "About", // Route name
        //    "About", // URL with parameters
        //    new { controller = "Home", action = "About" }
        //);

        routes.MapRoute(
            "Contact", // Route name
            "Contact", // URL with parameters
            new { controller = "Home", action = "Contact" }
        );

        routes.MapRoute(
            "UnderConstruction", // Route name
            "UnderConstruction", // URL with parameters
            new { controller = "Home", action = "UnderConstruction" }
        );

        routes.MapRoute(
            "DisableBlogComment", // Route name
            "DisableBlogComment/{id}", // URL with parameters
            new { controller = "Blog", action = "DisableBlogComment" }
        );

        routes.MapRoute(
            "DisableAllMemberBlogComments", // Route name
            "DisableAllMemberBlogComments/{id}", // URL with parameters
            new { controller = "Blog", action = "DisableAllMemberBlogComments" }
        );

        routes.MapRoute(
            "DisableVideoComment", // Route name
            "DisableVideoComment/{id}", // URL with parameters
            new { controller = "Video", action = "DisableVideoComment" }
        );

        routes.MapRoute(
            "DisableAllMemberVideoComments", // Route name
            "DisableAllMemberVideoComments/{id}", // URL with parameters
            new { controller = "Video", action = "DisableAllMemberVideoComments" }
        );

        routes.MapRoute(
            "DisableMember", // Route name
            "DisableMember/{id}", // URL with parameters
            new { controller = "Member", action = "DisableMember" }
        );

        routes.MapRoute(
            "NewPost", // Route name
            "NewPost", // URL with parameters
            new { controller = "Blog", action = "NewPost" }
        );

        routes.MapRoute(
            "InactiveBlogPosts", // Route name
            "InactiveBlogPosts/{page}", // URL with parameters
            new { controller = "Blog", action = "InactiveBlogPosts" }
        );

        routes.MapRoute(
            "InactiveBlogComments", // Route name
            "InactiveBlogComments/{page}", // URL with parameters
            new { controller = "Blog", action = "InactiveBlogComments" }
        );

        routes.MapRoute(
            "InactiveVideoComments", // Route name
            "InactiveVideoComments/{page}", // URL with parameters
            new { controller = "Video", action = "InactiveVideoComments" }
        );

        routes.MapRoute(
            "EditHomePage", // Route name
            "EditHomePage", // URL with parameters
            new { controller = "Home", action = "EditHomePage" }
        );

        routes.MapRoute(
            "EditAboutPage", // Route name
            "EditAboutPage", // URL with parameters
            new { controller = "Home", action = "EditAboutPage" }
        );

        routes.MapRoute(
            "Newsletter", // Route name
            "Newsletter", // URL with parameters
            new { controller = "Newsletter", action = "Newsletter" }
        );

        routes.MapRoute(
            "RegisterNewVideo", // Route name
            "RegisterNewVideo", // URL with parameters
            new { controller = "Video", action = "RegisterNewVideo" }
        );

        routes.MapRoute(
            "Members", // Route name
            "Members/{page}", // URL with parameters
            new { controller = "Member", action = "MemberList" }
        );

        routes.MapRoute(
            "EditMember", // Route name
            "EditMember/{id}", // URL with parameters
            new { controller = "Member", action = "EditMember" }
        );

        routes.MapRoute(
            "AppSettings", // Route name
            "AppSettings", // URL with parameters
            new { controller = "Utility", action = "AppSettings" }
        );

        routes.MapRoute(
            "AudioBookPage", // Route name
            "AudioBookPage/{page}", // URL with parameters
            new { controller = "Book", action = "AudioBookPage" }
        );

        routes.MapRoute(
            "IPBlocked", // Route name
            "IPBlocked", // URL with parameters
            new { controller = "Utility", action = "IPBlocked" }
        );

        routes.MapRoute(
            "LiveTV", // Route name
            "LiveTV", // URL with parameters
            new { controller = "LiveTV", action = "LiveTV" }
        );

        routes.MapRoute(
            "VideoPlayer", // Route name
            "VideoPlayer/{id}/{page}", // URL with parameters
            new { controller = "Video", action = "VideoPlayer" }
        );

        routes.MapRoute(
            "Video", // Route name
            "Video/{page}", // URL with parameters
            new { controller = "Video", action = "VideoList" }
        );

        routes.MapRoute(
            "NewVideoComment", // Route name
            "NewVideoComment", // URL with parameters
            new { controller = "Video", action = "NewVideoComment" }
        );

        routes.MapRoute(
            "Music", // Route name
            "Music", // URL with parameters
            new { controller = "Music", action = "Index" }
        );

        routes.MapRoute(
            "RootsCompilationOne", // Route name
            "Music/RootsCompilationOne", // URL with parameters
            new { controller = "Music", action = "RootsCompilationOne" }
        );

        routes.MapRoute(
            "UnityIsStrength", // Route name
            "Music/UnityIsStrength", // URL with parameters
            new { controller = "Music", action = "UnityIsStrength" }
        );

        routes.MapRoute(
            "FileUpload", // Route name
            "FileUpload", // URL with parameters
            new { controller = "Utility", action = "FileUpload" }
        );

        routes.MapRoute(
            "PageUnavailable", // Route name
            "PageUnavailable", // URL with parameters
            new { controller = "Utility", action = "PageUnavailable" }
        );

        routes.MapRoute(
            "VideoGrid", // Route name
            "VideoGrid/{page}", // URL with parameters
            new { controller = "Video", action = "VideoGrid" }
        );

        routes.MapRoute(
            "EditVideo", // Route name
            "EditVideo/{id}", // URL with parameters
            new { controller = "Video", action = "EditVideo" }
        );

        routes.MapRoute(
            "CopyVideo", // Route name
            "CopyVideo/{id}/{page}", // URL with parameters
            new { controller = "Video", action = "CopyVideo" }
        );

        routes.MapRoute(
            "DeleteIPLogs", // Route name
            "DeleteIPLogs/{ip}", // URL with parameters
            new { controller = "Utility", action = "DeleteIPLogs" }
        );

        routes.MapRoute(
            "SaveWindowWidth", // Route name
            "SaveWindowWidth/{width}", // URL with parameters
            new { controller = "Video", action = "SaveWindowWidth" }
        );

        routes.MapRoute(
            "FacebookLikes", // Route name
            "FacebookLikes", // URL with parameters
            new { controller = "Utility", action = "FacebookLikes" }
        );

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );

Problem that ajax tries to call VideoList method. I see it when read response:

The parameters dictionary contains a null entry for parameter ‘page’ of non-nullable type ‘System.Int32’ for method ‘System.Web.Mvc.ActionResult VideoList(Int32)’

I have heard somewhere that it may be something wrong with routes, so I posted them here as well.
I would appreciate your help

Regards
Mariusz

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:32:59+00:00Added an answer on June 15, 2026 at 2:32 am

    Your video route is not well configured. MVC tries to get the controller and action from each url to figure out required method from appropriate controller. And in your case, it always gets same values VideoController.VideoList():

    routes.MapRoute(
                "Video", // Route name
                "Video/{page}", // URL with parameters
                new { controller = "Video", action = "VideoList" }
            );
    

    If you change your route to this, everything will be ok:

    routes.MapRoute(
                "Video", // Route name
                "Video/{action}", // URL with parameters
                new { controller = "Video", action = "VideoList" }
            );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page being ajaxed in, but the document ready code will not
I want to create a PDF that will bring up a typical OK/Cancel alert
I have been reading up on the changes that .NET4.5 will bring, and on
I have 3 similar SQL queries that each will bring back 1 record with
I have a NSViewController subclass with a convenience method to return the window controller
I'm running into an issue with Entity Framework code-first in MVC3. I'm hitting this
I have this code in my table view controller (and delegate): - (void)tableView:(UITableView *)tableView
First let me say sorry for the amount of code I'm posting below I'm
I'm working with ASP.NET MVC3 using EF and Code First. I'm writing a simple
I feel as though this will end up being a silly question with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.