EmptyMessage and browser back button

7 posts, 0 answers
  1. Patrick
    Patrick avatar
    10 posts
    Member since:
    Feb 2011

    Posted 19 Dec 2012 Link to this post

    I have a page with a NumericTextBox with EmptyMessage set. This works and the EmptyMessage text is shown when the page loads. There is a problem when you go to a different page and then click the browser back button to return to the original page. In this case the EmptyMessage text is not shown. I tried this in IE8 and Chrome and get the same results in both. Is there a way to make this work?

    Here is the code:
    <asp:TextBox ID="textExistingAssets" MaxLength="10" Width="100" runat="server" />
    <asp:RequiredFieldValidator ErrorMessage="Field is required" ControlToValidate="textExistingAssets" Display="Dynamic"
                            EnableClientScript="False" runat="server" />
     
    <telerik:RadInputManager runat="server">
            <telerik:NumericTextBoxSetting Type="Currency" DecimalDigits="0" MinValue="0" MaxValue="2000000000" EmptyMessage="$">
                <TargetControls>
                    <telerik:TargetInput ControlID="textExistingAssets" />
                </TargetControls>
                <Validation IsRequired="false" />
            </telerik:TextBoxSetting>
        </telerik:RadInputManager>
  2. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 21 Dec 2012 Link to this post

    Hi Patrick,

    I was not able to reproduce the issue. I prepared a small sample and attached it to this forum post. Could you please give it a try and let me know how it differs from your real setup?

    Kind regards,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Patrick
    Patrick avatar
    10 posts
    Member since:
    Feb 2011

    Posted 02 Jan 2013 Link to this post

    Hi Kostadin,
    Thanks for the sample code. I was not able to reproduce the problem with your sample code. But I did some further testing and found that the problem occurs when the clicked button redirects to another page in the server click event. I've modified your sample to show the problem and pasted it below. Here are the repro steps:

    1. Load page, note that "$" appears in the textbox.
    2. Click the button to go to Google.com
    3. Click the browser back button.
    4. The "$" text is no longer in the textbox.

    Default.aspx:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
            <asp:TextBox ID="textExistingAssets" MaxLength="10" Width="100" runat="server" />
            <telerik:RadInputManager ID="RadInputManager1" runat="server">
                <telerik:NumericTextBoxSetting Type="Currency" DecimalDigits="0" MinValue="0" MaxValue="2000000000" EmptyMessage="$">
                    <TargetControls>
                        <telerik:TargetInput ControlID="textExistingAssets" />
                    </TargetControls>
                    <Validation IsRequired="false" />
                </telerik:NumericTextBoxSetting>
            </telerik:RadInputManager>
            <br />
            <button onserverclick="ButtonUpload_Click" runat="server">Click Here</button>
        </form>
    </body>
    </html>

    Default.aspx.cs:
    using System;
     
    public partial class Default : System.Web.UI.Page
    {
        protected void ButtonUpload_Click(object sender, EventArgs e)
        {
            Response.Redirect("http://google.com");
        }
    }

  5. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 04 Jan 2013 Link to this post

    Hello Patrick,

    The issue is reproducing only in IE. As a workaround you could use the following JavaScript:
    function pageLoad() {
        $find("<%= RadInputManager1.ClientID %>").updateValueForAllTargetInputs()                   
    }

    All the best,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Patrick
    Patrick avatar
    10 posts
    Member since:
    Feb 2011

    Posted 04 Jan 2013 Link to this post

    I tried this but I'm getting an error for updateValueForAllTargetInputs. The browser is saying this is not a valid method. I can't find any documentation on this method. Is it in a newer version of the Telerik controls?

  7. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 09 Jan 2013 Link to this post

    Hi Patrick,

    On my side everything work properly. I prepared a small sample and attached it to this forum post. Could you please give it a try and let me know about the result?

    Regards,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Patrick
    Patrick avatar
    10 posts
    Member since:
    Feb 2011

    Posted 15 Jan 2013 Link to this post

    I upgraded to the latest version of the Telerik controls and now it is working as expected. The older version of Telerik that I was using must have had a defect that has since been fixed. This issue is now resolved. Thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017