Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Tarak  
#1 Posted : Sunday, July 4, 2010 4:55:39 AM(UTC)
Tarak

Rank: Member

Groups: Member
Joined: 6/13/2010(UTC)
Posts: 14

Hello,

On an ASP.NET page, I've tried to use AdditionalFormName to upload text from some text boxes (input type="text") along with the images that I select. I use an ImageUploader as a serve control and AdditionalFormName is one of it's atributes. The value of AdditionalFormName is called aspnetForm which is the name ASP.NET gives to the default form of a page, so basically I use the one and only form that exists in any ASP.NET page. However, when I go ahead and upload images, the image uploader is stuck with a "waiting for retry" message. I don't know what I might be doing wrong.

Tarak
Dmitry.Obukhov  
#2 Posted : Sunday, July 4, 2010 8:55:09 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Tarak,

Thank you for your issue.

I tried to reproduce your problem. I added the form and specify it via AdditionalFormName property in my sample and tried to upload images. This sample worked without errors.
I expect that your problem is caused by another reason then by AdditionalFormName property. Please remove this property and try to upload files without it again.

If the problem disappears, please let me know.

Edited by user Monday, July 12, 2010 12:06:48 PM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Tarak  
#3 Posted : Monday, July 5, 2010 1:26:55 AM(UTC)
Tarak

Rank: Member

Groups: Member
Joined: 6/13/2010(UTC)
Posts: 14

Hello Dmitry,

Thanks for your reply. I removed the property and the files were uploaded fine. When the property is in, however, the uploader acts as if it's uploading files with a "Waiting for retry..." message in between attempts to upload the same one file and it goes in a loop.

Some more background, if it may help: The form is in a Master page and the Uploader is in a content page.

Regards,
Tarak
Dmitry.Obukhov  
#4 Posted : Monday, July 5, 2010 6:57:01 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Tarak,

According to the AdditionalFormName Property section of Image Uploader documentation the additional form must be placed into the same frame as the Image Uploader.
As I can suppose the logic of your application does not allow using form and Image Uploader in the same hierarchy level. Thus there is another way of sending additional data. This way is based on using a method named AddField(), which enables you to append extra fields to the POST request submitted to the server.

Please, try this alternative solution and let me know whether it fixes the problem.

Edited by user Monday, July 12, 2010 12:07:17 PM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Tarak  
#5 Posted : Monday, July 5, 2010 11:43:43 PM(UTC)
Tarak

Rank: Member

Groups: Member
Joined: 6/13/2010(UTC)
Posts: 14

I tried AddField() in the OnClientBeforeUpload handler.

getImageUploader("<%=ImageUploader1.ClientID%>").AddField("GivenField", document.getElementById('TextBox1').value);

where TextBox1 is the ID of the input tag whose value I want to upload. It still gets stuck in a retry loop. As soon as I remove that line it works fine.

Here's the textbox tag

<input id="TextBox1" type="text" name="txtName" />

I then went on to replace the document.getElementById('TextBox1').value part of the AddField method with a hard-coded static value and it did work then, so it's only when it's trying to access form elements that this happens. Obviously, TextBox1 is part of the large ASP.NET form that surrounds the whole page, so that may be part of it.

Tarak
Tarak  
#6 Posted : Tuesday, July 6, 2010 12:48:06 AM(UTC)
Tarak

Rank: Member

Groups: Member
Joined: 6/13/2010(UTC)
Posts: 14

Dmitry,

Thanks for your help. I've found a workaround. It works by removing TextBox1's value property from the tag. Now AddField() works but the <input> tag must not have its "value" property defined and if it does, the user must have filled in the textbox with their own text before the upload.

in fact, the textbox tag looked like this: <input id="TextBox1" type="text" name="txtName" value="Default Text" />

Perhaps we can populate the default fields by javascript upon page load?

Regards,
Tarak

Edited by user Tuesday, July 6, 2010 12:48:54 AM(UTC)  | Reason: Not specified

andreym  
#7 Posted : Tuesday, July 6, 2010 7:16:52 PM(UTC)
andreym

Rank: Advanced Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hi Tarak!

I've made very simple demo with AdditionalFormName. I put some textboxes in master page and some in content page. Some with default values and others are not. And Image Uploader asp.net control placed on content page.
Can you please check the demo attached to this post and reply if it works for you?

Also you can post your code and we will try to reproduce your problem.

Also try to set AutoRecoverMaxTriesCount property to 1 and set ShowDebugWindow to true. So you can see if any server-side errors occurs.
File Attachment(s):
AdditionalFormDemo.zip (2,349kb) downloaded 8 time(s).
Tarak  
#8 Posted : Thursday, July 15, 2010 8:41:56 PM(UTC)
Tarak

Rank: Member

Groups: Member
Joined: 6/13/2010(UTC)
Posts: 14

Thanks Andrey. The demo works fine. in fact, my app works fine if I use a default value without <> in it.

I enabled ShowDebugWindow and when I pushed Upload I received an exception "A potentially dangerous Request.Form value was detected from the client (TextBox1="<Default"...)"

So as it turns out, it's a .NET security alert beneath all the layers. Regardless, thanks both for your help.

Tarak
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.