Microsoft Q&A

.NET

12,858 questions

Microsoft Technologies based on the .NET software framework.

Browse all .NET tags

3,876 questions with .NET-related tags

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

Get Contact details by Id

Hi, How can I get the Contact details by its Id? like this: var contact = await Microsoft.Maui.ApplicationModel.Communication.Contacts.Default.PickContactAsync("contact-id-here"); Thanks, Jassim

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
871 questions
asked 2023-01-19T22:50:06.6066667+00:00
Jassim Al Rahma 1,066 Reputation points
accepted 2023-01-28T10:06:19.1333333+00:00
Jassim Al Rahma 1,066 Reputation points
1 answer One of the answers was accepted by the question author.

Datagridview Font When editing cell

I have not used the Datagridview before so have started a test Windows Forms app to learn about it. I notice that when I edit a cell the font size changes to something too small to read, is there a way to prevent this?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
599 questions
asked 2023-01-27T16:02:10.4366667+00:00
Jeff Gaines 1 Reputation point
commented 2023-01-28T09:40:34.1133333+00:00
Jeff Gaines 1 Reputation point
6 answers One of the answers was accepted by the question author.

How to show a loading prompt in view before the controller loaded the data?

With asp.net core 6.0 mvc It needs several seconds to load data in controller,before that ,how to show a loading promt in the view?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,524 questions
asked 2022-05-23T03:27:10.04+00:00
Alick Wang 1 Reputation point
accepted 2023-01-28T09:02:25.6233333+00:00
Alick Wang 1 Reputation point
1 answer One of the answers was accepted by the question author.

How to ignore ETag checking and fix this error

I read from and write to blob content in Azure blob storage. File is being changed (new content is getting appended to the file) at the same time while it is being downloaded. I get error in the below stream.Read() line. Which I believe is because of…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,524 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.
781 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.
6,914 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
1,388 questions
asked 2023-01-18T12:50:17.69+00:00
Sarah 131 Reputation points
accepted 2023-01-28T07:59:17.6133333+00:00
Sarah 131 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 Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,524 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
579 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.
390 questions
asked 2023-01-27T14:03:05.81+00:00
打玻璃 1,426 Reputation points
accepted 2023-01-28T01:08:55.3866667+00:00
打玻璃 1,426 Reputation points
1 answer One of the answers was accepted by the question author.

Converting Virtual Directory into an Application.

I am attempting to run a application and encounter this error when trying to execute a install script in browser. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. …

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,174 questions
asked 2023-01-07T20:08:38.327+00:00
peter liles 351 Reputation points
accepted 2023-01-27T23:20:03.4233333+00:00
peter liles 351 Reputation points
1 answer One of the answers was accepted by the question author.

Parse an array of objects to a JSON tree structure

I'm trying to use the bootstrap treeview and the JSON needs to be a certain format. I currently have this format: var data = [ { make: "Chevy", model: "2500", location: "lot" }, { make:…

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.
6,914 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
599 questions
asked 2023-01-27T12:38:51.11+00:00
TheCoder 61 Reputation points
edited the question 2023-01-27T21:22:01.69+00:00
Reza Aghaei 2,601 Reputation points Microsoft MVP
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.
6,914 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
579 questions
Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
186 questions
asked 2023-01-12T12:30:34.1466667+00:00
Aayush Suresh Jain 21 Reputation points
accepted 2023-01-27T17:00:03.9033333+00:00
Aayush Suresh Jain 21 Reputation points
1 answer One of the answers was accepted by the question author.

ASPNET authentication works but value for user.Identity.Name is null

I get a null value for user.Identity.Name, but user.Identity.IsAuthenticated returns the correct value. I get my claim values too. I have only found a few posts about user.Identity.Name is null, but nothing has solved it. I have a simple login form: …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,524 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.
781 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.
6,914 questions
asked 2023-01-27T14:29:56.4566667+00:00
perfect code 81 Reputation points
commented 2023-01-27T15:41:38.02+00:00
perfect code 81 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,524 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
579 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.

Shell Navigation and setting Parameter Values

I have included the code that I am using to pass parameters from one view to another view using shell navigation. The issue I am having is that I would like to set my model properties using for example the text entry control. Do I do that using a relay…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
871 questions
asked 2023-01-26T16:27:01.2666667+00:00
Ronald Rex 506 Reputation points
accepted 2023-01-27T14:10:24.3+00:00
Ronald Rex 506 Reputation points
1 answer One of the answers was accepted by the question author.

Shell Navigation and passing Parameter Values

Hi friends, I was wondering how to pass multiple parameters. I can pass one parameter for now... ?Name={Name} Thanks Task Navigate() => Shell.Current.GoToAsync($"{nameof(DetailPage)}?Name={Name}",

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.
6,914 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
871 questions
asked 2023-01-26T20:32:49.7633333+00:00
Ronald Rex 506 Reputation points
accepted 2023-01-27T14:10:02.1066667+00:00
Ronald Rex 506 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,524 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.
390 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
579 questions
asked 2023-01-27T07:05:48.23+00:00
打玻璃 1,426 Reputation points
accepted 2023-01-27T12:30:12.55+00:00
打玻璃 1,426 Reputation points
1 answer One of the answers was accepted by the question author.

Maui android on screen keyboard issue

Hello all. How I can modify the on screen keyboard for my application. I want that the on screen keyboard when my app run to contain only the alphanumeric and a few non alphanumeric characters. How I can do that and when exit my app to return…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
871 questions
asked 2023-01-24T07:23:50.46+00:00
Haviv Elbsz 481 Reputation points
commented 2023-01-27T12:00:08.3266667+00:00
Haviv Elbsz 481 Reputation points
3 answers One of the answers was accepted by the question author.

State Management in .NET Core

Hi All, I am developing an application in .NET Core with angular client. In my application I have scenario where I have data in List<List<Employee>> in one controller in .NET Core API. Now I would like to access this data in another…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,524 questions
asked 2023-01-25T13:53:25.6766667+00:00
Pratham Jain 61 Reputation points
accepted 2023-01-27T11:52:52.3533333+00:00
Pratham Jain 61 Reputation points
1 answer One of the answers was accepted by the question author.

Maui android<helpview /> control issue

Hello all. because there is no helpview control. Is someone here can give me a way to add help to my application. Thank you very much

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
871 questions
asked 2023-01-23T10:25:17.8233333+00:00
Haviv Elbsz 481 Reputation points
accepted 2023-01-27T06:38:03.3533333+00:00
Haviv Elbsz 481 Reputation points
1 answer One of the answers was accepted by the question author.

How to clear text box records before or after downloading a file in ASP.NET web application

using (FileStream fs = File.Create(dataDir + xmlFileToConvertTo)) { Byte[] info = new UTF8Encoding(true).GetBytes(xmlData); fs.Write(info, 0, info.Length); …

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.
390 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.
6,914 questions
asked 2023-01-26T04:58:36.0633333+00:00
Roefatin, Ridzuan 20 Reputation points
commented 2023-01-27T01:34:34.4033333+00:00
Roefatin, Ridzuan 20 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.
579 questions
asked 2023-01-25T18:59:22.02+00:00
Coreysan 801 Reputation points
commented 2023-01-26T18:24:34.4733333+00:00
Coreysan 801 Reputation points
1 answer One of the answers was accepted by the question author.

Questions about MAUI's Entitlement.plist

Hi, How important is the Entitlement.plist in MAUI? and why it's not added by default? so does this mean I don't need to for example to set the Push Notification capabilities? Kindly advise.. Thanks, Jassim

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
871 questions
asked 2023-01-24T13:19:41.7666667+00:00
Jassim Al Rahma 1,066 Reputation points
accepted 2023-01-26T15:39:57.72+00:00
Jassim Al Rahma 1,066 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,524 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.
390 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.
6,914 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
579 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.
142 questions
asked 2023-01-26T09:07:25.9433333+00:00
Harun Ergün 20 Reputation points
answered 2023-01-26T11:19:34.17+00:00
Harun Ergün 20 Reputation points