Click here to Skip to main content

Articles by AspDotNetDev (Articles: 4, Tip/Tricks: 23)

Articles: 4, Tip/Tricks: 23

RSS Feed

Average article rating: 4.77

ASP.NET

Managing Your JavaScript Library in ASP.NET
Posted: 15 May 2011   Updated: 10 Nov 2011   Views: 98,554   Rating: 4.88/5    Votes: 73   Popularity: 9.11
Licence: The Code Project Open License (CPOL)      Bookmarked: 175   Downloaded: 2,258
Learn how to embed JavaScript into a DLL, manage dependencies, and avoid page bloat.

Azure

Umbrazure: Limitless Websites with Umbraco on Azure
Posted: 28 Apr 2013   Updated: 12 May 2013   Views: 745   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 6
Umbrazure streamlines development and hosting ASP.NET websites atop Umbraco 6 on Azure.

Algorithms & Recipes

SlimList
Posted: 17 Oct 2009   Updated: 17 Oct 2009   Views: 29,538   Rating: 4.32/5    Votes: 24   Popularity: 5.94
Licence: The Code Project Open License (CPOL)      Bookmarked: 25   Downloaded: 130
SlimList is a C# implemention of IList that uses less memory than List.

String handling

StringBuilderPlus Improves Upon StringBuilder
Posted: 15 Aug 2009   Updated: 1 Jun 2011   Views: 48,522   Rating: 4.86/5    Votes: 58   Popularity: 8.55
Licence: The Code Project Open License (CPOL)      Bookmarked: 83   Downloaded: 450
StringBuilderPlus facilitates prefixing and suffixing strings and StringBuilderPluses in an efficient manner.
No blogs have been submitted.

Average tips rating: 4.56

ASP.NET

No More Session Variable Misspellings [Tip/Trick]
Posted: 22 Jun 2011   Updated: 22 Jun 2011   Rating: 4.83/5    Votes: 10   Popularity: 4.82
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
This can be automated and streamlined with generics. First, create a SessionVariable class:public class SessionVariable{ private string VariableName { get; set; } private System.Web.SessionState.HttpSessionState Session { get; set; } public T Value { get ...

Database

JOIN Instead of Repeating a Subquery [Tip/Trick]
Posted: 21 Mar 2010   Updated: 2 Feb 2011   Rating: 4.73/5    Votes: 4   Popularity: 2.85
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
Rather than use multiple subqueries to extract TOP 1 data, this shows you how to use a single TOP 1 JOIN.

C#

Can the C# ‘var’ keyword be misused? [Tip/Trick]
Posted: 19 Nov 2009   Updated: 19 Nov 2009   Rating: 4.50/5    Votes: 3   Popularity: 2.07
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
I agree that in the above example, the use of var is a bit excessive. However, for very long types (such as a dictionary with the key and value both being lists of some nested classes... see below code example), this might actually improve readability (seeing so many details may overwhelm you). Assu

LINQ

See the SQL Generated by LINQ [Tip/Trick]
Posted: 18 Jul 2011   Updated: 18 Jul 2011   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
If you are the type that likes to debug production code, you can use SQL Profiler to find queries generated by your LINQ statements. This is a technique I recently used because it was so simple and did not require me to recompile anything.Note that StefanHam already posted this alternate...

Programming Tips

Changing a WinForms Control on the 'UI' Thread from another Thread [Tip/Trick]
Posted: 23 Mar 2010   Updated: 23 Mar 2010   Rating: 5.00/5    Votes: 8   Popularity: 4.52
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
This version works regardless of parameters:public void AnyMethod(int parameter){ MethodInvoker wrapper = new MethodInvoker(delegate() { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}Note also...
Order Your ASP.Net Embedded Code Blocks Correctly [Tip/Trick]
Posted: 3 Dec 2010   Updated: 4 Dec 2010   Rating: 4.33/5    Votes: 2   Popularity: 1.30
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
If you place your ASP.Net embedded code blocks after the controls they reference, you may not get the output you expected.
Output a Newline From XSLT [Tip/Trick]
Posted: 6 Dec 2010   Updated: 6 Dec 2010   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
There are many ways to insert a newline in the output of an XSLT, but this is probably the easiest.
Multi-Line Lambdas in C# and VB.NET [Tip/Trick]
Posted: 2 Feb 2011   Updated: 2 Feb 2011   Rating: 4.90/5    Votes: 9   Popularity: 4.67
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
Lambdas can be composed of multiple lines of code.
To check string is palindrome or not in .NET (C#) [Tip/Trick]
Posted: 3 Feb 2011   Updated: 6 Feb 2011   Rating: 4.00/5    Votes: 3   Popularity: 1.91
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 4
I prefer this technique (uses less memory and may be faster, but requires slightly more code):public bool IsPalindrome(string str, StringComparison comparisonType){ bool valid = true; int halfway = str.Length / 2; int lastIndex = str.Length - 1; for (int i = 0; i <...
Get TinyMCE Value from Server-Side in ASP.NET 4.0 [Tip/Trick]
Posted: 2 Mar 2011   Updated: 3 Mar 2011   Rating: 4.33/5    Votes: 3   Popularity: 1.91
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
Using TinyMCE is fairly simple, but attempting to access the value entered by the user in ASP.NET 4.0 presents with some problems.
String concatenation in Transact-SQL [Tip/Trick]
Posted: 7 Mar 2011   Updated: 9 Mar 2011   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
I like the original solution, especially when compared to this (which I am posting just to show that there are other solutions):-- Initialize table.CREATE TABLE #BigStrings( StringID bigint IDENTITY(1,1) NOT NULL, StringValue text NOT NULL, CONSTRAINT PK_BigStrings PRIMARY KEY...
Converting a nullable object to an integer [Tip/Trick]
Posted: 18 Mar 2011   Updated: 19 Mar 2011   Rating: 5.00/5    Votes: 4   Popularity: 3.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Here is a slightly shorter version of your first conversion:object someValue = 1;int result = someValue as int? ?? -1;
Call Functions Until One Meets Condition [Tip/Trick]
Posted: 30 Mar 2011   Updated: 2 Apr 2011   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
VB.NET Version (C# Version)Thanks to cechode for inspiring this tip/trick. Suppose you have the following functions:Function Step1() As Boolean Return TrueEnd FunctionFunction Step2(ByVal val1 As Integer, ByVal val2 As Integer) As Boolean Return val1 = val2End...
Call a C# Method From JavaScript Hosted in a WebBrowser [Tip/Trick]
Posted: 23 Nov 2010   Updated: 6 May 2011   Rating: 4.90/5    Votes: 18   Popularity: 6.15
Licence: The Code Project Open License (CPOL)      Bookmarked: 20   Downloaded: 0
This demonstrates how you can call a C# method in a Windows Forms application from JavaScript that is hosted in a webpage inside a WebBrowser control on your form.
Output a Newline From XSLT [Tip/Trick]
Posted: 18 May 2011   Updated: 18 May 2011   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Thanks to this page, I found an even shorter alternative. First, you can add an entity in your DOCTYPE section:"> ]>You can then use this where you like in the document:&newline;That will get rendered...
String.Format in JavaScript [Tip/Trick]
Posted: 25 May 2011   Updated: 27 May 2011   Rating: 5.00/5    Votes: 13   Popularity: 5.57
Licence: The Code Project Open License (CPOL)      Bookmarked: 20   Downloaded: 0
A JavaScript function to replace string placeholders with values
Embedding Javascript in Asp.Net [Tip/Trick]
Posted: 5 Jul 2011   Updated: 5 Jul 2011   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
There is a fourth function.RegisterClientScriptResource(): Adds a reference to a JavaScript file that has been embedded into an assembly (DLL). Read more about that here: Managing Your JavaScript Library in ASP.NET.
Navigate a Silverlight WebBrowser to a URL with a Hash (Fragment Identifier) [Tip/Trick]
Posted: 24 Sep 2011   Updated: 26 Sep 2011   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
The Silverlight WebBrowser won't navigate to some URL's, but this can be worked around.
Call Functions Until One Meets Condition [Tip/Trick]
Posted: 28 Mar 2011   Updated: 1 May 2012   Rating: 5.00/5    Votes: 16   Popularity: 6.02
Licence: The Code Project Open License (CPOL)      Bookmarked: 15   Downloaded: 0
Call a series of functions until the return value meets a condition without a chained-if or short-circuiting.
ASP.NET Conditions in Markup Using Bound Data [Tip/Trick]
Posted: 12 Jan 2012   Updated: 18 Oct 2012   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 6   Downloaded: 0
You can't use an if statement in a bound code block, but you can still use conditions in your markup based on bound data.
ASP.NET Conditions in Markup Using Bound Data [Tip/Trick]
Posted: 12 Jan 2012   Updated: 18 Oct 2012   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
C# version

Uncategorised Quick Answers

Passing Array or Lists to a IN(...) Clause [Tip/Trick]
Posted: 15 Feb 2010   Updated: 15 Feb 2010   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
An article posted yesterday goes into detail explaining the various techniques one can use to pass an array to an "IN" clause: "Techniques for In-Clause And SQL Server"
View Multiple Web Browser Windows in the Visual Studio IDE [Tip/Trick]
Posted: 29 Jan 2010   Updated: 22 May 2010   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
View multiple browser windows in the Visual Studio IDE to consolidate your workflow.

Uncategorised Tips and Tricks

Sending an executable file via Outlook [Tip/Trick]
Posted: 22 Dec 2010   Updated: 22 Dec 2010   Rating: 1.00/5    Votes: 2   Popularity: 0.30
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
I too have come across this problem. My favorite alternative is to use a USB drive. That isn't the same as sending it through Outlook, but it gets the job done (for those who are allowed to bring USB drives to work).

AspDotNetDev
Web Developer
United States United States
Member
  • Managing Your JavaScript Library in ASP.NET (if you work with ASP.net and you don't read that, you are dead to me).
  • Graduated summa cum laude with a BS in Computer Science.
  • Wrote some articles and some tips.
  • DDR ("New high score? What does that mean? Did I break it?"), ping pong, and volleyball enthusiast.
  • Software I have donated to (you should too):


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 18 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid