C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Add an image dynamically


Posted Date: 25 Apr 2008    Resource Type: Code Snippets    Category: Images

Posted By: Phani Kumari       Member Level: Silver
Rating:     Points: 7



You can add an image dynamically with code below. using this ypu can also crate td(table cell) dymaically and add to the tr. for that you have to give the id for tr and set the property for runatserver=true.



int tdcount = 0;
//get the count of table cells in tr
tdcount = tr1.Controls.Count;
//Create a new table cell
HtmlTableCell tdcell = new HtmlTableCell();
//Create a new image control
Image img = new Image();
//set the url for image
img.ImageUrl = "C:\img.jpg";
img.Width = 120; //set the image width
img.Height = 100; //set the image hight
tdcell.ColSpan = 3; //set the colspan for table cell
tdcell.RowSpan = 4; //set the rowspan for table cell
tdcell.Controls.Add(img); // place image in table cell
tr1.Controls.AddAt(tdcount, tdcell); // Add table cell to the table row.






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Creating a ThumbNail Image on Fly
Previous Resource: How to Split multipage image into single page image
Return to Discussion Resource Index
Post New Resource
Category: Images


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

conference calls

Contact Us    Privacy Policy    Terms Of Use