An article with the merge of the jQuery lib with ASP.NET.
Asp.net and Testing Page
August 27, 2008
asp.net, testing Leave a comment
Usually you have to test a lot of thinks in the production area. In the development area or staging area you can use some tricks like debugging or something similar. But the production is the evil environment, when all the things that worked, now don’t work anymore. I have developed a little pattern to create a test page visible on to the producion area:
delegate bool ExecuteTestHandler();
protected string TestString;protected void Page_Load(object sender, EventArgs e)
{
string description = “test log writing – 01″;
ExecuteTest(description, TestLog);
}void ExecuteTest(string desc, ExecuteTestHandler method)
{
TestString += desc + “<br />”;
bool result = method();
TestString += (result ? “<font color=’green’>OK</font>” : “<font color=’red’>FAILED</font>”) + “<br />”;
}#region . testing methods
bool TestLog()
{
return true;
}#endregion
In this way you can insert and create your methods to test some critical features like db, log, mail sending, etc..
ASP.NET + Ajax Extension
August 26, 2008
Come aggiorno un UpdatePanel da un altro UpdatePanel di una pagina ?
Es. di struttura
Page001
. UpdatePanel001 > button001
. UpdatePanel002 > button002
se volessi aggiornare il button001 schiacciando il button002 allora basta che sull’evento:
button001_Click() { button002.Text = “nuovo testo”;}
in automatico UpdatePanel002 viene aggiornato.
Voglio far girare il mio sito su un webserver dove non sono installate le AjaxExtension.
Basta copiare i file:
System.Web.Extensions.dll
System.Web.Extensions.Design.dll [FAC]
(localizzate in C:\Programmi\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025)
nella \bin della WebApplication
Eventualmente riavviare IIS.
Ricordarsi inoltre che il web.config viene modificato con httpModule e httpHandler per gestire le chiamate ajax like.
http://www.thescripts.com/forum/thread586766.html
Come controllo i vari UpdatePanel singolarmente?
È meglio settare
UpdatePanel.UpdateMode = Conditional
così – ad ogni PostBack – non viene fatto il refresh di tutti gli UpdatePanel
Non trovo la System.Web.Script nei riferimenti.
Mi serve per la creazione della parte javascript dei miei web service, dove la trovo ?
Basta che – utilizzando VS 2005 – inserisci la System.Web.Extensions.dll all’interno della directory bin del progetto. VS vedrà subito la dll e ti potrà autocompletare il codice durante la digitazione.