Archive for Settembre 14th, 2007

Disable Button OnClick

Settembre 14th, 2007

Description: Disables a asp.net button on postback

Link: http://www.codekeep.net/snippets/a01521f4-0f6e-475d-a8c5-85aaf0ed8779.aspx

btnBack.Attributes.Add("onclick", GetPostBackEventReference(btnBack) & ";this.value='Please wait...';this.disabled = true;")

XmlDeserialization

Settembre 14th, 2007

Description: Deserializer of an xml file into a class

Link: http://www.codekeep.net/snippets/a783355a-14a7-46ed-9c0f-6d06a23d32cc.aspx

XmlSerializer s = new XmlSerializer( typeof( ShoppingList ) );

// Deserialization
        ShoppingList newList;
        TextReader r = new StreamReader("list.xml");
        newList = (ShoppingList)s.Deserialize(r);
        r.Close();

Odczytanie z ADODB.Recordset

Settembre 14th, 2007

Description: Odczytanie z ADODB.Recordset

Link: http://www.codekeep.net/snippets/c881a01f-3f6f-400d-87f2-ebe92e5118c7.aspx

System.Collections.IEnumerator pola = Attr.Fields.GetEnumerator();
			int ilosc = Attr.Fields.Count;
			string Komunikat = "";
			for (int i = 0; i < 10; i++)
			{
				pola.MoveNext();
				Komunikat += ":" + ((ADODB.Field)pola.Current).Value.ToString();
			}