Javascript OnClientClick不起作用

Javascript OnClientClick不起作用,javascript,c#,Javascript,C#,我有这个按钮: <asp:Button runat="server" ID="botao" OnClientClick="submit();" OnClick="submeter" Text="Pedir Revisão" /> 这个JavaScript函数: function submit() { alert("entrei"); //tabelaAutores var tabela = document.getElementById("tabelaA

我有这个按钮:

<asp:Button runat="server" ID="botao" OnClientClick="submit();" OnClick="submeter" Text="Pedir Revisão" />

这个JavaScript函数:

function submit() {
    alert("entrei");
    //tabelaAutores
    var tabela = document.getElementById("tabelaAutores");
    var tableAux = document.getElementById('<%=tabelaAutoresAux.ClientID %>');
    var x = tabela.rows.length;
    for (i = 1; i < x; i++) {
        tableAux.innerText += tabela.rows[i].cells[0].innerText + "/" + tabela.rows[i].cells[1].innerText + "|";
    }
    alert(tableAux.innerText);
    return false;
}
protected void submeter(object sender, EventArgs e)
{
    Debug.WriteLine("aqui----");
    Debug.Write(tabelaAutoresAux.InnerText);
    int id = int.Parse(Request.QueryString["id"]);
    //adicionar autores
    String[] aC = tabelaAutoresAux.InnerText.Split('|');
    for (int i = 0; i < aC.Length - 1; i++)
    {
        String[] aC2 = aC[i].Split('/');
        DataTable pessoa = DBConFactory.getInstance().getPessoaByEmail(aC2[1]);
        if (pessoa.Rows.Count != 0)
        {
            bool x = DBConFactory.getInstance().add(int.Parse(pessoa.Rows[0]["nOrdem"].ToString()), id); 
        }
    }
}
函数提交(){
警惕(“entrei”);
//tabelaAutores
var tabela=document.getElementById(“tabelaatores”);
var tableAux=document.getElementById(“”);
var x=tabela.rows.length;
对于(i=1;i
这个C#函数:

function submit() {
    alert("entrei");
    //tabelaAutores
    var tabela = document.getElementById("tabelaAutores");
    var tableAux = document.getElementById('<%=tabelaAutoresAux.ClientID %>');
    var x = tabela.rows.length;
    for (i = 1; i < x; i++) {
        tableAux.innerText += tabela.rows[i].cells[0].innerText + "/" + tabela.rows[i].cells[1].innerText + "|";
    }
    alert(tableAux.innerText);
    return false;
}
protected void submeter(object sender, EventArgs e)
{
    Debug.WriteLine("aqui----");
    Debug.Write(tabelaAutoresAux.InnerText);
    int id = int.Parse(Request.QueryString["id"]);
    //adicionar autores
    String[] aC = tabelaAutoresAux.InnerText.Split('|');
    for (int i = 0; i < aC.Length - 1; i++)
    {
        String[] aC2 = aC[i].Split('/');
        DataTable pessoa = DBConFactory.getInstance().getPessoaByEmail(aC2[1]);
        if (pessoa.Rows.Count != 0)
        {
            bool x = DBConFactory.getInstance().add(int.Parse(pessoa.Rows[0]["nOrdem"].ToString()), id); 
        }
    }
}
受保护的无效子表(对象发送方、事件参数e)
{
Debug.WriteLine(“aqui--”);
Debug.Write(tabelautoresaux.InnerText);
int id=int.Parse(Request.QueryString[“id”]);
//放射自显影
字符串[]aC=tabelaautresaux.InnerText.Split(“|”);
对于(int i=0;i
代码输入c#函数,但不输入JavaScript代码

这是全部代码

<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AdicionarRevisor.aspx.cs" Inherits="CasosClinicos.Admin.AdicionarRevisor" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <script>
        var PopupImageContainer = new Image();
        var PopupImageCaption = new String();
        var PopupImageSRC = new String();

        function PopImage(imagesrc, caption) {
            if (length.imagesrc < 1) { return; }
            var loadDelay = PopupImageSRC.length ? 1 : 750;
            PopupImageSRC = imagesrc;
            PopupImageCaption = caption ? caption : 'Image';
            PopupImageContainer.src = PopupImageSRC;
            setTimeout("PopupImageDisplay()", loadDelay);
        }

        function PopupImageDisplay() {
            var iw = $(window).width() - 50;
            var ih = $(window).height() - 50;
            var ww = $(window).width();
            var hh = $(window).height();
            var properties = 'height=' + hh + ',width=' + ww + ',resizable=yes,location=center';
            var picture = window.open('', '', properties);
            picture.document.writeln('<html><head>');
            picture.document.writeln('<script language="JavaScript"> function CloseMe() { self.close(); } <' + '/script>');
            picture.document.write('<' + '/head><body onBlur="CloseMe()"><center>');
            picture.document.write('<img id="' + PopupImageSRC + '" src="' + PopupImageSRC + '" width="' + iw + '" height="' + ih + '" border="0">');
            picture.document.write('<p>' + PopupImageCaption + '<' + '/p>');
            picture.document.writeln('<' + '/center><' + '/body><' + '/html>');
        }
    </script>
    <script>
        function addAutorB() {
            var select = document.getElementById('<%=listaAutores.ClientID %>').value;
            if (select.localeCompare("") == 0) {
                return;
            }
            else if (select.localeCompare("Adicionar Novo") == 0) {
                document.getElementById("camposAutor").style.display = "block";
                document.getElementById("initial").selected = true;
            }
            else {
                var x = select.split("(");
                document.getElementById("autores").value = x[0];
                document.getElementById("contato").value = x[1].split(")")[0];
                addAutor();
            }
            document.getElementById("initial").selected = true;
        }

        function addAutor() {
            var table = document.getElementById("tabelaAutores");
            var row = table.insertRow(1);
            var cell1 = row.insertCell(0);
            var cell2 = row.insertCell(1);
            var cell3 = row.insertCell(2);
            cell1.innerText = document.getElementById("autores").value;
            cell2.innerText = document.getElementById("contato").value;
            cell3.innerHTML = "<button type=\"button\" onclick=\"return deleteRow(this)\" class=\"btn btn-default\" aria-label=\"Left Align\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></button>";
            document.getElementById("autores").value = "";
            document.getElementById("contato").value = "";
            document.getElementById("camposAutor").style.display = "none";
            return false;
        }
        function deleteRow(r) {
            var i = r.parentNode.parentNode.rowIndex;
            document.getElementById("tabelaAutores").deleteRow(i);
            return false;
        }
        function submit() {
            alert("entrei");
            //tabelaAutores
            var tabela = document.getElementById("tabelaAutores");
            var tableAux = document.getElementById('<%=tabelaAutoresAux.ClientID %>');
            var x = tabela.rows.length;
            for (i = 1; i < x; i++) {
                tableAux.innerText += tabela.rows[i].cells[0].innerText + "/" + tabela.rows[i].cells[1].innerText + "|";
            }
            alert(tableAux.innerText);
            return false;
        }
    </script>
    <br />
    <br />

    <div class="row">
        <div class="col-md-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><strong>Revisores</strong></h3>
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <label for="autores">Revisores</label>

                        <select runat="server" id="listaRevisores" onchange="addAutorB()">
                            <option id="initial"></option>
                        </select>
                        <br />
                        <label for="autores">Autores</label>

                        <select runat="server" id="listaAutores" onchange="addAutorB()">
                            <option id="initial1"></option>
                        </select>

                        <style>
                            table.fixed {
                                table-layout: fixed;
                            }

                                table.fixed td {
                                    overflow: hidden;
                                }
                        </style>

                        <div id="camposAutor" style="display: none;">
                            <input type="text" id="autores">
                            <input type="text" id="contato" />
                            <button type="button" onclick="return addAutor()" class="btn btn-default" aria-label="Left Align\"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
                        </div>


                        <table id="tabelaAutores" border="1" class="fixed">
                            <col width="255px" />
                            <col width="255px" />
                            <col width="90px" />
                            <tr>
                                <td><strong>Autor</strong></td>
                                <td><strong>Contato</strong></td>
                                <td></td>
                            </tr>
                        </table>
                        <br />
                    </div>
                    <div id="autoresAux" runat="server" style="display: none;">
                        <textarea runat="server" id="tabelaAutoresAux"></textarea>
                    </div>
                    <div>
                        <asp:Button runat="server" ID="botao" OnClientClick="submit();" OnClick="submeter" Text="Pedir Revisão" />
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="panel panel-default" style="position: fixed; overflow: auto; height: 85%">
                <div class="panel-heading">
                    <h3 class="panel-title"><strong>Caso</strong></h3>
                </div>
                <div class="panel-body">
                    <div style="overflow: auto; padding: 5px;">
                        <div class="form-group">
                            <label runat="server">Titulo: </label>
                            <p runat="server" id="text_titulo"></p>
                            <label runat="server">Autores: </label>
                            <p runat="server" id="text_autores"></p>
                            <label runat="server">Intituição: </label>
                            <p runat="server" id="text_inst"></p>
                            <label>Resumo: </label>
                            <pre runat="server" id="text_resumo"></pre>
                            <div id="conteudo">
                                <p runat="server" id="text_conteudo"></p>
                            </div>
                            <label>Imagens: </label>
                            <p runat="server" id="text_img"></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>

var PopupImageContainer=新图像();
var PopupImageCaption=新字符串();
var PopupImageSRC=新字符串();
函数PopImage(imagesrc,标题){
if(length.imagesrc<1){return;}
var loadDelay=PopupImageSRC.length?1:750;
PopupImageSRC=imagesrc;
PopupImageCaption=标题?标题:“图像”;
PopupImageContainer.src=PopupImageSRC;
setTimeout(“PopupImageDisplay()”,loadDelay);
}
函数PopupImageDisplay(){
var iw=$(窗口).width()-50;
var ih=$(窗口).height()-50;
var ww=$(window.width();
var hh=$(window.height();
变量属性='高度='+hh+',宽度='+ww+',可调整大小=是,位置=中心';
var图片=窗口打开('','',属性);
图片。文件。书面文件(“”);
picture.document.writeln('function CloseMe(){self.close();}');
图片。文件。书写(“”);
图片。文件。书写(“”);
picture.document.write(“”+PopupImageCaption+”);
图片。文件。书面文件(“”);
}
函数addAutorB(){
var select=document.getElementById(“”).value;
如果(选择.localeCompare(“”==0){
返回;
}
else if(select.localeCompare(“Adicionar Novo”)==0){
document.getElementById(“camposAutor”).style.display=“block”;
document.getElementById(“初始”).selected=true;
}
否则{
var x=选择.拆分(“”);
document.getElementById(“autores”).value=x[0];
document.getElementById(“contato”).value=x[1]。拆分(“)”[0];
addAutor();
}
document.getElementById(“初始”).selected=true;
}
函数addAutor(){
var table=document.getElementById(“tabelaAutores”);
var行=table.insertRow(1);
var cell1=行插入单元格(0);
var cell2=行插入单元格(1);
var cell3=行插入单元格(2);
cell1.innerText=document.getElementById(“autores”).value;
cell2.innerText=document.getElementById(“contato”).value;
cell3.innerHTML=“”;
document.getElementById(“autores”).value=“”;
document.getElementById(“contato”).value=“”;
document.getElementById(“camposAutor”).style.display=“无”;
返回false;
}
函数deleteRow(r){
var i=r.parentNode.parentNode.rowIndex;
document.getElementById(“tabelaAutores”).deleteRow(i);
返回false;
}
函数提交(){
警惕(“entrei”);
//tabelaAutores
var tabela=document.getElementById(“tabelaatores”);
var tableAux=document.getElementById(“”);
var x=tabela.rows.length;
对于(i=1;i

修订者 校订者
奥托雷斯 表1.2固定{ 表布局:固定; } 表3.1固定运输距离{ 溢出:隐藏; } Autor Contato