 |
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
|
|
|
|

February 24th, 2010, 06:26 AM
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 48
Thanks: 16
Thanked 0 Times in 0 Posts
|
|
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
|

February 24th, 2010, 06:51 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

February 24th, 2010, 10:12 AM
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 48
Thanks: 16
Thanked 0 Times in 0 Posts
|
|
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
|

February 24th, 2010, 02:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

February 26th, 2010, 10:35 AM
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 48
Thanks: 16
Thanked 0 Times in 0 Posts
|
|
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
|

February 26th, 2010, 11:56 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
 |