Last post Apr 24, 2010 08:45 AM by anas
Apr 22, 2010 05:37 AM|PuravThakkar|LINK
I have user mobile image control in object list and bind image to that image control, now i want to resize my image means i want to give height and width to that image control how can i do that
I have write below code:
<mobile:Form ID="frmCarList" Runat="server">
<mobile:Label ID="lblMessage" Runat="server" Text="Welcome to List Page">
<mobile:ObjectList ID="rCL" Runat="server" OnPreRender="rCL_PreRender" AutoGenerateFields="False">
<mobile:Image ID="imgCar" Runat="server" BreakAfter="False">
protected void rCL_PreRender(object sender, EventArgs e)
foreach (ObjectListItem item in rCL.Items)
System.Web.UI.MobileControls.Image imgCar = item.FindControl("imgCar") as System.Web.UI.MobileControls.Image;
DataRowView drv = item.DataItem as DataRowView;
imgCar.ImageUrl = GetCarImage(drv["CarImage"] != null ? drv["CarImage"].ToString() : string.Empty);
please help me....
Apr 24, 2010 08:45 AM|anas|LINK
Setting the height and width for the image control will not resize the image , it will just stretch it.So it's size will stay large.
I think you will need to modify the "GetCarImage" code and write some little code that will resize the image.
Please take a look at
this article for more information on how you can resize the image.