Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 8th, 2010, 04:22 AM
Authorized User
Join Date: Nov 2009
Posts: 23
Thanks: 7
Thanked 0 Times in 0 Posts
Default Change top position of an asp image control on server side

Is it possible to change the top position of an asp image control on the serverside in the code behind ?

I need to change the position on a postback.

Best regards,
Old September 8th, 2010, 05:32 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

Positioning is done with CSS, so you could assign a CSS class or inline style to the image to reposition it:

myImage.CssClass = "SomeCssClass";

myImage.Attributes["style"] = "top: 40px";

Hope this helps,

Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
ceboc (September 8th, 2010)
Old September 8th, 2010, 06:30 AM
Authorized User
Join Date: Nov 2009
Posts: 23
Thanks: 7
Thanked 0 Times in 0 Posts

Hi Imar

Thank you! It was very helpful.

Best regards,
Old September 30th, 2010, 08:42 AM
Posts: n/a

Thanks for the update of your journey.I really appreciate the efforts you have made for this site.
migliori casino
Received Infraction

Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX AsyncFileUpload control - referencing server side controls after upload gorankovski ASP.NET 3.5 Basics 0 March 26th, 2010 04:32 AM
How do you position the Sidebar at absolute top-right? saidrad BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 11 April 12th, 2009 07:42 AM
Server side on code on control property jayaraj123 ASP.NET 2.0 Professional 1 May 23rd, 2007 08:30 AM
Change stylesheet file on the server side jdang67 ASP.NET 1.0 and 1.1 Professional 0 October 25th, 2005 10:29 AM
Pop-Up window from server side control jbenson001 ASP.NET 1.x and 2.0 Application Design 5 November 11th, 2003 05:00 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.