Clientside is doing postback when not necessary

3 posts, 0 answers
  1. Chad Johnson
    Chad Johnson avatar
    54 posts
    Member since:
    Sep 2012

    Posted 21 Nov 2008 Link to this post

    Greetings,

    I have a RadToolbar with 6 buttons within itself, with 3 being Clientside and 3 Serverside.  The 3 Serverside work fantastic, and 1 clientside works well enough due that it don't matter if I postback or not.  The other two however open a RadWindow, so I need to stop the postback if possible.  I've set the return value for the click to be false, but I still get a postback.  I'm unsuer what to do with the toolbar anymore, so I thought I'd ask for suggestions.  Here is the code for the three buttons.

    function onClientButtonClick1(sender, args)  
            {  
                var btn = args.get_item();  
                if (btn.get_commandName() == "VR") {  
                    var shell = $("[id~='hfRequestUserID']");  
                    var control = shell.get(0);  
                    doViewResume(control.value);  
                    return false;  
                }  
     
                if (btn.get_commandName() == "V") {  
                    var shell = $("[id~='hfRequestUserID']");  
                    var control = shell.get(0);  
                    var oWnd = window.radopen("ViewReason.aspx?userID=" + control.value + "&mode=view""");  
                    oWnd.center();  
                    return false;  
                }  
     
                if (btn.get_commandName() == "DM") {  
                    var shell = $("[id~='hfRequestUserID']");  
                    var control = shell.get(0);  
                    var oWnd = window.radopen("ViewReason.aspx?userID=" + control.value + "&mode=deny""");  
                    oWnd.center();  
                    return false;  
                }  
            } 

    VR is the button I was commenting that it doesn't matter if it posts back or not since it opens another window also, but it's not a RadWindow, just a normal popup window.  Anyways, I'd much appreciate any help I could receive.  Thank you.

    ~ Chad
  2. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 24 Nov 2008 Link to this post

    Hi Chad,

    Please, set the PostBack property of the VR button to false, e.g.

    <telerik:RadToolBarButton Text="VRButton" CommandName="VR" PostBack="false" />


    Kind regards,
    Erjan Gavalji
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chad Johnson
    Chad Johnson avatar
    54 posts
    Member since:
    Sep 2012

    Posted 24 Nov 2008 Link to this post

    Actually, I discovered the problem.  In the toolbar, when I was saying user Clientside stuff, I had ClientButtonClicked instead of ClientButtonClicking.  That mix up caused the problem.  Sorry to have bothered you all.  Thanks.

    ~ Chad
Back to Top