37 items found in the C# Category

Usage of the @ (at) sign in ASP.NET

Thursday, January 22, 2015 1:54 PM

C# ASP.NET MVC ASP.NET Web Pages Razor

The number of places where you might use or encounter the @ sign in ASP.NET has grown over the last few years and its exact purpose in all circumstances still seems to cause confusion. Here's an overview of the most common places that it crops up, and guidance on its correct usage.

Click to read more about Usage of the @ (at) sign in ASP.NET ...

Viewed 6146 times

4 Comments for this item

Book Review - CLR Via C# Third Edition

Sunday, September 12, 2010 8:14 AM

C# General Book Review

I've had a review copy of Jeffrey Richter's CLR via C#, Third Edition for some months, and it has taken until now to get round to publishing my thoughts on the book. It's not my fault. I blame the book. It made me forget why I was given a copy in the first place. Let me explain...

Click to read more about Book Review - CLR Via C# Third Edition ...

Viewed 8605 times

1 Comment for this item

Finding Yesterday in SQL and C#

Monday, July 12, 2010 9:27 PM

C# SQL

Here's something that comes up often in forums - How To Find Yesterday in SQL or C#. Piece of cake, if you know how, but tricky if you don't. And especially tricky to get the right value if you are not clear on the requirement.

Click to read more about Finding Yesterday in SQL and C# ...

Viewed 15973 times

4 Comments for this item

Converting URLs Into Links With Regex

Saturday, May 22, 2010 10:56 PM

C# Extension Method

Following on from the recent spate of extensions methods I've posted, here's another I use to convert URLs and email addresses into links within HTML. You may want to restrict users from submitting HTML tags via forms in your application, which means that URLs and email addresses that they submit appear as plain text unless they are subjected to some kind of processing.

Click to read more about Converting URLs Into Links With Regex ...

Viewed 11096 times

1 Comment for this item

Highlighting Keywords Found In Search Results

Saturday, May 22, 2010 7:41 PM

C# ASP.NET 3.5 Extension Method ASP.NET Web Forms

A common question in the forums is how to highlight key words found in search results. Here's an extension method that does that, both for partial matches, or whole word matches.

Click to read more about Highlighting Keywords Found In Search Results ...

Viewed 37024 times

6 Comments for this item

Displaying The First n Characters Of Text

Sunday, May 16, 2010 9:59 AM

C# ASP.NET 3.5 Extension Method

Displaying the first n characters of a block of text on a page without chopping words off halfway through is a common requirement. There are a number of ways to achieve this, but here's an extension method that you might find useful.

Click to read more about Displaying The First n Characters Of Text ...

Viewed 27958 times

15 Comments for this item

Using gacutil.exe and Reflection to generate the Exceptions Cheat Sheet

Wednesday, February 10, 2010 7:28 AM

C# Visual Studio General ASP.NET 3.5

The most recent addition to my Cheat Sheets features details of all the Exceptions that can be found in the most commonly used assemblies within ASP.NET development. Compiling this information was an interesting challenge. I could have simply copy-pasted from MSDN, but that would have been extremely tedious. Instead, I ended up with a blend of Linq to XML, Reflection, a dash of Regex and the Global Assembly Cache Tool - gacutil.exe. Here's the full story.

Click to read more about Using gacutil.exe and Reflection to generate the Exceptions Cheat Sheet ...

Viewed 8190 times

3 Comments for this item

Cheat Sheet - .NET Framework Exceptions

Sunday, February 7, 2010 5:19 PM

C# General ASP.NET 3.5

Here's a list of Exceptions that can be found in the assemblies which are most commonly used in ASP.NET development.  Ideally, you should be as specific as possible when catching or throwing Exceptions. The more specific you are, the less work the CLR has to do in locating the appropriate catch block, and the more informative your error messages are, which should help speed up identifying the source of any problems.

Click to read more about Cheat Sheet - .NET Framework Exceptions ...

Viewed 35993 times

6 Comments for this item

Parameterized IN clauses with ADO.NET and LINQ

Monday, September 28, 2009 9:53 PM

C# ADO.NET LINQ ASP.NET 3.5

Since my article on using parameters for Preventing SQL Injection In ASP.NET, I have had a few emails asking how to do the same with an IN clause expression. In this entry, I explore a couple of ways to do this.

Click to read more about Parameterized IN clauses with ADO.NET and LINQ ...

Viewed 38624 times

11 Comments for this item

Upload and Crop Images with jQuery, JCrop and ASP.NET

Monday, January 5, 2009 1:54 PM

C# AJAX Javascript ASP.NET 3.5 jQuery

I got given jQuery In Action for Christmas. By nature, I'm kind of a late adopter, and I'm already regretting this fact. jQuery has been around for some time, and I wished I had looked at it sooner. It's a fantastic library that really simplifies Javascript development, and is already attracting a goodly number of plug-ins. JCrop is one such, and while it hasn't yet reached version 1.0, it is remarkably easy to use as a web based image cropper. Here's how to put jQuery, JCrop and a FileUpload control together to allow users to upload images and crop them.

Click to read more about Upload and Crop Images with jQuery, JCrop and ASP.NET ...

Viewed 249172 times

117 Comments for this item

Delegates, Anonymous Methods and Lambda Expressions in C#

Sunday, December 7, 2008 7:33 PM

C# ASP.NET 3.5

Delegates in C# cause a fair amount of confusion, but with the introduction of LINQ to SQL and the profilic use of the Lambda Expression operator (=>) that it has foisted on an unprepared batch of beginners, an understanding of how these two items are related, together with Anonymous Methods becomes more important. Most definitions of Delegates that you find start off with comparing them to "function pointers in C or C++", which is great if you ever worked with those languages and understood them, but not helpful to new programmers. Here's my attempt at simplifying the various concepts.

Click to read more about Delegates, Anonymous Methods and Lambda Expressions in C# ...

Viewed 66243 times

8 Comments for this item

iTextSharp - Page Layout with Columns

Monday, November 24, 2008 7:41 AM

C# ASP.NET 3.5 iTextSharp

I have now covered many of the basics involved in generating PDF files from ASP.NET using iTextSharp in the series of articles listed below. This article will look at additional ways to provide formatting to documents through the use of columns.

Click to read more about iTextSharp - Page Layout with Columns ...

Viewed 177028 times

18 Comments for this item

iTextSharp - Drawing shapes and Graphics

Monday, November 17, 2008 12:30 PM

C# ASP.NET 3.5 iTextSharp

The previous iTextSharp article looked at bringing images into a PDF file and working with them. Sometimes, however, you may want to draw shapes and lines within the PDF and not rely on images. iTextSharp includes a lot of functionality that covers simple drawing to quite complex shapes. This article gets you started. Previous articles are listed below:

Click to read more about iTextSharp - Drawing shapes and Graphics ...

Viewed 151784 times

9 Comments for this item

iTextSharp - Working with images

Friday, November 7, 2008 11:00 PM

C# ASP.NET 3.5 iTextSharp

The seventh article in my iTextSharp series looks at working with images. This article builds on the previous six which are listed below.

Click to read more about iTextSharp - Working with images ...

Viewed 324365 times

41 Comments for this item

iTextSharp - Introducing Tables

Monday, November 3, 2008 7:34 AM

C# ASP.NET 3.5 iTextSharp

Tables will probably be one of the most used elements in PDFs generated from ASP.NET applications to provide the structure for documents such as orders and invoices. This overview is not an exhaustive examination of tables, but provides an introduction to working with them through iTextSharp, and builds on the previous articles in this iTextSharp series:

Click to read more about iTextSharp - Introducing Tables ...

Viewed 427039 times

63 Comments for this item

Recent Comments

Gjuro 3/5/2015 8:17 PM
In response to MVC 5 with EF 6 in Visual Basic - Implementing Basic CRUD Functionality
in: "Create a Details Page" ++++++++++++++++++ The scaffolded code for the Students Index page...

Steve 3/5/2015 6:09 PM
In response to Usage of the @ (at) sign in ASP.NET
I was surprised I needed to use the @ before the html <fieldset> declaration in the following am...

stephen 3/4/2015 10:36 PM
In response to Conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value
Thank you, Love all your tutorials :)...

Satyabrata Mohapatra 3/4/2015 5:16 AM
In response to ASP.NET MVC DropDownLists - Multiple Selection and Enum Support
Great article....

faysal 3/3/2015 11:46 AM
In response to Inline Editing With The WebGrid
Nice one can you please tell us how we can do ad and delete functionality in this. for e.g if i on...

Fairoze Mohamed Musthafa 3/2/2015 8:33 AM
In response to Date formatting in VBScript
Appreciated !!!!...

mahdi 3/1/2015 10:16 AM
In response to Getting the identity of the most recently added record
Great Article....

Sohrab 2/28/2015 12:53 PM
In response to Displaying One-To-Many Relationships with Nested Repeaters
hi.this was very usefull for me.after spending 6 hours I could find best answer for my alot....

Abolfazl RoshanZamir 2/28/2015 10:36 AM
In response to Date Formatting in C#
very informative... thanks for sharing sir......

Oscar Duran 2/27/2015 2:00 PM
In response to How To Check If A Query Returns Data In ASP.NET Web Pages
Thank you very much Mike, this post has been very useful to me....