.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Required attribute with resource definition uses wrong language

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
Hi all,I'm having a problem with a multilanguage application in MVC. On my model I'm using the following:[Required(ErrorMessageResourceType = typeof(VlanResources.Errors), ErrorMessageResourceName = "Common_NameRequired")] This takes care of validation... However the messages are always in the default language. Meaning that the setting of the culture of my thread is occuring too late (I'm currently setting it in my base controller 'OnActionExecuting'). Where could I patch in to change the culture accordingly before validation takes place?Thank you for your assistance,Ivan

View Complete Post

More Related Resource Links

Server ERROR: An error occurred during the parsing of a resource required to service this request.

I have created one asp.net 2.0 application and created a setup project. I run this setup in my local machine, the application run fine, but i uploaded into online server I met the following parser error.How to solve this error? Kindly help me. Very urgent.. Kamal....

why runat="server" attribute is required for ajaxcontroltoolkit controls?

the doubts i have may looks silly,i started my carrier in dotnet recently,1)we are calling them as client side controls,then what is the need for runat server attribute?2)<asp:Button ID="Button1" runat="server" Text="Button" /> <asp:ConfirmButtonExtender ID="Button1_ConfirmButtonExtender" runat="server"              ConfirmText="Really?" Enabled="True" TargetControlID="Button1">  </asp:ConfirmButtonExtender>when i execute the above code,i observed that in status bar message as "connecting to localhost",if they are client side controls what  is the need of going to local server,why it is happening?Thanks in advance.

Entering required attribute to dataColumn


Hi, i am trying to create a datatable entering the columns that i create before, but i have a problem, the dataColumn doesn't have the required data, there is a AllowDbNull but it doesn't work.

Then i would like to add other restrctions like MinLegth.

Does anybody know how to do this?


Only Web services with a [ScriptService] attribute on the class definition can be called from script


I have created a web service.  When I check the service directly from it's web page it works correctly. Here's what the code looks like:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Configuration;
using System.Runtime.Serialization;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
using System.Runtime.Serialization.Json;
using System.IO;
using System.Text;
using Microsoft.SharePoint;
using System.Collections;

namespace MDA.WebParts.SPRolodex_Web_Service
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class SPRolodex_Web_Service : System.Web.Services.WebService

        public SPRolodex_Web_Service()


        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public bool ListExi

There has been an error while loading the form. A required resource could not be downloaded. To try

Actually i create site and publish some infopath files .I open the infopath form in browser enble and save to particular site.When open it in intranet it ok but when i open it i Internet it give me error as

"There has been an error while loading the form. A required resource could not be downloaded. To try to resume the download, refresh the page."

 the main thing i obserb that while opening the file in internet it redirect to intranet .so change the url according to internet url and i got errror as above .

pradipta nayak

SMO: SQL Server 2008, SP2: Attribute Database.ActiveConnections is still wrong!


When retrieving databases with SMO from a server, Database.ActiveConnections is still 1, after Database.Refresh() the value  is reset to 0.

But one value is always > 0 ???

Code looks like follows (taken from SQL Server samples ManageDatabases ..)


                foreach (Database db in Server.Databases)


                    if (db.IsSystemObject == false && db.IsAccessible == true)



                            = DatabasesListView.Items.Add(db.Name);

                        if ((db.Status & DatabaseStatus.Normal)

                            == DatabaseStatus.Normal)



Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

New Language features in .NET4.0

The site explains the new features and enhancement to VB.NET and C# in .NET framework 4.0. The new enhancements are described in detail with examples and code snippets. One can easily understand the new features from this site. This is a must visit site for every .NET professional.

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

Voice eXtensible Markup Language


This document specifies VoiceXML, the Voice Extensible Markup Language. VoiceXML is designed for creating audio dialogs that feature synthesized speech, digitized audio, recognition of spoken and DTMF key input, recording of spoken input, telephony, and mixed-initiative conversations. Its major goal is to bring the advantages of web-based development and content delivery to interactive voice response applications.
Status of This Document

This document is a submission to the World Wide Web Consortium from the VoiceXML Forum (see Submission Request, W3C Staff Comment). For a full list of all acknowledged Submission, please see Acknowledged Submissions to W3C.

This document is a Note made available by W3C for discussion only. This work does not imply endorsement by, or the consensus of the W3C membership, nor that W3C has, is, or will be allocating any resources to the issues addressed by the Note. This document is a work in progress and may be updated, replaced, or rendered obsolete by other documents at any time.

Printing resource files



I have some resource files for localization and would like to print them. When I try to print them in Visual Studio (with File -> Print...) the button is disabled. Does anyone know how to print them? (Without copying each into word or excel)

Thanks and regards,

Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

I am not able to read xml file with XDocument if its Descendants has Attribute xmlns="http://abc.co


I am not able to read xml file with XDocument if its Descendants has  Attribute like:-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <row ID="1" xmlns="http://www.opentravela.org/OTA/2003/05">
    <var country_name="Caribbean and Rest of the world" city_name="Kingston" flight_category="Economy Class" via="Atlanta" flight_departure="London Heathrow" airline_logo="Delta" adult_fare="Delta" child_fare="660" infant_fare="561" date1="132" date2="2010-08-15" />


I don't know what to do ?

Looking for some help..

sql server 2005 enterprise edition is required


sql serve 2005 enterprise edition is required to work with microsoft enterprise blocks


set messageTemplateResourceName from resource file in Validation appication block.



  I am using Validation application block in my project and want to set validation message from resource file, but not able to do that. I tried giving the path of resource file in messageTemplateResourceType and name of resource in messageTemplateResourceName. But it did not help as I only receive the message if I have set something in messageTemplate even after setting the resource file.

Here is my code:

<validator lowerBound="1" lowerBoundType="Inclusive" upperBound="250"
              upperBoundType="Inclusive" negated="false" messageTemplate=""
              messageTemplateResourceType="Asurion.jCare.Common.Resources.UIResources.PerilTypeAndDetailsSection, Asurion.jCare.Common.Resources, Version=, Culture=neutral, PublicKeyToken=null"
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.Enterpris

Category attribute of user control property does not work correctly in categories tab.



I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
set { /* the code for set */; }
get { /* the code for get */; }

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.

how to make a css style background image be linked to an image in the resource file


hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.

thanks in advance

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend