Question: I am working on asp.net mvc application, After submitting selected date to the database , I want to refresh datepicker , I am able to refresh datepicker only pageload. I dont want to refresh whole page,
I am having input field on popup (datepicker also). On submit button i am using ajax , so the whole page is not refreshed and datepicker holds previous selection, So how can i refresh datepicker.

This is jquery code i am using after ajax 

```
function saveandContinue() {
    if (!validateManageRequestmodel())
        return;
    else
        $("#showerrormsg").hide();

    var model = getManageRequestmodel();
    $.ajax({
        type: "POST",
        url: "AddManageRequest",
        contentType: "application/json",
        data: $.toJSON(model),
        success: function (result) {
            debugger;
            if (result.Status == "ERROR") {
                showErrorMessage('showerrormsg', result.Result);
            }
            else if (result.Status == "OK") {
                showSuccessMessage('showerrormsg', 'Record saved successfully.');
                    **$(".datepicker").datepicker("refresh");**
                iIncrease++;
                if (gsaveParameter === 'add')
                    resetManageRequest();
                else if (gsaveParameter === 'edit') {
                    if (iIncrease < selectedIDs.length)
                        GetDataForEdit(selectedIDs[iIncrease]);
                    else {
                        $('#manageRequestModal').modal('hide');
                        onActionRefreshGrid();
                    }
                }
            }
        },
        error: function (error) {
            debugger;
            showErrorMessage('showerrormsg', error);
        }
    });
}

```

Answer: 
`string::npos` is defined as `constexpr static std::string::size_type string::npos = -1;` (or if it's defined inside the class definition that would be `constexpr static size_type npos = -1;` but that's really irrelevant).

The wraparound of negative numbers converted to unsigned types (`std::string::size_type` is basically `std::size_t`, which is unsigned) is perfectly well-defined by the Standard. `-1` wraps to the largest representable value of the unsigned type, which in your case is `18446744073709551615`. Note that the exact value is implementation-defined because the size of `std::size_t` is implementation-defined (but capable of holding the size of the largest possible array on the system in question).
This is all about signed overflow and the fact that negative numbers are stored as 2s complement. The means that to get the absolute value of a negative number, you invert all the bits and add one. Meaning when doing an 8 bit comparison 255 and -1 have the same binary value of 11111111. The same applies to bigger integers

<https://en.m.wikipedia.org/wiki/Two%27s_complement>