3
Answers

Globalization Localization Asp Net MVc

Photo of Nabil Nawaz

Nabil Nawaz

7y
243
1
hello guys.
i'm using Globalization and Localization in my Asp Net Mvc project.. i'm facing an issue in it.
the lables in my view. when these are marked through razor like
 
@Html.LabelFor(m=>m.Name) 
 
then after change to arabic it's change the name to arabic. but if i use traditional labels of HTML like
 
<label> Name* </label> 
 
then after selecting arabic the values of this lable is not changed to arabic ?
does not simple html markup supports globalization/localization in mvc ? 
 
kindly tell me how can i fix this ? 

Answers (3)

0
Photo of Deepak Tewatia
14 15.8k 23.6k 1y

It seems that you're encountering a System.NullReferenceException in your ASP.NET project. This type of exception typically occurs when you're trying to access a member (property, method, or field) of a reference type variable that is currently set to null. This means that the variable doesn't point to any object in memory.

To troubleshoot this issue, it's important to trace the code where the exception is being thrown. Look for the specific line or method that's causing the exception. Then, ensure that any objects or variables being accessed at that point are properly initialized and are not null.

Here's an example of how this error might occur:


// Assuming this is where the exception is occurring
MyClass myObject = null;
myObject.DoSomething(); // This line will throw a System.NullReferenceException

In this example, myObject is null, so calling the DoSomething method on it will result in a null reference exception.

To fix this issue, you need to ensure that myObject is properly initialized before calling any of its methods or accessing its properties.

If you could provide a code snippet or more context around where the exception is happening in your ASP.NET project, I may be able to offer more specific guidance.