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

Grid with Image buttons, and RadUpload OnClientSubmitting

1 Answer 84 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Julie
Top achievements
Rank 1
Julie asked on 04 May 2009, 08:05 PM
Hi Telerik Support Team,
I am working with the radupload control separate from a rad grid control on the same web page.  On the grid I have delete and a edit image buttons. 

For the RadProgress Manager I have OnClientSubmitting="OnClientSubmitHandler"
In the OnClientSubmitHandler I check the values of the custom fields,  before allowing the file to be saved to the database and the file server.  
I understand that the upload functionality requires a postback to complete the process.  It seems the OnClientSubmitHandler, is called for any submit.   I need my grid delete and edit buttons to postback to the server without conflicting with the RadProgress Manager and not call the OnClientSubmitHandler function.  Any help would be appreciated.

I did look at your on line example I am still not able to get past this...

 Thank you in advance for help
~Julie

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 05 May 2009, 01:08 PM
Hi Julie,

In order to achieve this functionality you need to put your RadControls inside a RadAjaxPanel or ajaxify them using RadAjaxManager. Done that, you can check who is the initiator of the postback, if it the upload button, proceed with the validation and cancel AJAX. If it's not, do regular ajax postback. To validate the upload, consider using the OnClient-RequstStarted event of the RadAjaxPanel instead of OnClientSubmitting event. Example:

function conditionalPostback(sender, args) 
                { 
                    if (args.get_eventTarget() == '<%= btnUpload.UniqueID %>'
                    {
                        var Upload = $find('RadUpload1.ClientID')
                        // proceed with the validation 
                    } 
                } 

Another approach might be to put the upload inside an iFrame.

Sincerely yours,
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
Julie
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or