This is a migrated thread and some comments may be shown as answers.

Input string was not in a correct format

1 Answer 166 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Leonid
Top achievements
Rank 1
Leonid asked on 04 May 2012, 10:02 AM
We have a page with search form, which uses 2 RadDatePicker components.

<div class="calendar date">
    <table>
        <tr>
            <td>
                <asp:Label runat="server" AssociatedControlID="DateFrom"><%=GetTranslatedText("LANG_WEB_MOBS_LASTMINUTE_DEPARTURE_DATE_LARGE")%></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadDatePicker ID="DateFrom" runat="server" Width="100px">
                    <ClientEvents OnDateSelected="OnDateFromSelected" />
                </telerik:RadDatePicker>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="WeekDayCheckIn" runat="server">Dienstag</asp:Label>
            </td>
        </tr>
    </table>
</div>
<div class="calendar duration">
    <table>
        <tr>
            <td>
                <asp:Label runat="server" AssociatedControlID="Duration"><%=GetTranslatedText("LANG_WEB_MOBS_LASTMINUTE_DURATION")%></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:DropDownList runat="server" ID="Duration" onchange="SetReturnDate_CY('ctl00_ContentMainPlaceHolder_SearchForm_');GetDayOfWeek('ctl00_ContentMainPlaceHolder_SearchForm_');">
                                    <asp:ListItem Value="" Text="Bitte wählen"></asp:ListItem>
                                    <asp:ListItem Value="" disabled="disabled" Text="-------------"></asp:ListItem>
                                    <asp:ListItem Value=">=1 <=5" Text="1-5 Nächte"></asp:ListItem>
                                    <asp:ListItem style="font-weight: bold;" Value=">=6 <=8" Text="6-8 Nächte(1 Woche)"></asp:ListItem>
                                    <asp:ListItem Value=">=9 <=12" Text="9-12 Nächte"></asp:ListItem>
                                    <asp:ListItem style="font-weight: bold;" Value=">=13 <=15" Text="13-15 N. (2 Wochen)"></asp:ListItem>
                                    <asp:ListItem Value=">=16 <=19" Text="16-19 Nächte"></asp:ListItem>
                                    <asp:ListItem style="font-weight: bold;" Value=">=20 <=22" Text="20-22 N. (3 Wochen)"></asp:ListItem>
                                    <asp:ListItem Value="" disabled="disabled" Text="-------------"></asp:ListItem>
                                    <asp:ListItem Value=">=1 <=1" Text="1 Nacht"></asp:ListItem>
                                    <asp:ListItem Value=">=2 <=2" Text="2 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=3 <=3" Text="3 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=4 <=4" Text="4 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=5 <=5" Text="5 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=6 <=6" Text="6 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=7 <=7" Text="7 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=8 <=8" Text="8 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=9 <=9" Text="9 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=10 <=10" Text="10 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=11 <=11" Text="11 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=12 <=12" Text="12 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=13 <=13" Text="13 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=14 <=14" Text="14 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=15 <=15" Text="15 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=16 <=16" Text="16 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=17 <=17" Text="17 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=18 <=18" Text="18 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=19 <=19" Text="19 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=20 <=20" Text="20 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=21 <=21" Text="21 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=22" Text=">21 Nächte"></asp:ListItem>
                                </asp:DropDownList>
            </td>
        </tr>
    </table>
</div>
<div class="calendar date">
    <table>
        <tr>
            <td>
                <asp:Label runat="server" AssociatedControlID="DateTo"><%=GetTranslatedText("LANG_WEB_MOBS_LASTMINUTE_RETURN_DATE_LARGE")%></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadDatePicker ID="DateTo" runat="server" Width="100px">
                    <ClientEvents OnDateSelected="OnDateToSelected" />
                </telerik:RadDatePicker>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label runat="server" ID="WeekDayCheckOut">Dienstag</asp:Label>
            </td>
        </tr>
    </table>
</div>

and a piece of javascript code :

function SetReturnDate_CY(prefix)
{
    if (document.getElementById(prefix+'Duration')) {
            dt = $find(prefix+'DateFrom').get_selectedDate();
            min_duration = MinDuration_CY(prefix);
            max_duration = MaxDuration_CY(prefix);
            var one_day = 1000 * 60 * 60 * 24;
            if ($find(prefix+'DateTo').get_selectedDate()) {
                dt2 = $find(prefix+'DateTo').get_selectedDate();
                //Calculate difference btw the two dates, and convert to days
                var diff = Math.ceil((dt2.getTime() - dt.getTime()) / one_day);
            }
            else {
                dt2 = dt;
                diff = 0;
            }
            calendar=$find(prefix+"DateTo");
            if(calendar)
            {
                if (diff < min_duration) {
                    dt2.setTime(dt.getTime() + (max_duration+7) * one_day);
                    calendar.set_selectedDate(dt2);
                }
                var min_return_date=dt;
                min_return_date.setTime(dt.getTime()+one_day);
                calendar.set_minDate(min_return_date);
            }
    }
// SetReturnDate


Default values are set by C# code directly. In general it works fine, but the problem is, that we get errors from calendar components like this - 



User Agent:        Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)


Error Message:  Input string was not in a correct format.


Error Source:        mscorlib
Error TargetSite:    Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
Error Stack Trace:      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at Telerik.Web.UI.Calendar.Utils.Utility.ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, String inputString)
   at Telerik.Web.UI.RadCalendar.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


These errors come from unknown user and we have no clue, how to reproduce and how to fix it. We use the version RadControls for ASP.NET AJAX Q3 2011. Do you have any ideas, why this can happen?

Best regards,
Leonid
Mark
Top achievements
Rank 2
commented on 07 Oct 2024, 02:13 PM

Was this ever resolved?  I'm getting the same error in 2024, using the current latest version.    The issue seems impossible to replicate, but when users experience it, they get it repeatedly...  The page does contain several Telerik datetime pickers but from what i can tell of the form postback data, none actually contained any values.     As best i can tell the user did a search on a last name via a textbox.  This filtered the results displayed on a radgrid, and then the user clicked one of the rows in the rad grid and got the error.  

 

StackTrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Telerik.Web.UI.Calendar.Utils.Utility.ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, String inputString)
at Telerik.Web.UI.RadCalendar.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.d__394.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.UI.Page.d__393.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Util.WithinCancellableCallbackTaskAwaitable.WithinCancellableCallbackTaskAwaiter.GetResult() 

 

 

Non-Blank Values:
ctl00$radScriptManager1=|ctl00$ContentPlaceHolder1$upnlMain|ctl00$ContentPlaceHolder1$Applicants|
ctl00_radScriptManager1_TSM=|;;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-US:c82af930-19dc-413f-8eab-f4d14a852a96:ea597d4b:b25378d2;;AjaxControlToolkit, Version=20.1.0.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-US:c4eb885e-4e86-4858-819d-193000598f6e:cd9be5ef:f2800037:2761bb61:10439726:c99a1521:dffb332:891e6cc6:9833e5c:f06639ea:98f9cc63:dda46be5:7b2ffb77:d6567903|
__EVENTTARGET=|ctl00$ContentPlaceHolder1$Applicants|
__EVENTARGUMENT=|FireCommand:ctl00$ContentPlaceHolder1$Applicants$ctl00;RowClick;2|
ctl00_RadSchedulerMain1_SelectedDateCalendar_SD=|[[2024,10,7]]|
ctl00_RadSchedulerMain1_SelectedDateCalendar_AD=|[[1900,1,1],[2099,12,30],[2024,10,7]]|
ctl00_RadSchedulerMain1_ReminderDialog_RemindersList_ClientState=|{"isEnabled":true,"logEntries":[],"selectedIndices":[],"checkedIndices":[],"scrollPosition":0}|
ctl00$RadSchedulerMain1$ReminderDialog$SnoozeTime=|5 minutes before start|
ctl00_RadSchedulerMain1_ClientState=|{"scrollTop":0,"scrollLeft":0,"isDirty":false}|
ctl00$ContentPlaceHolder1$hdnShowDateFilter=|1|
ctl00$ContentPlaceHolder1$txtLastName=|smith|
ctl00$ContentPlaceHolder1$rcbStatus=|Current Records|
ctl00_ContentPlaceHolder1_dteFrom_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteFrom_calendar_SD=|[]|
ctl00_ContentPlaceHolder1_dteFrom_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dteTo_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteTo_calendar_SD=|[]|
ctl00_ContentPlaceHolder1_dteTo_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00$ContentPlaceHolder1$Applicants$ctl00$ctl02$ctl00$PageSizeComboBox=|20|
ctl00$ContentPlaceHolder1$Applicants$ctl00$ctl03$ctl01$PageSizeComboBox=|20|
ctl00_ContentPlaceHolder1_Applicants_ClientState=|{"selectedIndexes":["2"],"selectedCellsIndexes":[],"unselectableItemsIndexes":[],"reorderedColumns":[],"expandedItems":[],"expandedGroupItems":[],"expandedFilterItems":[],"deletedItems":[],"hidedColumns":[],"showedColumns":[],"groupColsState":{},"hierarchyState":{},"popUpLocations":{},"draggedItemsIndexes":[]}|
ctl00$ContentPlaceHolder1$rcbEditCaseManagerAssignmentEntities=|Select|
ctl00$ContentPlaceHolder1$rcbEditCaseManagerAssignmentCaseManager=|Unassigned|
ctl00_ContentPlaceHolder1_rcbEditReferralAssignmentReferrals_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteHsSent_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteHsSent_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteHsSent_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dteAdoptivePlacement_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteAdoptivePlacement_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteAdoptivePlacement_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dtePpVisit_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dtePpVisit_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dtePpVisit_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dteFinalization_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteFinalization_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteFinalization_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dteAdoptiveOrder_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteAdoptiveOrder_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteAdoptiveOrder_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dtePmtMailed_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dtePmtMailed_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dtePmtMailed_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dteProcessLetter_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteProcessLetter_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteProcessLetter_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dtePmtReceived_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dtePmtReceived_calendar_SD=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dtePmtReceived_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_dteOther_dateInput_ClientState=|{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minDateStr":"1980-01-01-00-00-00","maxDateStr":"2099-12-31-00-00-00","lastSetTextBoxValue":""}|
ctl00_ContentPlaceHolder1_dteOther_calendar_SD=|[]|
ctl00_ContentPlaceHolder1_dteOther_calendar_AD=|[[1980,1,1],[2099,12,30],[2024,10,7]]|
ctl00_ContentPlaceHolder1_tvTasks_ClientState=|{"expandedNodes":[],"collapsedNodes":[],"logEntries":[],"selectedNodes":[],"checkedNodes":[],"scrollPosition":0}|
ctl00_ContentPlaceHolder1_rgAssignmentHistoryBirthMother_ClientState=|ctl00_ContentPlaceHolder1_lbtnSearch|
__ASYNCPOST=|true|

 

-Mark

Vasko
Telerik team
commented on 10 Oct 2024, 09:20 AM

Hello Mark,

I tried replicating the behavior but as you said the issue is quite hard to replicate based on the given information. If you happen to replicate it on a runnable sample project and send it for further investigations or share the steps to replicate it, please share the information.

    Regards,
    Vasko
    Progress Telerik

    1 Answer, 1 is accepted

    Sort by
    0
    BabaYa
    Top achievements
    Rank 1
    answered on 08 May 2012, 08:24 AM
    Hi,

    Try to upgrade to latest telerik. I use their calendars and they broke it mani times in previous version. Latest still have some problems but your issue can resolved.

    Thanks
    BabaYa
    Tags
    Calendar
    Asked by
    Leonid
    Top achievements
    Rank 1
    Answers by
    BabaYa
    Top achievements
    Rank 1
    Share this question
    or