Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 August 8th, 2006, 06:51 PM
Registered User
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default convert web unit (pixels) to integer

I have placed an image control (500px x 250px) on an asp.net page, and I want to pass the width and height to integer (or any numeric) variables.

In sub Page_Load, my attemped conversion code is:

      ImageWidth = ChangeType(Me.pbLineChart.Width, TypeCode.Int32)
      Imageheight = ChangeType(Me.pbLineChart.Height, TypeCode.Int32)

(ImageHeight & ImageWidth public variables declared elsewhere).

This generates a runtime error:
Object must implement IConvertible.

Which I have attempted to do without success, but which seems to be related to other language issues.

Any suggestions correct way to do this?

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] Convert Time to Integer snufse ASP.NET 2.0 Basics 1 October 7th, 2008 11:44 AM
How to count Pixels AccessAasif@aol.com C# 2005 1 November 26th, 2007 05:28 AM
Convert Windows for to Web (Treeview) timeware ASP.NET 2.0 Professional 1 April 12th, 2007 11:07 AM
Convert string from text box to integer ja8261 VB.NET 2002/2003 Basics 5 November 6th, 2004 10:04 PM
convert string to integer kcheung Classic ASP Databases 1 July 28th, 2003 04:39 PM

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