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

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

Localizing RequiredAttribute ASP.NET MVC 3 Preview 1

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


Has anyone got the Localization working for the RequiredAttribute? 

The below DisplayAttribute is localized properly but the RequiredAttribute is not. Any ideas?

[Required(ErrorMessageResourceType = typeof (Account), ErrorMessageResourceName = "ErrorNotation")]
[Display(Name = "UserName", ResourceType = typeof(Account))]
public string UserName { getset; }

View Complete Post

More Related Resource Links

Localizing Windows Forms

The Visual Studio project system provides considerable support for localizing Windows Forms applications. There are two ways to generate resource files using the Visual Studio development environment: one is to have the project system generate the resource files for localizable UI elements such as text and images on the form. The resource files are then built into satellite assemblies. The second way is to add a resource file template and then edit the template with the XML Designer. A reason for doing the latter is to make localizable strings that appear in dialog boxes and error messages. You must then write code to access these resources.

This walkthrough topic demonstrates both processes in a single Windows Application project.

You can also convert a text file to a resource file; for more information, see Resources in Text File Format and Resource File Generator (Resgen.exe).


Vista and Office: View Data Your Way With Our Managed Preview Handler Framework


Stephen Toub shows you how to write your own Preview handlers for Windows Vista and Outlook 2007.

Stephen Toub

MSDN Magazine January 2007

Printing: Preview and Print from Your Windows Forms App with the .NET Printing Namespace


Printing is an integral part of every complete Windows-based application. Providing robust printing capabilities in these applications has often proved to be a tedious chore. Now, printing from Windows Forms with the .NET Framework means you must adopt a document-centric approach, resulting in cleaner and more manageable code. While the System.Windows.Forms namespace provides seamless integration with all the standard print dialogs (such as Print Preview, Page Setup, and Print), the System.Drawing.Printing namespace offers numerous classes for extensibility and customization. These classes, and how they provide access to printing capabilities, are covered here. Other useful techniques, such as printing in the background to allow the user to continue other tasks, is also explained.

Alex Calvo

MSDN Magazine February 2003

Go Global: Localizing Dynamic Web Apps with IIS 5.0 and SQL Server


The success of a database-driven international Web site depends on how well the code and localized content work together with the software on the client and server. Localizing a dynamic Web site is more complicated than localizing a static one. The use of HTML and ASP code for static and dynamic content on IIS 4.0 or 5.0, coupled with Microsoft Data Access Components (MDAC) and SQL Server, enables Web sites to support as many languages as necessary. Choosing the right character sets and code pages, the variations in the Unicode support for IIS 4.0 and 5.0, as well as ways to avoid some common pitfalls are all discussed.

Jeremy Bostron and Doug Rothaus

MSDN Magazine May 2001

MVC 3 Preview 1. Inject value in Action Filter



I was reading MVC3 Preview 1 release and I found this:

Dependency Injection at all levels - We opened up seams for applying the dependency injection when instantiating components of the framework. This allows developers to hook into the creation of models during model binding, action filters, etc.

Does that mean I can inject a value into an Action Filter?

This is a problem I have for a long time and it would be really useful.

How can I do this?



Preview Crystal Report from ASP.net without passing parameters


Hi Everyone,

Sorry couldn't think of any better Subject..

I am developing a User Reports Module using C#.Net using Visual Studio 2005. Basic purpose of this module is to allow user to be able to run their own Crystal Reports. i.e. if Users have their own Crystal Reports specific to their needs then we allow them to save them and view them from our user reports module.

So when user saves any report we save it on server and save the Physical path of that report in database. Now when user tries to view the report I get the location from database and load it. Which works ok. The issue now is those reports which have got parameters. 

I am not saving any information about parameters in their reports. So I do not have any information about Report Parameters.

This same application exists in VB6. What that VB application does is opens the Crystal Report and then Crystal report asks for needed parameters exactly as it will do if we try to open a crystal report using crystal report and preview it from there it asks for parameter values. 

How can I do that in C#.Net.

VB has got code like this

Global Appl As New CRAXDRT.Application

POP Forums v9 preview is going to be a little late

I mentioned with the July preview of POP Forums v9 that there would be an August preview. There will be, but I'm not sure it'll hit in August. It's really starting to feel like an actual app now, and I'm very excited to see it coming along. Unfortunately, I haven't found enough time lately to deliver the things I said would be in this preview. Being a new dad can be like that!On the up side, it is running on MVC3. On the down side, it's running on MVC3, and that's a moving target until it goes from preview to beta. I'll still shoot for this week, and then we'll move on to beta versions. Hooray!

Outlook/MAPI Mail Preview Handler

Hey,I am trying to implement the Preview Pane from explorer into my .net application. I have followed http://msdn.microsoft.com/msdnmag/issues/07/01/PreviewHandlers/default.aspx and gotten almost all handlers to work except the preview handler for Outlook email.I lookup the correct CLSID in registry and uses the Activator to create an instance. Wich allso works perfect and it for all other Preview Handler, it also casts well to IPreviewHandler. But unlike other Preview Handlers, i am not able to cast it to one of the two interfaces mentioned by Microsoft IInitializeWithFile or IInitializeWithStream, which are used for loading the file into the preview handler. Do anyone know of another interface used to load files i Preview Handlers? [ComImport] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("8895b1c6-b41f-4c1c-a562-0d564250836f")] interface IPreviewHandler { void SetWindow(IntPtr hwnd, ref RECT rect); void SetRect(ref RECT rect); void DoPreview(); void Unload(); void SetFocus(); void QueryFocus(out IntPtr phwnd); [PreserveSig] uint TranslateAccelerator(ref MSG pmsg); } [ComImport] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("b7d14566-0509-4cce-a71f-0a554233bd9b")] interface IInitializeWithFile { void Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszFilePath, uint grfMode); } [ComImpo

null value shown in excel source editor when preview

hi all i am uploading excel (.xlsx) file. when i preview in excel source editor it shows all numeric value as 'null' value.  it taking it has Unicode string [DT_WSTR] data type. i formatted all cells trying with general and text type but it still shows as null value. what could i do to this?  thank you ppl, romal.

Infopath Changed Event code triggering in preview but not in web filler.

Hi there, I've written some code for a changed event hookup on a field in infopath 2010. The form is for submission to a sharepoint 2010 forms library. What the code does is fill in a specific value into a field depending on the selected value from a combo-box elsewhere on the form. When i preview this in Infopath 2010 it works perfectly but when i fill out the form through the web interface it simply does nothing. I've got another piece of code which executes on load and this works perfectly in both the preview and the web filler. What it does is just set the value of a field when the form loads. Here is the code, could someone tell me what i'm doing wrong? public void InternalStartup() { EventManager.XmlEvents["/my:myFields/my:service_level"].Changed += new XmlChangedEventHandler(service_level_Changed); EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading); } public void service_level_Changed(object sender, XmlEventArgs e) { // Write your code here to change the main data source. XPathNavigator xroot = MainDataSource.CreateNavigator(); XPathNavigator serviceLevel = xroot.SelectSingleNode("/my:myFields/my:service_level",NamespaceManager); XPathNavigator xest = xroot.SelectSingleNode("/my:myFields/my:est_cost", NamespaceManager); switch (serviceLevel.Value)

July preview of POP Forums v9 for ASP.NET MVC3 posted to CodePlex

Here it is, the third preview release of POP Forums v9. It's starting to smell like a real application now. New since the last release: Text parsing of HTML and "forum code" Dropped in TinyMCE text editor (still needs some customization and option for plain text) Security logging User profiled editing, for the users and admins, including avatar and photo uploads Admin pages for most of the forum settings, including category and forum management E-mail confirmation for new accounts, with verification mechanism View counting Runs on ASP.NET MVC3 (see notes below) Lots o' refactoring and more unit tests (now over 400) Other notes Keep in mind that this is still a preview, it's way rough around the edges, and it's in dire need of additional refactoring. This release requires ASP.NET MVC3, which is itself in preview mode. The views have not yet been converted to use the Razor view engine (because it's slightly hard without the tooling), but the dependency injection features are used here, and that's some delicious goodness that allowed for the destruction of much code. Look for the Ninject implementation of the service locator interface to see how it works. The unfortunate piece of this is that it throws exceptions on every request (and eats them) because the interface requires the throw when it doesn't find an implementation of the controller factory. That's

Another way to Get Start ASP.NET MVC 3 (Preview 1)

     Introduction:           A month ago when the ASP.NET MVC team released ASP.NET MVC 3 (Preview 1). Lot of developers enjoyed and tested this release. But still many developers unable to install ASP.NET MVC 3 (Preview 1) in their machine due to various reasons. Some developers claimed at here and here that MVC 3 (Preview 1) installed successfully but when they create a new MVC 3 project then Visual Studio says, 'The project type is not supported by this installation'. Some developers don't like to install new software just for testing new features. Some developers don't have permission to install the ASP.NET MVC 3 on their machine currently but keen to see and test the new features. So in this article I will show you how get ASP.NET MVC 3 (Preview 1) running on their machine another way.       Description:           First of all create a new ASP.NET MVC 2 application. Then open the Find and Replace window and select Current Project(or Entire Solution) from the Look in combo box and replace, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35 with, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=null             &n

Report Builder 3 report preview error in SharePoint integrated mode

Hello folks! I've faced some strange error with RB 3.  My environment is: Win 2008R2+SQL2008R2 CU3+Sharepoint Foundation services 2010 SharePoint services integrated with Reporting Services.  When I try to run RB3 from SharePoint library and built some report I get strange error at the previw screen : Failed to preview report. The item 'http://myserver/cd6409dc-1089-4e8a..' cannot be found. Details: System.Web.Services.Protocols.SoapException: The item 'http://myserver/cd6409dc-1089-4e8a-a2a4-f231c97039aa' cannot be found. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemNotFoundException: The item 'http://myserver/cd6409dc-1089-4e8a-a2a4-f231c97039aa' cannot be found.    at Microsoft.ReportingServices.WebServer.ReportingService2010Impl.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)    at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)  The most intresting thing, that my test environment with Win 2008R2 CTP+SQL2008R@ Nov CTP is working properly without any error. Could you please advise how to resole this problem? Thanks in advance, Andre.  

Getting error when trying to fetch the preview of reports

Hi, This is the error I am getting when I try to generate the preview of the report existed in OEMCRM reports cannot be run because the connector for Microsoft SQL Server Reporting Services, a required componentfor reporting, is not installed on the server that is running Microsoft SQL Server Reporting Services. Help me if you have any ideas.
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