Additional Parameters for File Processor

Jun 23, 2009 at 9:27 PM

I need to pass a handful of additional parameters to the file processor. I initially started modifying your code in various places, but was unable to implement an additional parameter successfully so I opted to use your ContextParam in the meantime. What would you recommend for doing something like this and can you offer any direction, guide for implementing additional parameters successfully? Ideally these paramaters could be set on the actual control (statically or dynamically in the code-behind). Thanks.

Jun 24, 2009 at 1:32 AM
Edited Jun 24, 2009 at 6:27 AM

The ContextParam is meant precisely for this purpose.  I have checked in a new version that will allow you to set this value directly on the UploaderControl server control via the UserContext property.  As before, you can also set this value in javascript via the setUserContext method.

If it is cumbersome to bundle them into a string, I would recommend creating an object to wrap them.  Overload the ToString method to spit out a string representation, and create a constructor that can read that string representation and hydrate the object.  You could also use some kind of standard format to do this, such as json or xml -- just make sure not to send too much data, as the silverlight control places the context parameter into the querystring, which has a pretty short length limit.

Let me know if you need any additional information.


Jun 24, 2009 at 1:40 AM

Thanks for the feedback. I went ahead and implemented it just as described using the javascript to set the value to a group of comma separated values and then split those out in the file processor. Thanks for including the new property in the control itself, I usually prefer to keep most logic in the code behind. Great project, thanks!

Jun 19, 2010 at 7:41 AM

i tried to pass parameters as mention but i am getting null value in the processor