You must Sign In to post a response.
  • Category: .NET

    "myear" obtained is coming from request parameter.

    Hi Team,

    Am stuck can anyone guide me on this for the below code i have to do changes

    The if condition is only checking for null or empty, this wouldn't fix the flaw. Validate the year for numeric format

    "string Year = Request.Params[""year""];

    if (Year == null || Year.Equals(""""))
    Year = System.DateTime.Now.Year.ToString();
  • #762604

    You can check for numeric like this in javascript.
    var num = /^[0-9]+$/;
    if ((year != "") && (!num.test(year)))
    alert("Please Enter Numeric Only");
    return false;


    Sai Krishna Reddy.

Sign In to post your comments