SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

add values to JS data object Options
kev3232
#1 Posted : Friday, December 23, 2011 11:14:26 AM
Rank: Advanced Member

Groups: Registered

Joined: 10/27/2005
Posts: 35

Is it possible to add items to the "data" object on the client side with Javascript? I know how to do it in codebehind, but sometimes we have selection values in the hosting page and would like to set those when upload is clicked.

Thanks

Axosoft
#2 Posted : Tuesday, December 27, 2011 9:11:56 AM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

Sure. You can use the set_Data("key", "value") method on the SlickUpload/UploadConnector object. Take a look at the CustomFileName example. Will that work for you?

kev3232
#3 Posted : Tuesday, December 27, 2011 10:51:38 AM
Rank: Advanced Member

Groups: Registered

Joined: 10/27/2005
Posts: 35
Yeah, this works:

kw("<%=slickUpload.ClientID %>_connector").set_Data("albumid", su_albumid);

But, I didn't see an example of this in the samples. Is that the correct way to access the UploadConnector object? Thanks for all your help!
Axosoft
#4 Posted : Tuesday, December 27, 2011 11:02:01 AM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

If you're using the SlickUpload control, you don't have to access the UploadConnector directly -- the SlickUpload control wraps the FileSelector, FileList, UploadConnector and UploadProgressDisplay controls in one.

You should be able to do this:

kw("<%=slickUpload.ClientID %>").set_Data("albumid", su_albumid);

Does that work for you?

kev3232
#5 Posted : Tuesday, December 27, 2011 11:27:53 AM
Rank: Advanced Member

Groups: Registered

Joined: 10/27/2005
Posts: 35
Works great. Thanks!
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.