本文介绍了使用javascript更改asp:button中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想在asp:button中使用javascript更改值,以在单击它时捕获后面代码的值,默认值为Text ="show"

当我使用javascript"left:......."
时,我看到页面上的更改但是当我用字符串a = button.text捕获代码后面的按钮时,我得到的是默认值"show",而不是网页上按钮上显示的值.

这是用于更改按钮上文本的javascript代码

Hello, I would like to change the value using javascript in a asp:button to catch the value on the code behind when i click on it, the default value Text="show"

i see the change on the page when i use the javascript "left: ......."
but when i catch the button in code behind with string a = button.text i get the default value "show" and not the value shown on the button on the webpage.

this is the javascript code that changes the text on the button

document.getElementById("hidden1").text = ("Left: " + $(this).parent().dialog(''widget'').position().left + " Top: " + $(this).parent().dialog(''widget'').position().top);

// click the button
document.getElementById("hidden1").click();



我也不想在单击按钮时重新加载页面,我只想从后面的代码中捕获按钮中的值,ajax可以解决这个问题吗?

谁能帮忙,谢谢



Also i don''t want to reload the page when the button i clicked, i only want to catch the value in the button from code behind, can ajax solve this?

Can anyone help, Thanks

推荐答案




我也不想在单击按钮时重新加载页面,我只想从后面的代码中捕获按钮中的值,ajax可以解决这个问题吗?

任何人都可以帮忙,谢谢



Also i don''t want to reload the page when the button i clicked, i only want to catch the value in the button from code behind, can ajax solve this?

Can anyone help, Thanks



这篇关于使用javascript更改asp:button中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 20:30
查看更多