ASP.NET Cafe
new tricks every week

DANGER: Copy and paste file inside VS ASP.NET Web Site Problems

Wednesday, 27 February 2008 14:48 by dmitriy

Sometimes we want to take one pair of aspx/aspx.cs files and copy into another.
If you really want to get new page (and the same for User Controls) remember to do the following after you copied page:

  • Check the CodeFile and Inherits attributes of you Page/User Control
  • Rename class inside aspx.cs or ascx.cs
  • Change CodeFile and Inherits to the correct classes

All of this applies to VS 2005. Than does not automatically rename classes if you Copy/Paste files in solution explorer. And sometimes you can feel confused because of this.

IMHO, better not to copy files in solution explorer at all. And if you need to do this, maybe you have conceptual problems?  

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   ASP.NET | ASP.NET
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Visual SVN - ASP.NET Cafe Choice Version Control Client

Monday, 25 February 2008 14:19 by dmitriy

Again and again I see that sometimes better to buy really good thing than use free bad thing.
Yet, I'm using a trial, but I see the advantages - VisualSVN really rocks. It's so simple, so quick. Even with my LARGE project it works much quicker than other SVN clients. Much better.

Anyway, you need to try it http://www.visualsvn.com/ specially if you running SVN server.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Main
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Do you SVN ?

Monday, 25 February 2008 13:07 by dmitriy

While looking for good and cheap/free version control for your project, you can find something like: CVS, SVN and other stuff like Perforce.
At the start of my big programmers life we used Preforce (http://perforce.com/). This is quite good server with nice windows client. And everything goes ok with perforce. Frankly, I like it. A lot of control in terms of checkout/checkin, good diff. And everything looks professional. Maybe because this is commercial stuff ?

 But later I've started to count projects budget. Yes, maybe bad times or ... Anyway I've start looking for something free. A lot of GPL stuff over here, and sometimes it really helps. So, what I need? I need a version control systems that can work with quite large project without 10 minutes delay if you hit refresh. Something quick! And I've found SVN. First of all we need a server. Usually, I (as a windows developer) have a tons of Unix/Linux servers all over the world. I need a server that runs well on window. And I've found it - http://www.visualsvn.com/server/  (look, server is free)

Ok, server is found. What next? Client? AnkhSVN (http://ankhsvn.open.collab.net/) Looks good and embeds in VS 2005 well. Although, I can say the one thing - not very good. Maybe I've too big project? Yes, it's very-very big. And this is bad. I can't say that version system not to take my image files ( I can say it, but I need to check files one by one ). I don't like this, but you should try. It's completely FREE! As well as server mentioned before.

And now I started to try old good thing for SVN! TortoiseSVN client. http://tortoisesvn.tigris.org/
This thing embeds into windows Explorer. This is good advantage - no matter what are you using for development (VS, Web Developer or Notepad).

It's works better. But i'm going to try VisualSVN. And I'll write about this later. 

And remember, version control is required thing for every project, even if you are individual.
Every thing just for information.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Main
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Blog Engine .NET Thumbnailer - quick look & fix

Sunday, 24 February 2008 09:31 by dmitriy

For another Blog that filled with images, I've setup Thumbnailer Extension (original at http://blog.data-worx.de/page/Extension-Thumbnailer.aspx ).
But it's appears that JPG receive terrible quality when creates resized images, so I updated this extension a bit.

With a lot of respect to developers of this extension - I want to notice that this is just my little contribution. I currently don't have enough time to contact this extension developers, and write a good fix. In case someone needs this fix, I'm attaching patched cs file.

Thumbnailer.cs (24.72 kb)

Currently you should search for string: "int JPEGQuality = 100;" and change quality value as you like. I think later we need to change this to the parameter in [Thumb].

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   BlogEngine.NET
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

CSV to DataTable Parser

Tuesday, 5 February 2008 22:30 by dmitriy

Recently I need to parse CSV (comma separated values) text data into datatable. Standard format where first line is column names, values are separated by commas and possible quoted.

I've used powerful regex in .net to parse that data:

"(\"([^\"]*|\"{2})*\"(,|$))|\"[^\"]*\"(,|$)|[^,]+(,|$)|(,)"

As usually it's really unreadable. :)

And as result I've a class to parse CSV to datatable. Not much comments, just want to post the class, because was really sad after search in Google... there are no ready solution for this common problem (if you know some - let me know in comments).

CSVParser.cs (2.41 kb)

Easy to use - just create object and pass your stream with CSV data as parameter. And call ParseToDataTable().

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   C#
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed