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

Notification

Icon
Error

Options
Go to last post Go to first unread
DSCarl  
#1 Posted : Thursday, July 06, 2006 5:27:22 AM(UTC)
DSCarl

Rank: Member

Groups: Member
Joined: 4/25/2006(UTC)
Posts: 61

Anyone,

I am trying to achieve the following

1) I have a Default.aspx page with ImageUploader 3.5 Control and a ListBox.
2) I prevent a user from uploading files when the upload list is empty and no item in the listbox has been selected.
3)I use javascript to capture the value of the item selected in the listbox and pass it to the Upload.aspx page. I am using a "Hidden Input Field".
5) On the Upload.aspx page, I want to use "Request.Form("Name of Hidden field") to get the item selected from the listbox on Default.aspx page.

This seems easy but for some reason, on the Upload.aspx page, when I call Request.Form("Name of Hidden Field"), I get a "nothing" value. The only issue holding me back is Passing the selected item in the listbox from Default.aspx page to Upload.aspx page.

Note: I have been able to achieve this using Request.Querystring but I want to use Request.Form.

Please, Fedor or someone help.

Thanks in advance.
Fedor  
#2 Posted : Friday, July 07, 2006 9:38:27 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,545

Thanks: 5 times
Was thanked: 58 time(s) in 57 post(s)
Please post the code you use.
Best regards,
Fedor Skvortsov
DSCarl  
#3 Posted : Sunday, July 09, 2006 9:26:09 PM(UTC)
DSCarl

Rank: Member

Groups: Member
Joined: 4/25/2006(UTC)
Posts: 61

Hello Fedor,

Attached, is the code for the Default.aspx page.
In the Upload.aspx page, I try to get the value from the hidden text box (found in Default.aspx page) from the Page_Load Event of the Upload.aspx Page.

Please, let me know if something is not clear to you.

Thanks.


File Attachment(s):
PageToPageVar.txt (13kb) downloaded 187 time(s).
Fedor  
#4 Posted : Tuesday, July 11, 2006 12:27:44 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,545

Thanks: 5 times
Was thanked: 58 time(s) in 57 post(s)
First of all please read Uploading Additional Data with Files topic.

As mentioned there you can either attach additional form via AdditionalFormName property or add post field with AddField method.

When you use server ASP.NET forms you can receive the exception as described in the following post:

View post

So way in your case I recommend you to use AddField method. Just call it before data upload (line 84):

Code:
getImageUploader("ImageUploader").AddField("MyListBox", document.getElementById("MyListBox").value);
getImageUploader("ImageUploader").Send();


I have checked the value of Request.Form("MyListBox") in Upload.aspx to be sure that the data was passed perfectly.

Edited by user Wednesday, October 29, 2008 12:45:55 PM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
DSCarl  
#5 Posted : Thursday, July 13, 2006 2:13:35 AM(UTC)
DSCarl

Rank: Member

Groups: Member
Joined: 4/25/2006(UTC)
Posts: 61

Hello Fedor,

Thanks. It worked. I do not know why I never thought of doing it this way.
:)

Regards,
DSCarl.
Users browsing this topic
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.