Welcome Guest Search | Active Topics | Members

Passing data from One page to the other Options
DSCarl
Posted: Thursday, July 06, 2006 1:27:22 PM
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.
Fedor
Posted: Friday, July 07, 2006 5:38:27 PM

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
DSCarl
Posted: Monday, July 10, 2006 5:26:09 AM
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).


Fedor
Posted: Tuesday, July 11, 2006 8:27:44 PM

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 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.

Best regards,
Fedor Skvortsov
DSCarl
Posted: Thursday, July 13, 2006 10:13:35 AM
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.
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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.