CipherIS
asked on
C# - Need to pass variable to a class
I have the below code in an ASP.NET page. It works fine. I need to modify it. I wrote a WCF Service and I need to call that service in the class below. I know how to do that.
The issue I'm having is I need to pass an ID to the class to be used by my WCF Service. Any ideas?
//FILES
public class FileList
{
static FileList()
{
getFiles = new List<Files>();
getFiles.Add(new Files() { FileName = "Test.1zip" });
getFiles.Add(new Files() { FileName = "Test2.zip" });
getFiles.Add(new Files() { FileName = "Test3.zip" });
}
public static List<Files> getFiles { get; set; }
}
public class Files
{
public string FileName { get; set; }
}
The issue I'm having is I need to pass an ID to the class to be used by my WCF Service. Any ideas?
//FILES
public class FileList
{
static FileList()
{
getFiles = new List<Files>();
getFiles.Add(new Files() { FileName = "Test.1zip" });
getFiles.Add(new Files() { FileName = "Test2.zip" });
getFiles.Add(new Files() { FileName = "Test3.zip" });
}
public static List<Files> getFiles { get; set; }
}
public class Files
{
public string FileName { get; set; }
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Expose a property or method which takes in a parameter for the information you would like to receive. It's difficult to tell from the code you posted as to the desired result.
i have passed ID in the my example and used it in Service Class
ASKER
I've attached my code in a text file. I put a comment where I need the UserName to be passed.
Please let me know how to resolve this.
Thanks
Pass-UserName-to-AccountList.txt
Please let me know how to resolve this.
Thanks
Pass-UserName-to-AccountList.txt
ASKER
I figured it out. Thaks for your help
ASKER