Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 February 24th, 2010, 06:26 AM
Authorized User
 
Join Date: Apr 2009
Posts: 48
Thanks: 16
Thanked 0 Times in 0 Posts
Default Chapter 11, toolkit code in C#??

Hello there,

I just got chapter 11 on demand from the site, because I need some code to make thumbnails of my images while they are uploaded. In Imar's book beginning ASP.NET 3.5, it refers to this chapter.

Unfortunately my project is in C#, so alreday having the toolkit communicate with the AppConfiguration.cs does not work.

I also need to adapt code from the SelectImages.ascx.vb to fit it into my own code (C#), but then again there would be the problem with the toolkit being in vb...

so I was just wondering if the toolkit is available somewhere in c#?

Thanks, Robin
 
Old February 24th, 2010, 06:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Robin,

I don't think it's available in C# directly. However, it's pretty easy to convert it using an on-line converter such as: http://converter.telerik.com/

Send me an e-mail if you're having problems getting this to work. I can dig out some imaging code from a Toolkit library that was once the basis for the imaging methods in this book.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
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!
 
Old February 24th, 2010, 10:12 AM
Authorized User
 
Join Date: Apr 2009
Posts: 48
Thanks: 16
Thanked 0 Times in 0 Posts
Default

Thanks Imar, I appreciate your help.

The translater seemed to work fine, except for the ViewState("FileName") instead of ["FileName"], and the closing " break; " in the switch - case block.

I translated UploadHandler.vb, Imaging.vb (partially), FileEventArgs.vb and SelectImage.aspx.vb. Now I'll try to make it work in my own code.

best regards, Robin
 
Old February 24th, 2010, 02:33 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, the converter sometimes has difficulties seeing the difference between a method call and an indexer. In VB, ViewState("SomeKey") could be a called to the ViewState method passing the SomeKey value or an indeder on the ViewState collection. So, sometimes you end up with incorrect code.

Fortunately, most of these issues are easy to fix.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
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!
 
Old February 26th, 2010, 10:35 AM
Authorized User
 
Join Date: Apr 2009
Posts: 48
Thanks: 16
Thanked 0 Times in 0 Posts
Default

Hi Imar,

It didn't really go that smooth afterall; in the button with id btnUpload I had to add a refernece to the btnUpload_onClick event handeler, otherwise it doesn't fire.
And the same thing was true for the code in the btnfinish_Click, where also the ImageFinalized event needed to be initialized in the page_load event of its parent.
I found that solution in a previous thread on this forum, search key -- ImageFinalizedEventHandler.

regards, Robin

Last edited by robbaralla; February 26th, 2010 at 11:59 AM.. Reason: solution found
 
Old February 26th, 2010, 11:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, VB uses the Handles keyword in code behind while C# uses ether explicit wiring syntax or uses an onclick on the control in markup.

Can you define " doesn't seem to work"? That's a vague description which makes it difficult to say something about. Does it not fire? Do you get an error? Does it fire but not trigger the event handler? And are you sure you subscribed to the event?

Maybe this helps as well: http://msdn.microsoft.com/en-us/library/wkzf914z.aspx

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error from Chapter 11 Code winkle BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 April 22nd, 2009 02:41 PM
Chapter 11 Code Examples ablinco BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 0 October 9th, 2006 03:56 AM
Where is source code for Chapter 11? benethridge BOOK: Professional Java Development with the Spring Framework 1 September 5th, 2006 08:58 PM
Chapter 11 Code Problems vbswshare BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 3 April 9th, 2006 08:39 PM





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