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.
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Please post the code you use. |
Best regards, Fedor Skvortsov
|
|
|
|
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.
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 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 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. Edited by user Wednesday, October 29, 2008 12:45:55 PM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
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.
|
|
|
|
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.