Archive for November, 2007

Setting a default button in .NET

Tuesday, November 13th, 2007

One way is to use a class like this to add an onkeydown client event to a to a textbox.

using System;
using System.Web.UI.WebControls;

namespace System.Web.UI.DefaultButton
{
/// <summary>
/// Methods to set default button
/// </summary>
public class […]

Programming | No comments

Strip out HTML tags using RegEx

Tuesday, November 13th, 2007

This code will strip out all the HTML tags and truncate the text to 4 lines.

public static string TruncateText(string txtIn, int newLength)
{
string txtOut = txtIn;
string pattern = @”<(.|\n)*?>”;

//Strip out HTML tags
if (Regex.IsMatch(txtIn, pattern, RegexOptions.None))
[…]

Programming | No comments

You are currently browsing the Calisto Mind weblog archives for November, 2007.


Recently on Flickr

  • IMG_0514
  • IMG_0506
  • IMG_0505
  • IMG_0503
  • IMG_0497
  • IMG_0495
  • IMG_0494
  • IMG_0493

Switch Theme

Meta