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

Clientside is doing postback when not necessary

2 Answers 74 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Chad Johnson
Top achievements
Rank 1
Chad Johnson asked on 21 Nov 2008, 08:08 PM
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 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 24 Nov 2008, 10:06 AM
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.
0
Chad Johnson
Top achievements
Rank 1
answered on 24 Nov 2008, 01:56 PM
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
Tags
ToolBar
Asked by
Chad Johnson
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Chad Johnson
Top achievements
Rank 1
Share this question
or