This is a migrated thread and some comments may be shown as answers.

Passing custom param to RadUploadHandler

2 Answers 109 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 10 Dec 2009, 04:14 AM

From my aspx code behind page I would like to pass a param, in my case threadID, to the UploadHandler.

Something like this

RadUpload.CustomParam(threadID);

How can I accomplish this, could I also pass multiple params?

2 Answers, 1 is accepted

Sort by
0
Patrick
Top achievements
Rank 1
answered on 11 Dec 2009, 07:25 PM
 public MainPage()  
        {  
            InitializeComponent();  
            Loaded += new RoutedEventHandler(Page_Loaded);  
        }  
 
        public void Page_Loaded(object sender, RoutedEventArgs e)  
        {  
            if (!String.IsNullOrEmpty(Request.QueryString["threadID"]) && !String.IsNullOrEmpty(Request.QueryString["threadTypeID"]))  
            {  
                string threadID = Request.QueryString["threadID"];  
                string threadTypeID = Request.QueryString["threadTypeID"];  
 
                RadUploadSilverlightControl.AdditionalPostFields.Add("threadID", threadID);  
                RadUploadSilverlightControl.AdditionalPostFields.Add("threadTypeID", threadTypeID);  
            }  
        } 

I am still struggling to understand exactly what I am supposed to do.
I need the threadID and threadTypeID in my UploadHandler. I put this code into the  MainPaige.xaml code behind (.xaml.cs) file
but I am not sure if I am going about it the right way. If this is the way to do it then I guess I just have to add
the System.Web.dll to my References in the Silverlight app so that it would find Request.Querystring.
The way it is right now I am getting red lines under Request.Querystring. Could somebody
confirm that what I am doing is correct or wrong, please!
0
Kiril Stanoev
Telerik team
answered on 15 Dec 2009, 12:56 PM
Hi Patrick,

Sending parameters from the Html page to the Silverlight object is discussed in the Passing Parameters Into Silverlight Applications. There is a pretty good explanation plus a link to the video.

In order to get familiar with custom parameters please preview the Passing custom params to the server side handler article.


Sincerely yours,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Upload
Asked by
Patrick
Top achievements
Rank 1
Answers by
Patrick
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or