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

  • SEARCH
  • Home
  • 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 7407333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:42:01+00:00 2026-05-29T05:42:01+00:00

I’m confused about this one. I’m using razor with MVC 3 and I have

  • 0

I’m confused about this one. I’m using razor with MVC 3 and I have a problem with one view on one action.

 [HttpGet]
 [ActionName("Unsubscribe")]
 public ActionResult UnsubscribeGet(string maskedId)
 {    
     return View("Unsubscribe", maskedId);
  }

The Unsubscribe.cshtml view is in the correct view folder.

The route is

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

When going to the following url “/Unsubscribe/db94fddb”, the action fires and then the following error is shown when it tries to find the view.

The view ‘Unsubscribe’ or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Unsubscribe.aspx
~/Views/Account/Unsubscribe.ascx
~/Views/Shared/Unsubscribe.aspx
~/Views/Shared/Unsubscribe.ascx
~/Views/Account/db94fddb.master
~/Views/Shared/db94fddb.master
~/Views/Account/db94fddb.cshtml
~/Views/Account/db94fddb.vbhtml
~/Views/Shared/db94fddb.cshtml
~/Views/Shared/db94fddb.vbhtml

Notice it doesn’t look for the cshtml extension when looking for Unsubscribe but does when looking for db94fddb

This is only happening with this view, completely at a loss on how to fix it.

** EDIT **

Found it,

I was using System.String as the model. For some reason that was causing it to blow up.

I swapped it to @model UnsubscribeViewModel

[HttpGet]
[ActionName("Unsubscribe")]
public ActionResult UnsubscribeGet(string maskedId)
{
    return View("Unsubscribe", new UnsubscribeViewModel { MaskedId = maskedId } );
}

Although this now works I still have no idea why it didn’t work before. I have my views set to compile on build so there were no compiler errors.

I would love to know what’s happening here.

  • 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-05-29T05:42:02+00:00Added an answer on May 29, 2026 at 5:42 am

    The overload of the View method you were using takes two strings. It doesn’t interpret the second string as a model, it interprets it as the master page name:

    protected internal ViewResult View(
        string viewName,
        string masterName
    )
    

    If you instead called it like this, it would work:

    return View("Unsubscribe", (object) maskedId);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.