I don't think its a problem with how i'm displaying the data, as theres no data to display.
The module i've created (BestSellers) is able to get its info class from the database but the extra parameter i added 'ImgUrl' is always returned null. If i look directly at the database i correctly set the url when i entered it in the edit page. It just can't retrieve it.
I've checked the stored procedures and everything looks fine.
create procedure {databaseOwner}{objectQualifier}YourCompany_GetBestSellers
@ModuleId int,
@ItemId int
as
select ModuleId,
ItemId,
Content,
Url,
CreatedByUser,
CreatedDate
from {objectQualifier}YourCompany_BestSellers with (nolock)
left outer join {objectQualifier}Users on {objectQualifier}YourCompany_BestSellers.CreatedByUser = {objectQualifier}Users.UserId
where ModuleId = @ModuleId
and ItemId = @ItemId
GO
Heres some of the load_page code:
BestSellersController objBestSellerss = new BestSellersController();
BestSellersInfo objBestSellers = objBestSellerss.GetBestSellers(ModuleId, ItemId);
if (objBestSellers.ImgUrl != null)
{
lblStatus.Text = "url: " + objBestSellers.ImgUrl + " contents: " + objBestSellers.Content;
txtUrl.Text = objBestSellers.ImgUrl;
txtContent.Text = objBestSellers.Content;
ctlAudit.CreatedByUser = objBestSellers.CreatedByUser.ToString();
ctlAudit.CreatedDate = objBestSellers.CreatedDate.ToString();
}
In the above code I am trying to retrieve the data to display in the edit page on page_load. txtContent.Text = objBestSellers.Content; works fine.