Microsoft Q&A

ASP.NET MVC

619 questions

A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.

Browse all .NET tags

619 questions with ASP.NET MVC tags

Sort by: Updated
1 answer One of the answers was accepted by the question author.

how can add validation 2 drowdownlist

The user comes and selects the city from the first dropdownlist. If the first value is selected from the second dropdownlist, I want it to give an error. I want to add validation but failed. Help me please ? Where is my mistake ? my code ; var…

ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
153 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,212 questions
asked 2023-01-30T08:28:51.2766667+00:00
Harun Ergün 120 Reputation points
accepted 2023-01-30T14:57:54.8766667+00:00
Harun Ergün 120 Reputation points
1 answer One of the answers was accepted by the question author.

How can add HTML paragraph alignment

I have a paragraph with too many words in it. I want it to be left and right aligned. Like Microsoft Word (same as ctrl+D). How can I do this? First ; I want like this ; This is (Ctrl+D) Is there a parameter in html that I can do the same way? My code…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,212 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
153 questions
asked 2023-01-30T12:16:04.8233333+00:00
Harun Ergün 120 Reputation points
edited an answer 2023-01-30T14:07:56.5566667+00:00
Viorel 83,101 Reputation points
2 answers

Request.IsAuthenticated is false when using Azure AD

Hello, In asp.net 4.8 (not Core) web application, I have set Client Id, RedirectUri, Tenant and Authority in Web.Config. In Startup.cs, I have following: string clientId =…

ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,773 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,212 questions
asked 2023-01-12T16:20:38.38+00:00
Joe Green 141 Reputation points
commented 2023-01-30T08:50:02.2+00:00
Givary-MSFT 12,001 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

the taghelper do not rendered?

using Microsoft.AspNetCore.Razor.TagHelpers; namespace tag.Components { [HtmlTargetElement("pagination", TagStructure = TagStructure.WithoutEndTag)] public class PaginationTagHelper : TagHelper { …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-28T01:27:55.3233333+00:00
打玻璃 1,546 Reputation points
accepted 2023-01-30T07:50:24.4733333+00:00
打玻璃 1,546 Reputation points
1 answer One of the answers was accepted by the question author.

How to remove validation-info in text?

in Index.cshtml <form> <div class="row"> <div class="col-sm-2"> <label class="col-form-label">客户:</label> <div> …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-27T12:33:03.2066667+00:00
打玻璃 1,546 Reputation points
accepted 2023-01-30T07:28:47.4566667+00:00
打玻璃 1,546 Reputation points
0 answers

Model is always null on Razor page

hello All, I have the following code on my cshtml page: @if (Model!=null && Model.EmergencyInfos!=null && Model.EmergencyInfos.ToList().Count>0) { var count = Model.EmergencyInfos.Count; @for…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,030 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-30T05:11:54.52+00:00
Anjali Agarwal 141 Reputation points
commented 2023-01-30T06:26:38.4+00:00
Zhi Lv - MSFT 18,891 Reputation points Microsoft Employee
3 answers One of the answers was accepted by the question author.

when user if user leaves blank any step cursor to where error is taken (jquery)

when user if user leaves blank any step cursor to where error is taken For Example var name = $('#name').val(); if (name == '') { $('#name').css('border-color', 'red'); alert('Please write your first and last name') return false; } else…

ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,212 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-24T06:12:55.2933333+00:00
Harun Ergün 65 Reputation points
edited the question 2023-01-30T02:22:04.0733333+00:00
Lan Huang-MSFT 9,281 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

Generate a simple message from controller (blazor page not for razor view)

In a Blazor server application, I have implemented user authentication via cookie. In the Blazor page (not razor view) I have created a form with email and password entries as well as a button for sending the data. The method is Post and is run on the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,030 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
803 questions
asked 2023-01-29T12:11:47.5833333+00:00
perfect code 191 Reputation points
accepted 2023-01-29T15:19:10.56+00:00
perfect code 191 Reputation points
2 answers One of the answers was accepted by the question author.

Logout (delete Auth-Cookie) only possible via form!

I have a Blazor server application (see my post here: https://learn.microsoft.com/en-us/answers/questions/1164837/aspnet-authentication-works-but-value-for-user-ide). Now I have implemented a cookie authentication. This works very well via a login and…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
803 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,030 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
916 questions
asked 2023-01-28T13:26:22.5033333+00:00
perfect code 191 Reputation points
commented 2023-01-28T17:41:48.8333333+00:00
perfect code 191 Reputation points
1 answer One of the answers was accepted by the question author.

What is the difference of = and {get;set;}?

public int PageIndex{get;set;}=0; public int PageIndex=0; what is the difference?

ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
asked 2023-01-27T14:03:05.81+00:00
打玻璃 1,546 Reputation points
accepted 2023-01-28T01:08:55.3866667+00:00
打玻璃 1,546 Reputation points
7 answers

Unable to Resolve Scaffolding Issue in ASP.NET Core MVC Application

I'm getting the following error when I try to scaffold the Login, Logout, and Register pages. I ran the Visual Studio Installer to and clicked on the ASP.NET web development workflow to ensure I have all of the required tools installed. Version…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,457 questions
asked 2023-01-25T03:05:53.0133333+00:00
Xenu 0 Reputation points
commented 2023-01-27T21:32:58.8533333+00:00
Xenu 0 Reputation points
1 answer One of the answers was accepted by the question author.

How to use Service Principal/Managed Identities to access Azure App Configuration from .NET Framework Application?

I need to disable Local Authentication Methods (Access Keys) for Azure App Configuration Stores. Currently for an ASP.NET Framework application, I am using the following for accessing the App Configuration Store from my…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,030 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
185 questions
asked 2023-01-12T12:30:34.1466667+00:00
Aayush Suresh Jain 46 Reputation points
accepted 2023-01-27T17:00:03.9033333+00:00
Aayush Suresh Jain 46 Reputation points
1 answer One of the answers was accepted by the question author.

How to change value of input field in a strongly-typed view from controller

Hello I am using ASP.NET Core 3.1 How can I change the value of the input fields in a strongly-typed view from controller. I have this simple example. I have three input fields and when the usee enters some values and submit them, I modify the values the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-27T11:07:27.1466667+00:00
Jeddah 86 Reputation points
commented 2023-01-27T14:26:50.3766667+00:00
Jeddah 86 Reputation points
1 answer One of the answers was accepted by the question author.

How to use HttpContext or Claims in __Layout.cshtml?

I am using asp.net core 7.0 how to get UserClaims in Pages/Shared/_Layout.cshtml ? I do not want to use ViewData because I have to set it in each page.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-27T07:05:48.23+00:00
打玻璃 1,546 Reputation points
accepted 2023-01-27T12:30:12.55+00:00
打玻璃 1,546 Reputation points
2 answers

MFA\2FA website authentication

would like to setup MFA authentication for users accessing my site on the internet. is there a way to embedd in my web site a start up code is there any solution ready for that perpse the site is public , so meany clients can ping it so ...

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,212 questions
asked 2023-01-25T08:21:43.1+00:00
Eyal 0 Reputation points
edited an answer 2023-01-27T05:38:42.4666667+00:00
SurferOnWww 861 Reputation points
1 answer One of the answers was accepted by the question author.

What is Best Practice for where to place Javascript for a View

In my views, if I need to include Javascript for that specific view only, I will code the page, then just place the Javascript at the bottom, like this: <div class="blabla" onclick="bleep()"></div> <script…

ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-25T18:59:22.02+00:00
Coreysan 841 Reputation points
commented 2023-01-26T18:24:34.4733333+00:00
Coreysan 841 Reputation points
3 answers One of the answers was accepted by the question author.

How can add Phone Number Charecter Validation asp.net mvc web

Guys I have question How can Add Phone Number Charecter Validation For example.. User writing 8 charecter but ı want minimum 10 charecter and maximum 20 charekter how can add ? Model index.cshtml

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
153 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
412 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,030 questions
asked 2023-01-26T09:07:25.9433333+00:00
Harun Ergün 120 Reputation points
answered 2023-01-26T11:19:34.17+00:00
Harun Ergün 120 Reputation points
0 answers

Page refresh?

Hey All:   I am working on an ASP.NET 4.X site (not core) that uses Stripe for payments, and so from the ContactProfile page a user can click Pay, and it takes them to Stripe, and when the payment is processed, redirects back to the Contact Profile page.…

ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-25T20:45:51.5966667+00:00
John Straumann 21 Reputation points
commented 2023-01-25T21:20:42.23+00:00
AgaveJoe 17,316 Reputation points
3 answers

an email is causing errors

One of our business partners provided an email for her client to send out to prospective employees that missed a space between the URL and the instructions, and now is throwing errors in my MVC application which then sends me notification of the error. …

ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-11T21:31:01.5866667+00:00
M J 636 Reputation points
edited an answer 2023-01-25T09:44:22.0266667+00:00
QiYou-MSFT 851 Reputation points Microsoft Vendor
0 answers

The result of computation is different in localhost and website

It is written in .NET 4.5.2. The database is Oracle 19c. There is a column that read from database table. On the online site, the value is 0 (incorrect). When I run the Asp.NET Mvc project in my localhost, the value is 20 (the correct one) . How can I…

ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
619 questions
asked 2023-01-17T12:06:26.6233333+00:00
Taha Sözgen 5 Reputation points
commented 2023-01-24T09:46:20.1233333+00:00
QiYou-MSFT 851 Reputation points Microsoft Vendor