Setting a foreign key constraint in a DataSet

The following example creates a basic DataSet object with 2 DataTable objects and creates a relation between them.

Read more No Comments »

Understand DataRowVersion and DataRowState

Explains DataRowState and DataRowVersion and how different events effect them.

Read more 2 Comments »

Block intrusive Flash adverts with Flashblock

If, like me, you are sick and tired of visiting a website (yes Yahoo, that means you!) only for it to start blaring an advert out of your speakers with no option to stop then you need Flashblock.

Read more No Comments »

Adding JavaScript event handlers with Microsoft AJAX Library

This article shows how to add an event handler dynamically in JavaScript using the Microsoft AJAX Library.

Read more No Comments »

Create an enum in JavaScript using Microsoft AJAX Library

Here is an example of how to create an enumeration in JavaScript using the Microsoft AJAX Library.

Read more No Comments »

Serialize a .NET class and deserialize to JSON

Here is an example of how to serialize a .NET class and deserialize it into JSON.

Read more No Comments »

Client Callback through ClientScriptManager in ASP.NET

Here is a simple example of a client callback function in ASP.NET.

Read more No Comments »

CatalogZone – Catalog Parts for use in Web Part Zones

Here is a rundown of what a CatalogZone is, how to create CatalogPart controls and add them to a WebPartZone.

Read more No Comments »

Intellisense support for skin files

Adding intellisense support for skin files in Visual Studio 2008 is pretty straight forward. Here is how.

Read more No Comments »

Saving and Loading Control State on Custom Control

For developers of controls saving data in View State is a useful way of persisting data across postbacks. However if a consumer of your control disables View State the data is lost. Control State overcomes this, as it cannot be disabled.

Take the following user control:

public partial class WebUserControl : System.Web.UI.UserControl
{
  int x = 0;

  protected override void OnInit(EventArgs e)
  {
    Page.RegisterRequiresControlState(this);
    base.OnInit(e);
  }

  protected override void OnLoad(EventArgs e)
  {
    TextBox1.Text = x.ToString();
    base.OnLoad(e);
  }

  protected override object SaveViewState()
  {
    return ++x;
  }

  protected override void LoadViewState(object savedState)
  {
    if (savedState == null) return;
    x = (int)savedState;
  

Read more Comments Off on Saving and Loading Control State on Custom Control

© 2017 Garry Passarella. All Rights Reserved. Facebook Twitter Twitter