使用ASP.NET/HTML按钮 [英] Using ASP.NET / HTML buttons

查看:102
本文介绍了使用ASP.NET/HTML按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有两个按钮的表格:

I have a form with two buttons:

<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <input type="button" onclick="criarNota();" value="Criar Nota" />
        <input type="button" onclick="botaoCarregarNotas();" value="Carregar Notas" />

    </form>



但是我希望第二个按钮"Carregar Notas"仅在单击"Criar Nota"按钮之后出现.



But I would like that the second buttons "Carregar Notas", only appears after clicking on "Criar Nota" button.

Is that possible ?

推荐答案


代码看起来像这样

Hi
The code will look some thing like this

<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <input type="button" id="criarNota" onclick="criarNota();" value="Criar Nota" />
        <input type="button" id="botaoCarregarNotas" onclick="botaoCarregarNotas();" style="display:none;" value="Carregar Notas" />
    </form>




现在,Javascript函数将如下所示:

函数criarNota(){
document.getElementById("botaoCarregarNotas").style.display ="block";
}

谢谢
希望对您有帮助




Now the Javascript function will look like

function criarNota(){
document.getElementById("botaoCarregarNotas").style.display = "block";
}

Thanks
Hope this helps


是的,很有可能.

首先,为两个按钮定义ID字段.

首先将按钮的style:display属性设置为文本"Carregar Notas",然后将其设置为none.这将在页面上呈现按钮,但将其隐藏.

现在,单击带有文本"Criar Nota"的按钮,调用客户端Javascript方法"criarNota()"

在此方法中,获取另一个按钮,然后将display属性设置为block即可完成.试试吧!
Yes, very much possible.

First of all, define ID field for both the buttons.

Set the style:display property of button with text "Carregar Notas" as none to begin with. This would render the button on the page but keep it hidden.

Now, onclick of button with text "Criar Nota", call client side Javascript method "criarNota()"

In this method, get the other button and just set the display property to block and you are done. Try!


这篇关于使用ASP.NET/HTML按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆