how to read querystring values and controls in httphandler page

Jun 21, 2010 at 7:56 AM

Hi Micheal,

i am using the upload control inside a aspx page which have some querystring values which represent the folderid and userid example:- (upload.aspx?folderid=xxxx-xxxxx&userid=xxxxx)

and also some checkbox option that user might select before the upload.

When user click on the upload, the htpuploadhandler gets fired.

How can i read these querystring values and checkbox checked status inside the upload handler page (.ashx file)?

Thanks in advance.

Jun 28, 2010 at 10:33 AM
Edited Jun 30, 2010 at 3:25 AM

Hi Micheal,

any way to  read controls in httphandler page? i got stuck here. i manage to figure out how to get the querystring value but not sure how to get reference to the controls.


Jul 2, 2010 at 12:07 PM
kriskakani - So how do you read query string values?
Jul 4, 2010 at 2:02 PM

You should set the QueryString parameters you want to use in the HttpHander using CustomParam in the InitParams.

See for more details about the CustomParam

Jul 7, 2010 at 6:12 AM
Edited Jul 7, 2010 at 6:12 AM

hi voyteks : sorry for late reply,

when you set UploadHandlerName, place a varaibles. example:- the below case it is "qs". 

aspx file code 

<object id="MultiFileUploader" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="450" height="280">
            <param name="source" value="/SilverLightControls/mpost.SilverlightMultiFileUpload.xap" />
            <param name="onerror" value="onSilverlightError" />
             <param name="initParams" value="MaxFileSizeKB=<%=MaxFileSizeInKB%>,MaxUploads=2,FileFilter=,ChunkSize=4194304,CustomParams=yourparameters,DefaultColor=White,UploadHandlerName=UploadHandler.ashx<%=qs%>" />
            <param name="background" value="white" />


 aspx,cs file code

in the code behind fill the variables.

protected string qs = "" ;

qs = "?workbinid=" + WorkbinID.ToString() + "&folderid=" + nodeSelectedIndex; // fill the querystring values here.


Jul 7, 2010 at 7:13 AM

That might work.

Or use the "CustomParams=yourparameters" in the initParams. It's designed to hold custom params.

Jul 12, 2010 at 3:35 AM
Edited Jul 12, 2010 at 3:36 AM

when calling the control in a aspx file.

1. how can i set these CustomParams can i read them in the handler page? any sample code?

Also if i have a checkbox in the main aspx page, how can i get the checked/unchecked status in the handler page?

Feb 14, 2012 at 8:20 PM

I am looking for a similar answer.  I want a user to be able to set the metadata fields for all the files being uploaded similar to what is showcased here:

Thanks so much.



Feb 15, 2012 at 7:16 AM

You will have to create something custom for that. The best workflow for this scenario is:

1) Let user upload files
2) Finish and go to the next page
3) Let the user input metadata for the uploaded files

You can create a custom page for step 3 and let the user fill in all the metadata you need.