Watch this example on YouTube:
Replace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class ErrorTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
double err;
bool valid = double.TryParse("3.3", NumberStyles.Currency, CultureInfo.GetCultureInfo("en-us"), out err);
}
}
}
With
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
namespace WebApplication1
{
public partial class ErrorTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
double err;
bool valid = double.TryParse("3.3", NumberStyles.Currency, CultureInfo.GetCultureInfo("en-us"), out err);
}
}
}
No comments:
Post a Comment