Back Button Working Only One Time

4 posts, 0 answers
  1. Digant
    Digant avatar
    13 posts
    Member since:
    Dec 2013

    Posted 12 Feb 2014 Link to this post

    Hello Friends,

    In File Explorer control Grid i go from main directory to sub directory from there i go another directory of sub directory
    Like Main directory => Sub Directory => another directory of Sub Directory

    When i press back button it go back to Sub Directory
    Now i press back button second time it not go back to main directory it remain on same directory


    ///////////code.cs/////////


            FileExpDocument.ToolBar.Items[0].Visible = true;
            FileExpDocument.ToolBar.Items[1].Visible = false;
            FileExpDocument.ToolBar.Items[2].Visible = false;
            FileExpDocument.ToolBar.Items[9].Visible = false;
            FileExpDocument.ToolBar.Items[6].Visible = false;

           FileExpDocument.ToolBar.OnClientButtonClicked = "OnClientButtonClieck";


    ///////end///////////////

    Here is only Toolbar control related code
    in this "OnClientButtonClieck" just set the height of grid and div

    when i click first time back button the page_init and Page_load all event fire
    But when i click second time no event fire nothing happen


    Please help me it is very urgent 
  2. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 17 Feb 2014 Link to this post

    Hi Digant,

    Most probably the issue is cause by the fact the provided code is executed on every PostBack. Wrapping the code in the following if statement fixed the issue on my side:
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FileExpDocument.ToolBar.Items[0].Visible = true;
            FileExpDocument.ToolBar.Items[1].Visible = false;
            FileExpDocument.ToolBar.Items[2].Visible = false;
            FileExpDocument.ToolBar.Items[9].Visible = false;
            FileExpDocument.ToolBar.Items[6].Visible = false;
            FileExpDocument.ToolBar.OnClientButtonClicked = "OnClientButtonClieck";
        }
    }

    Please, give it a try and let me know how it goes.

    Regards,
    Veselina Raykova
    Telerik
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Digant
    Digant avatar
    13 posts
    Member since:
    Dec 2013

    Posted 18 Feb 2014 in reply to Vessy Link to this post

    Thanks for reply

    I have already applied in
    !PostBack
    same issue occur

    for more detail i have attached one image

    setTimeout function is called  from java scriptResource.axd when i press back button second time



  5. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 21 Feb 2014 Link to this post

    Hi Digant,

    I am not able to reproduce the experienced behavior on my side, so I assume there are any custom configurations on your project that are breaking the control functionality. Attached you can see the video from my test. Can you take a look at it and let me know whether I am leaving anything out?

    In order to be able to provide any further assistance we will need to reproduce and examine the issue locally. Could you, please, prepare a sample fully runnable project reproducing the problem and send it for a further investigation? Detailed information on how to isolate such is available here: Isolating a problem in a sample project

    Regards,
    Veselina Raykova
    Telerik
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top