Since we implemented globalization in our ASP.net website, we are getting some intellisense problems.
When the resource is added to an asp.net control, we receive errors. Even though the error is shown in visual studio, the application works!
For example, the following button
<asp:Button runat="server" ID="BtnSave" Text="<%$ Resources:ResourceName, Save %>" OnClick="BtnSave_Click" />
Is not recognized in the code behind:
The error is only shown when the code behind is open. But in the browser it works!
The same button without the resource reference works well:
<asp:Button runat="server" ID="BtnSave" Text="Save" OnClick="BtnSave_Click" />
This is a custom SQL resource provider factory, added to the web.config:
<globalization resourceProviderFactoryType="MyNamespace.SqlResourceProviderFactory" />
I tried deleting the cache and restarting the computer already.
Do you have any tips on how to find the issue?
Thanks in advance.
If you precompile your code-behind classes into an assembly, you can use the Inherits attribute to specify the class from which to inherit. In this scenario, you do not have to include the actual code-behind class file when you deploy the application. Instead, you must deploy the assembly and the . aspx page.
The code-behind feature of ASP.NET enables you to divide an ASP.NET page into two files - one consisting of the presentation data, and the second, which is also called the code-behind file, consisting of all the business logic.
aspx. cs code is run server side, while the . aspx file is compiled on the server and is then served to the web client requesting it. Additionally, for MVC, I would suggest using a different view model, specifically Razor, which uses .
I had this problem when I created a new VS2010 solution and dragged in an existing website. To solve it right click on the project and 'Convert to Web Application' which will create designer files and fix the intellisense problems.
Had this a few times myself, but unreleated to globalization.
I always solved it by restarting VS (which it looks like you've tried) or checking the class names in the front end code and back and code are the same.
It sounds like a stupid thing, but if you copy a page, then the class name doesn't update so the bindings go a little skewiffy (that's a technical term).
May not help, but it's something to check.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With