Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Calling RadAlert to validate "form submit"
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 Calling RadAlert to validate "form submit"

Feed from this thread
  • Posted on Mar 31, 2011 (permalink)

    Hi Telerik team,

    Please, In need help...

    I have a lot of fields in my form, each field with his requiredfieldvalidator.
    If I call radalert with a simple button, these requiredfieldvalidator don´t validate.

    How can I calling radalert only after all requiredfieldvalidator are valid and OK, then submit form to record in my database?

    Thanks in advance.

    Daniel

  • Posted on Mar 31, 2011 (permalink)

    Hello Daniel,

    I suppose you called the RadAlert from client side, and the validations happens only when a postBack happens. One approach is to call the RadAlert fro code behind.
    aspx:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <asp:Button ID="Button1" Text="Postback and show RadAlert" runat="server"  OnClick="Button1_Click"  />
    C#:
    protected void Button1_Click(object sender, EventArgs e)
       {
           string radalertscript = "<script language='javascript'>function f(){radalert('Welcome to RadWindow for <strong>ASP.NET AJAX</strong>!', 330, 210); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
           Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", radalertscript);
       }

    Also take a look at the following blog.
    Executing JavaScript function from server-side code

    Thanks,
    Princy.

  • Posted on Mar 31, 2011 (permalink)

    Hi Princy,

    My apologises, but, I guess that I don´t correctly explained my intention...

    1. I have many requiredfieldvalidors.
    2. I´d like to push a button and a window appears asking "OK" or "CANCEL" to save the information´s form in my database.
    3. But this only after all fields were validated.

    Now, I see that radalert() is not correct, radconfirm() is the correct.

    Can you help me, please?

    Thanks, best

    Daniel

  • Svetlina Anati Svetlina Anati admin's avatar

    Posted on Apr 5, 2011 (permalink)

    Hi Daniel,

    I prepared for you a sample demo which shows how to achieve what you need - please examine the attachment. Note, however, that to use the server side methods RadConfirm and RadAlert you should upgrade to the latest version of RadControls for ASP.NET AJAX. If you do not want to do so, you can follow the very same logic except for opening the dialog from the server by executing script as explained below:

    http://blogs.telerik.com/blogs/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx 

    Regards,
    Svetlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Attached files

  • Posted on Jun 18, 2011 (permalink)

    Hi Svetlina,

    Wonderful sample. Works very fine!

    Thanks for your help.

    Best

    Daniel

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Calling RadAlert to validate "form submit"