ASP.Net MVC v1 is the original version of Microsofts MVC framework. It has subsequently been replaced by several newer version (v2, v3, v3.5, v4 & v5). Use this tag for questions regarding version 1 (ONLY) of the Microsoft MVC framework.
Questions tagged [asp-net-mvc-1]
28 questions
58
votes
7 answers
post and get with same method signature
In my controller I have two actions called "Friends". The one that executes depends on whether or not it's a "get" versus a "post".
So my code snippets look something like this:
// Get:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Friends()
{
…
![](../../users/profiles/66478.webp)
codette
- 11,303
- 9
- 35
- 38
23
votes
7 answers
Invoking particular action on dropdown list selection in MVC
I have a dropdown list in an MVC view. On selection change of dropdown list I want to call specific action method in the controller.
What I have done on view is this :
<%=Html.DropDownList("ddl", ViewData["AvailableList"] as SelectList,
new {…
![](../../users/profiles/209542.webp)
Jaqen H'ghar
- 1,775
- 6
- 37
- 62
3
votes
3 answers
Custom Sort in LINQ Query
I have a table valued function that I'm calling with a LINQ query.
As I now understand it (as referenced here), the sorting needs to be done outside of the table valued function. This means, I have to do it in the LINQ query.
I need some assistance…
![](../../users/profiles/3516014.webp)
madvora
- 1,607
- 6
- 27
- 44
1
vote
0 answers
Cannot navigate to other pages on the website after AJAX calls on Google Chrome
I have a problem with my project that I have not found a solution for a long time.
One of the pages on the website has buttons that call for data from the server by AJAX calls, after I click on some of them I can not navigate to other pages on the…
![](../../users/profiles/11429682.webp)
דניאל
- 123
- 8
1
vote
0 answers
"source not available" but only under certain conditions
I have an strange error in one of the views I am trying to load.
In one of my views I have about 3600 lines of code on that view, as soon as I try to load that view it shows me an error:- source not available, and as soon as I reduce lines of code…
![](../../users/profiles/11429682.webp)
דניאל
- 123
- 8
1
vote
1 answer
Unable to implement authorization with asp.net core
I am using asp.net core 2.2. I created an empty web application using Visual Studio 2019. I added this code in Startup.cs, in the configure services method:
services.AddMvc(config =>
{
var policy = new…
![](../../users/profiles/7733619.webp)
B1B
- 163
- 10
1
vote
1 answer
Use .Net Standard library in .Net Framework 4.7 application
I have a set of class libraries which are developed using .Net Standard 2.0. One of these class libraries implements the IAuthorizationFilter interface which is resides in Microsoft.AspNetCore.Mvc.Filters namespace.
public class AuthorizationFilter…
![](../../users/profiles/1666800.webp)
Vahid Farahmandian
- 5,079
- 5
- 38
- 54
1
vote
1 answer
Why is my webpage load time more than 10 secs even with 98% speed performance score?
Is there any way to identify why this website initial loading is very slow? I have checked in my each and every part of the HTML structure and code (Requests, Response).
It’s loading very fast after first time loading completes.
I have performed…
![](../../users/profiles/2463112.webp)
sridharnetha
- 1,643
- 6
- 25
- 55
1
vote
2 answers
Load list of roles for each user in MVC5 razor
I am trying to display a row of each user and their roles in the ASP.net MVC application.
Users and their roles are stored in ASP.net membership provider table.
Using the code below I can display each user and the role they are assigned, but my…
![](../../users/profiles/819073.webp)
snowflakes74
- 1,169
- 1
- 16
- 35
1
vote
1 answer
HttpPost in MVC 1
I have to maintain a project that uses MVC 1. It seems like it doesn't know anything about [HttpPost], and the same action method is called for both get and post. What is the right way to distinguish between creating a view and submitting the form…
![](../../users/profiles/4703646.webp)
Dmitriy Reznik
- 99
- 7
0
votes
1 answer
ToLongDateString() showing wrong date in Arabic
In my ASP NET MVC Entity Framework project I pass from database date and time information. When I display the date in the Arabic format CultureInfo("ar-AR") I get an incorrect date from what is entered in the database.
My code so…
![](../../users/profiles/11429682.webp)
דניאל
- 123
- 8
0
votes
2 answers
ASP.NET issues an expired authentication Cookie
I am facing a weird issue with FormsAuthentication's .ASPXAUTH cookie. I migrated a .NET 4.6.2 MVC5 project to .NET 4.8 which is making use of FormsAuthentication and everything seem to work as expected beside authentication cookie issued by…
![](../../users/profiles/630884.webp)
Leadfoot
- 610
- 7
- 21
0
votes
0 answers
How to Manage Role in Business Layer with C#?
I've created an aspect for role management.
SecuredOperation Aspecti is as follows.
[Serializable]
public class SecuredOperation: OnMethodBoundaryAspect
{
public string Roles { get; set; }
public override void…
![](../../users/profiles/7508510.webp)
Brahim
- 3
- 4
0
votes
1 answer
How to create dynamic list in Aspnet mvc4 using radioButton?
My Model is:
namespace MvcApplication5.Models
{
public class DepartmentModelClass
{
public int Id { get; set; }
public string Text1 { get; set; }
public string Text2 { get; set; }
public bool? Option1 { get;…
![](../../users/profiles/10524462.webp)
Mayardes Oliveira
- 13
- 3
0
votes
1 answer
How to pass params to Action Method from ASPX based view using window.location.href
I am trying to pass string param to Action Method using Window.location.href but its not getting passed. I am having aspx based view without codebehind. Action Method gets called but with no param value. Developer tools showing params with Status…
![](../../users/profiles/9858616.webp)
Amit Yadgiri
- 5
- 2