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

Validation with RadAlert AjaxMgr

1 Answer 53 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 20 Feb 2009, 07:07 PM
Currently when the user clicks on [Go], it does a postback, which validates the form but might return an alert about missing required fields.

If validation error, then the selected files are lost in FileUpload after the postback (due to HTTP limitation, OK).

What is another approach to this, so that I can validate via AJAX and display to the user, and if validation is successful, automatically do a postback (with the files from FileUpload)?

I experiemented with AJAX the button, and got another function from another post for RadAlert.
How do I do the 2nd part where if validation is successful, automatically do a postback (with the files from FileUpload)?

Public Sub ShowRadAlert(ByVal p_msg As String, ByVal p_title As String, ByVal p_controlClientId As String)

              <telerik:AjaxSetting AjaxControlID="btnGo">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnGo">
                        </telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 23 Feb 2009, 04:06 PM
Hello Lenny_shp,

As far as I understand your question,you want to do server validation and if everything is okay to auto submit all the input-file fields. Unfortunately this is not possible. What you could do is to do client side validation as described here. You can use client side RadAlert (assuming you have RadWindowManager in your aspx file) with the following source:
 radalert('An <br /><b>html</b> string.<br />', 200, 100,'My Alert'); 

Params are:
  1. Your text
  2. Width
  3. Height
  4. Title

In concern to the auto-submit: If you have only one input box you can auto submit it in the "onFileSelected" event using this code: document."the name of the form".submit();
Unfortunately, if you have more than one inputs, you will need a regular postback button to submit the form.

I hope that information helps, if not could you please send us a sample running project describing your scenario in order to assist you better.
All the best,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Share this question
or