Hi,
I have written a function to return the value stored in an object class. The function takes 2 parameters.
What I am not able to do is to concatenate the string and convert it in object, so that the value can be returned. here is the code.
public
{
String retVal = "";
if (HttpContext.Current.Session["OrderDetails"] != null)
String strLineId = LineId;
PaBasket BasketOrder = new PaBasket();
BasketOrder = (PaBasket)HttpContext.Current.Session["OrderDetails"];
foreach (PaBasket.BasketDet p1 in BasketOrder)
if (p1.BLineId == strLineId)
retVal = p1+@"."+strPropertyVal;
break;
}
return retVal;
The text I have made red is where I am am not able to construct a valid object as for e.g. p1.Baddress would return the value (address) stored in the object.
I want to make this function a common one, so that I can call it from different pages, instaed of repeating this code on every page.
How can I achieve this?
Thanks in advance,