In the below code i have a string value it has a path.I want to place the String value inside the static method But i get Object reference not set to an instance of an object.if i write path in that code it works but not string value which has path .pls help me to solve the issue.
var projectname = name.ProjectName;
var batchname = name.BatchName;
var imagename = name.ImageName;
string concatenatedStr = "/"+ projectname + "/" + batchname + "/Input/" + imagename;
[WebMethod]
public static string buttonclickImage(string pageNo)
{
int iPageNo = 0;
if (pageNo != string.Empty && pageNo != "undefined")
iPageNo = Int32.Parse(pageNo);
FileTransfer.FileTransferClient fileTranz = new FileTransfer.FileTransferClient();
FileDto file = fileTranz.GetTifftoJPEG("concatenatedStr", iPageNo, "gmasdll");
var fileData = Convert.ToBase64String(file.Content);//throws error
return fileData;
}