I understand .resx files, and how labels, buttons, etc., are populated from them.
My question is what about Javascript messages. This application is very Javascript intensive in the sense of alerts to enforce business rules. Some of this functionalality will be replaced with ASP.Net validation controls, but not all will be. Currently all Javascript functions are in seperate .asp files within script tags, and when an alert is fired, the language displayed comes from an .asp "lang" file.
Sample code looks like this: alert("<%=strAlertMessage%>");
Is there a way with .Net that the correct language can be displayed in a Javascript alert message without using a crazy hack like what is being used with the classic ASP solution. I want to take full advantage of ASP.Net for this conversion.
Thankscodermarc--
Regarding this...
codermarc wrote:
...I will soon be participate in the conversion of a large site from classic ASP to ASP.Net...
...My question is what about Javascript messages. This application is very Javascript intensive in the sense of alerts to enforce business rules...
...there is virtually always a major problem in the architecture that "is very Javascript intensive in the sense of alerts to enforce business rules".
In general, it is a VERY bad idea.
Rather, a rule engine should run in the middle-tier.
Also, in general, JavaScript should be avoided where possible in ASP.NET for many reasons such as...
(1) JavaScript can be disabled by an enduser in the browser's preferences therefore it is not useful for critical path functionality;
(2) JavaScript can be hacked much more easily than server-side logic;
(3) JavaScript is difficult to debug and maintain;
...and so on.
HTH.
0 comments:
Post a Comment