关于Javascript与ASP按钮的非常简单的问题 [英] Very simple question on Javascript with ASP button

查看:74
本文介绍了关于Javascript与ASP按钮的非常简单的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我没有任何明确答案就四处寻找。很多东西,但没什么具体的。


我试图调用这个Javascript函数:


函数ButtonClicked()

{

提醒(按钮已被点击。);

}


来自HTML按钮完全没问题。但我无法从ASP按钮调用该功能。我尝试从HTML端或aspx端。


我明白ASP按钮只能在服务器上运行。但我不敢相信你不能做那么简单的电话。当Web窗体上的ASP设计如此快速和简单时,我真的很讨厌使用HTML按钮。


由于我是新手,一些代码示例将不胜感激。


简单地说,我有一个ASP按钮,我想调用Javascript函数ButtonClicked


谢谢


Frag

解决方案

Frag写道:

大家好,
我在没有任何明确答案的情况下四处寻找。很多东西,但没有什么东西
具体。

我试图调用这个Javascript函数:

函数ButtonClicked()
{
警告(按钮已被点击。);


从HTML按钮调用它完全没有问题。但我无法通过ASP按钮调用该功能。我尝试从HTML端或aspx端。

我知道ASP按钮只能在服务器上运行。但我不能相信你不能做那么简单的电话。我非常讨厌使用HTML按钮
当Web窗体上的ASP设计如此快速和简单时。

由于我是一个新手,一些代码示例将不胜感激。

简而言之,我有一个ASP按钮,我想调用Javascript函数
ButtonClicked

谢谢

Frag




你好Frag,


我不知道ASP按钮是什么,但是如果它是一些HTML生成的

一个工具,只需查看它产生的代码。

如果你看到< a href =""> blabla< / a>您可以尝试在锚点中添加一些

简单代码,例如onClick ="" ;.


如果代码始终是动态生成的,你应该阅读规格

如何添加额外的东西(如果可能的话)。


问候,

欧文Moller


在文章< eC ********** @ fe09.usenetserver.com> ;, fr ** @ frag.com

启发我们...


从中调用它HTML按钮完全没问题。但我无法通过ASP按钮调用该功能。我尝试从HTML端或aspx端。




当然可以。

将脚本附加到它。

http://dotnetextreme.com/articles/validationAspNet.asp
http://www.code101.com/ Code101 / Displ ... le.aspx?cid = 33


关于dotnet的最佳问题指向

msnews:microsoft.public.dotnet .scripting。


哦,我不会使用dotnet。我在谷歌的答案中找到了大约一分钟的答案。谷歌是你的朋友。


-

-

~kaeli~

如果是关于失败的书没有卖,是否成功?
http:// www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign .net / kaelisSpace




Public Sub btnCallJavascript_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs)处理btnCallJavascript.Click


lblScript.Text ="< SCRIPT

language =''Javascript1。 2''> popUp)

< / SCRIPT>"


结束Su


未注册

------------------------------------------- ----------------------------

发表于 http://www.forum4designers.c o

------------------------------------- ----------------------------------

查看此主题: http://www.forum4designers.com/message36240.htm

Hi guys,

I searched around without any clear answer. Tons of stuff, but nothing concrete.

I am trying to call this Javascript function:

function ButtonClicked()
{
alert("The button has been clicked.");
}

Calling it from an HTML button is no problem at all. But there is no way I can call that function from an ASP button. I tried from the HTML side or the aspx side.

I understood that an ASP button run only on the server. But I can''t believe you can''t make that simple call. I really hate to use HTML button when the design with ASP on a Web Form is so fast and easy.

Since I am a newbie, some code example will be appreciated.

Briefly, I have an ASP button that I want to call the Javascript function "ButtonClicked"

Thanks

Frag

解决方案

Frag wrote:

Hi guys,

I searched around without any clear answer. Tons of stuff, but nothing
concrete.

I am trying to call this Javascript function:

function ButtonClicked()
{
alert("The button has been clicked.");
}

Calling it from an HTML button is no problem at all. But there is no way I
can call that function from an ASP button. I tried from the HTML side or
the aspx side.

I understood that an ASP button run only on the server. But I can''t
believe you can''t make that simple call. I really hate to use HTML button
when the design with ASP on a Web Form is so fast and easy.

Since I am a newbie, some code example will be appreciated.

Briefly, I have an ASP button that I want to call the Javascript function
"ButtonClicked"

Thanks

Frag



Hi Frag,

I haven''t got a clue what an ASP-button is, but if it is some HTML generated
by a tool, just look into the code it produces.
If you see <a href="">blabla</a> that is where you can try to add some
simple code in the anchor, like onClick="".

If the code is always generated dynamically, you should read in the specs
how to add extra things to it (if possible).

Regards,
Erwin Moller


In article <eC**********@fe09.usenetserver.com>, fr**@frag.com
enlightened us with...


Calling it from an HTML button is no problem at all. But there is no way I can call that
function from an ASP button. I tried from the HTML side or the aspx side.



Sure you can.
Attach the script to it.

http://dotnetextreme.com/articles/validationAspNet.asp
http://www.code101.com/Code101/Displ...le.aspx?cid=33

Questions about dotnet best directed to
msnews:microsoft.public.dotnet.scripting.

Oh, and I don''t use dotnet. I found the answer on Google in about a
minute. Google is your friend.

--
--
~kaeli~
If a book about failures doesn''t sell, is it a success?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



Public Sub btnCallJavascript_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCallJavascript.Click

lblScript.Text = "<SCRIPT
language=''Javascript1.2''>popUp)
</SCRIPT>"

End Su

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message36240.htm


这篇关于关于Javascript与ASP按钮的非常简单的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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