vb.netコードでJavascriptを書く必要があるので、誰か助けてもらえますか? つまり、私はvb.netコーディングが初めてで、Webサービスから動的に作成されたテーブルがあり、そのテーブルにはjavascriptコードにあるソート機能を追加する必要があり、このスクリプトをに追加する必要がありますこれで試した動的に作成されたテーブル:
     oSB.Append("table.RegisterStartupScript('SCRIPTNAME', '<script language='javascript'>function tname(){alert('kk')};</script>')")
しかし、まったく機能していないようです。
また、私はこれで試しました
     'oSB.Append("<script>$('[id^=tname] th').live('click',function(event){ alert('hello')}</script>")
私のajax関数:
     $.ajax({
        type: "POST",
        url: "Service1.asmx/GetRecipie",
        contentType: "application/json; charset=utf-8",
        data: "{'sDB':'" + sDB + "'}",
        dataType: "json",
        success: OnGetMemberSuccess,
        failure: function (errMsg) {
            $('#errorMessage').text(errMsg);  //errorMessage is id of the  div
        }
    });
    function OnGetMemberSuccess(data, status) {
        xistr = data.d.split(',');
        $("#MemberDetails").html(data.d);
        $('input[type=button]').attr('disabled', false);
    }
} 
テーブルは、このコード (webservice) によって作成されます。
     oSB.Append("<table id= '" + table_id + "' class='sortable' ><thead><tr><th class=border id='tname' >" + "Name" + "<img src='next.gif'/></th><th class=border>" + "Duration" + "</th><th class=border>" + "State" + "</th><th class=border>" + "Party" + "</th><th class=border>" + "Year" + "</th></tr></thead>")
     sNameValue = dr("sName").ToString
        sDurValue = dr("sDuration").ToString
        sStateValue = dr("sState").ToString
        sPartyValue = dr("sParty").ToString
        sYearValue = dr("sYear").ToString
        oSB.Append("<tbody id=tbodyid'>")
        ' oSB.Append("<tr id='trid'>")
        oSB.Append("<tr>")
        oSB.Append("<td id='tdid' class=border1>")
        oSB.Append(sNameValue)
        oSB.Append("</td>")
        oSB.Append("<td class=border1>")
        oSB.Append(sDurValue)
        oSB.Append("</td>")
        oSB.Append("<td id='td_state' class=border1>")
        oSB.Append(sStateValue)
        oSB.Append("</td>")
        oSB.Append("<td class=border1>")
        oSB.Append(sPartyValue)
        oSB.Append("</td>")
        oSB.Append("<td class=border1>")
        oSB.Append(sYearValue)
        oSB.Append("</td>")
        oSB.Append("</tr>")
        oSB.Append("</tbody>")
    End While
    dr.Close()
    con.Close()
    oSB.Append("</table>")
    'MsgBox(table.ToString)
    Debug.Print(oSB.ToString)
誰かが私が間違っている場所を教えてもらえますか?
また乾杯