|
|
Rank: Member Groups: Member
Joined: 4/26/2006 Posts: 61 Points: 0
|
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.
|
|
 Rank: Advanced Member Groups: Administration
, Member
Joined: 7/28/2003 Posts: 1,254 Points: -345 Location: WA, US
|
Please post the code you use.
Best regards, Fedor Skvortsov
|
|
Rank: Member Groups: Member
Joined: 4/26/2006 Posts: 61 Points: 0
|
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 184 time(s).
|
|
 Rank: Advanced Member Groups: Administration
, Member
Joined: 7/28/2003 Posts: 1,254 Points: -345 Location: WA, US
|
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 postSo 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.
Best regards, Fedor Skvortsov
|
|
Rank: Member Groups: Member
Joined: 4/26/2006 Posts: 61 Points: 0
|
Hello Fedor,
Thanks. It worked. I do not know why I never thought of doing it this way. :)
Regards, DSCarl.
|
|
|
Guest |