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

Rad Upload disappears after uploading images

1 Answer 87 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Amit Kothari
Top achievements
Rank 1
Amit Kothari asked on 23 Dec 2009, 09:26 AM
I have one single page, in that all the application in terms of user control will get loaded dynamically. [By calling the LoadControl method]
On one controls I have some rad tab and their page view which also get loaded dynamically to the user control.
After clicking on one tab the images section comes up, where one can see the listing [ in  RadListView]
and can upload the images as well.
This is what I have done :
<telerik:RadUpload Localization-Select="Browse" ID="RadUpload" runat="server" ControlObjectsVisibility="AddButton"
                        MaxFileInputsCount="5" />
I am saving the images to database, but before that I had to disable the ajax, to post the file. For that I had to use this Line of code : StringBuilder js = new StringBuilder();
            js = js.Append("function conditionalPostback(sender, args){");
            js.Append("if (args.get_eventTarget() == '" + buttonSubmit.UniqueID + "') {alert('hi');");
            js.Append("args.set_enableAjax(false);}}");
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "UploadScript", js.ToString(), true);
       
I have tried the same js in the aspx page with the RadCodeBlock but its not working. Anyways the main problem is after uploading images first time the file input text area and the browse button got disappears, but the add and upload button remains there.
I have tried it very hard but of no luck...
Please help

Also i thought of another way to reload the whole control again after the post back that way the upload control should treat like it has come first time, but at that time after the postback, if I want to upload more images the RadUpload.UploadedFiles returns the count 0 [Seems like my js has not effected this time]

Please help

One more thing, I have missed above is this string "RadUrid=b086b64a-9a52-4bc3-8a63-5e7565d731ea " gets appended to my url, after the upload image action very first time. Im not sure what is this. And I want to get rid of this as well.[One minor item]. Please help, its urgent. [Client wants to look at this at the earliest ]

Thanks

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 23 Dec 2009, 08:29 PM
I think disabling Ajax is what might be causing the text field and browse button to disappear. I haven't uploaded directly into a database, but I believe that you should still be able to save it to the DB without disabling Ajax.

As for your RadUrid item, I believe this forum post by a Telerik team member should explain the details of this. Basically it is essential for RadUpload to function properly, and disabling this string in the URL might be a bit tricky.
Tags
Upload (Obsolete)
Asked by
Amit Kothari
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or