Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Toolbar > Do server-side operation on Toolbar button click.?
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Do server-side operation on Toolbar button click.?

Feed from this thread
  • Posted on Jul 9, 2008 (permalink)

    Hi all
    I have used RadToolbar in my Website in all pages (as an UserControl) ,when user clicks on specific button on this toolbar , i will direct him to new page, BUT I want to do some conditional server side processing (before redirecting him) and based on the result , allow user to go further (another page) or show him a client side RadAlert or RadWindow Indicating the error message.

    Could anyone help me to do his?

    Thanks in advance.
    Kind Regards.


  • Posted on Mar 9, 2009 (permalink)

    Hi ZarrinPour,

    Try the code below for conditional checking from server side before redirecting to another page.

    aspx:
    <telerik:RadToolBar ID="RadToolBar1" Width="1000px" runat="server" OnButtonClick="RadToolBar1_ButtonClick"> 
            <Items>  
                   <telerik:RadToolBarButton Text="page1" CommandName="page1" ></telerik:RadToolBarButton>  
                  <telerik:RadToolBarButton Text="page2" CommandName="page2" ></telerik:RadToolBarButton>  
            </Items> 
    </telerik:RadToolBar> 

    Put a label on your page with the corresponding ID (InjectScript in this example).

    This way when you execute InjectScript.Text = "<script type='text/javascript'>alert('your message here')</" + "script>" from your codebehind,

     

    cs:
     protected void RadToolBar1_ButtonClick(object sender, RadToolBarEventArgs e) 
        { 
             //write the conditional check here 
                   if(e.Item.Text  =='Page1' && ............................)
                    {
                      InjectScript.Text = "<script type='text/javascript'>alert('your message here')</" + "script>"
                     }
        } 

    Hope this helps.

    -shinu.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Toolbar > Do server-side operation on Toolbar button click.?