In order to convert a class into a string you need to override the ToString() method.
public class AuthUser
{
public int UserID { get; set; }
public string UserNo { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public override string ToString()
{
return UserID + "," + UserNo + "," + UserName + "," + Password;
}
}
Below code will give you a comma separated string output.
AuthUser au = new AuthUser { UserID=1, UserNo="001", UserName="adi", Password="123"};
Response.Write(au.ToString());
Output:
1,001,adi,123