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

Urgent need to know how to access added fields in my code behind.

3 Answers 104 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Stephen Kumor
Top achievements
Rank 1
Stephen Kumor asked on 17 Mar 2010, 04:36 PM
Hello,
In the example located at http://demos.telerik.com/aspnet-ajax/upload/examples/additionalfields/defaultcs.aspx there are additional fields such as title and description.  I would like to know how I can access those fields in my C# code behind.  The example does not show how to do this in the example C# file.

For example...in the online example you access the field "Title" server side within the datalist using ((Telerik.Web.UI.UploadedFile)Container.DataItem).GetFieldValue("Title")

How would I do this in C#????

Thanks.

Stephen

3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 19 Mar 2010, 12:49 PM
Hello Stephen Kumor,

What do you mean by how to do that in C#?  The code that you have pasted uses C#. Did you mean VB? All the online demos have both C# and VB versions. This code:

((Telerik.Web.UI.UploadedFile)Container.DataItem).GetFieldValue("Title")

is in C#

Kind regards,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen Kumor
Top achievements
Rank 1
answered on 19 Mar 2010, 01:33 PM
I meant that the server side code to get the value of the added field is
((Telerik.Web.UI.UploadedFile)Container.DataItem).GetFieldValue("Title") 

I need to access that field in the code behind and not inside the aspx page.  I am looking to access in the aspx.cs page.  Can you give show me how to do this?

Thanks,
Stephen


0
Genady Sergeev
Telerik team
answered on 23 Mar 2010, 03:51 PM
Hello Stephen Kumor,

You can access the title field in the code behind the following way:

foreach (UploadedFile file in RadUpload1.UploadedFiles)
        {
            string additionalField = file.GetFieldValue("Title");
        }


All the best,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Upload (Obsolete)
Asked by
Stephen Kumor
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Stephen Kumor
Top achievements
Rank 1
Share this question
or