Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 24th, 2010, 06:26 AM
Authorized User
 
Join Date: Apr 2009
Location: Sardinia - Italy
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
  #2 (permalink)  
Old February 24th, 2010, 06:51 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
  #3 (permalink)  
Old February 24th, 2010, 10:12 AM
Authorized User
 
Join Date: Apr 2009
Location: Sardinia - Italy
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
  #4 (permalink)  
Old February 24th, 2010, 02:33 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
  #5 (permalink)  
Old February 26th, 2010, 10:35 AM
Authorized User
 
Join Date: Apr 2009
Location: Sardinia - Italy
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
  #6 (permalink)  
Old February 26th, 2010, 11:56 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.