>non so farlo
ti allego un esempio da cui partire, utilizzo jQuery..
pagina default.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public static string FromatMessageUppercase(string messageToUppercase)
{
return messageToUppercase.ToUpper();
}
}
}
come vedi ho fatto un metodo definito con l'attributo [WebMethod] e statico.
Per chiamarlo da javascript con jQuery basta questo breve script sulla pagina aspx:
provalo su una tua webapp e facci sapere se è tutto chiaro.
Non è nulla di che, stiamo semplicemente usando jQuery che è un framework js crossbrowser ed il suo metodo $.ajax: http://api.jquery.com/jQuery.ajax/
--
Alessandro Alpi | SQL Server MVP
MCP|MCITP|MCTS|MCT
http://www.alessandroalpi.net
http://blogs.dotnethell.it/suxstellino
http://mvp.support.microsoft.com/profile/Alessandro.Alpi