Hi, Peter,
unfortunately this is not the case. I have this problem with both, English
as well as German formatted prices. In the meantime I've found out that my
webserver converts SQL SMALLMONEY values into decimal values having a 4
digit precision. This value irritates the Validator. Here's an exact
description of the problem:
http://www.gotdotnet.com/Community/M...aspx?id=214327
Any help is quite appreciated!
TIA,
Axel Dahmen
--------------------
"Peter Blum" <PLBlum@Blum.info> schrieb im Newsbeitrag
news:exfsUnMJEHA.2456@TK2MSFTNGP12.phx.gbl...[color=blue]
> The current culture of the web form is used to convert from the string
> "500,000.00" to a decimal value. If that culture treats "," as a decimal
> place and period as a thousands separator (like many countries do), you[/color]
will[color=blue]
> get that error. Most likely your server is setup with a different default
> culture than your development computer.
>
> See the System.Globalization.CultureInfo object documention for an[/color]
overview[color=blue]
> of cultures.
>
> See the <@ Page Culture= > attribute for setting a culture on one page.
> You can also set the culture in the current thread:
> System.Threading.Thread.CurrentCulture = [your CultureInfo object]
>
> --- Peter Blum
>
www.PeterBlum.com
> Email:
PLBlum@PeterBlum.com
> Creator of "Professional Validation And More" at
>
http://www.peterblum.com/vam/home.aspx
>
> "Axel Dahmen" <NO_SPAM@NoOneKnows.de> wrote in message
> news:egQcNmAJEHA.1572@TK2MSFTNGP11.phx.gbl...[color=green]
> > Hi,
> >
> > I've got the same problem as described below. No answer found yet. Can
> > someone please help? (I'm using .NET 1.0 on my development machine and[/color][/color]
1.1[color=blue][color=green]
> > on my webserver. Like Susanna, I only get the error on my webserver.)
> >
> > TIA,
> > Axel Dahmen
> >
> > --
> > I used compare validator control "ValueToCompare" in my aspx file like
> > this:
> >
> > <asp:comparevalidator id="CompareValidator1" runat="server"
> > CssClass="image-caption" ValueToCompare="500,000.00"
> > Operator="LessThanEqual" Type="Currency" ErrorMessage="Tast inn et
> > tall som ikke er høyere enn 500000!" Display="Dynamic"
> > ControlToValidate="txtLaneSum" Text=""></asp:comparevalidator>
> >
> >
> > And it works fine on my development server. but when I have installed
> > this .NET application to the production server, I can not get the
> > ASP.NET page to work. I am given an error message as the following:
> >
> > Server Error in / Application
> > The value '500,000.00' of the ValueToCompare property of
> > 'CompareValidator1' cannot be converted to type 'Currency'.
> > Description: An unhandled exception occurred during the execution of
> > the current web request. Please review the stack trace for more
> > information about the error and where it originated in the code.
> >
> > Exception Details: System.Web.HttpException: The value '500,000.00' of
> > the ValueToCompare property of 'CompareValidator1' cannot be converted
> > to type 'Currency'.
> >
> > Source Error:
> >
> > An unhandled exception was generated during the execution of the
> > current web request. Information regarding the origin and location of
> > the exception can be identified using the exception stack trace below.
> >
> > Stack Trace:
> >
> >
> > [HttpException (0x80004005): The value '500,000.00' of the
> > ValueToCompare property of 'CompareValidator1' cannot be converted to
> > type 'Currency'.]
> > System.Web.UI.WebControls.CompareValidator.Control PropertiesValid()
> > +415
> > System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter
> > writer) +85
> > System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> > System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
> > System.Web.UI.HtmlControls.HtmlForm.RenderChildren (HtmlTextWriter
> > writer) +44
> > System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTex tWriter output)
> > +395
> > System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> > System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
> > System.Web.UI.Control.Render(HtmlTextWriter writer) +7
> > System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> > System.Web.UI.Page.ProcessRequestMain() +1900
> >
> >
> > Any ideas/help you can offer would be greatly appreciated.
> >
> > Thanks
> > Susanna Chen
> >
> >[/color]
>
>[/color]