locked
Convert to Uppercase RRS feed

  • Question

  • User1979860870 posted

    Hi

      I have below code . ID is string . I want when data gets saved in Database all lowercase alphabets be converted to UpperCase

    public class Location
        {
            public string Id { get; set; }
            [DataType(DataType.Text)]
            [Required(ErrorMessage = "Please enter Location"), MaxLength(25)]
            [Display(Name = "Location Name")]
            public string Description { get; set; }
        }
    
    
    
    function Add() {
        var objLocation = {
            Id: $('#Id').val(),
            Description: $('#Description').val()
        };
        $.ajax({
            url: "/Location/Add",
            data: JSON.stringify(objLocation),
            type: "POST",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            success: function (result) {
                loadData();
                $('#myModal').modal('hide');
            },
            error: function (errormessage) {
                alert(errormessage.responseText);
            }
        });
    }
    

    Thanks

    Friday, May 14, 2021 1:57 PM

Answers