non ne ho la più pallida idea perchè non vada.
So solo che ho preso il tuo codice e va
codice servercodice:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="a.aspx.vb" Inherits="prove_a" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="../js/prototype.js"></script> <script language="javascript" type="text/javascript"> // <!CDATA[ function caricaBox(string, IdBox) { var url_action = string; new Ajax.Request(url_action, { onComplete: showResponse }); function showResponse(originalRequest) { var t = originalRequest.responseText; t = execJS(t); $(IdBox).innerHTML = t; } return false; } function execJS(t) { var p1 = 0, p2 = 0, p3 = 0, p4 = 0; p1 = t.indexOf("<" + "script", 0); if (p1 == -1) return t; p2 = t.indexOf(">", p1 + 7) + 1; p3 = t.indexOf("<" + "/script>", p2); p4 = p3 + 9; var c = t.substring(p2, p3); var s = document.createElement("script"); s.type = "text/javascript"; s.text = c; document.getElementsByTagName("head")[0].appendChild(s); t = t.substring(0, p1) + t.substr(p4); return execJS(t); } // ]]> </script> </head> <body> <form id="form1" runat="server"> <div> <input id="Button1" type="button" value="button" onclick="caricaBox('?ajax_comando=1&nome=pietro','div');" /> vai <div id="div"></div> </div> </form> </body> </html>
codice:Option Strict On Imports l = libreria.ModuloWeb Partial Class prove_a Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ajax_comando As String = l.RequestParams("ajax_comando") If ajax_comando = "1" Then Me.Response.Write("Ciao, Mondo!") Me.Response.Write("<script type=""text/javascript"">alert(""Codice javascript inviato con ajax""); /*initialize Tab Menu*/</script>") Me.Response.End() End If End Sub End Class

non ne ho la più pallida idea perchè non vada.
