在更新面板中调用Java脚本 [英] calling Java Script in Update Pannel
问题描述
你好,
我有以下JavaScript()
< script language ="Javascript" type ="text/javascript">
函数ShowMessage()
{
警报('Hello World');
}
< Script>
在加载页面时调用此方法. />- 在此页面中,有一个更新面板,其中包含一些文本框,一个按钮和一个网格视图.
-用户在textBoxes中写数据,按Button,在GridView中查看DataViewd (这发生在没有postpack的情况下).
-现在,我需要在用户按钮Clck时重新调用JavaScript的方法.我使用下面的Suntax:
受保护的Button_Click(对象发送者,事件Args e)
{
//一些从文本框获取数据并将其放入ig GridView的代码.
  ; ScriptManager(this ,this.GetType(),"MyScript",ShowMessage(),true);
}
-我测试了Page,当用户在textBoxes中输入一些data时,在GridView中查看了数据,但未调用JavaScript中的函数. 所以我怎么称呼这个JavaScript ???
注意: Pgae有一个母版页.
ASk
谢谢您的发帖!我建议您将您的问题发布到论坛上
脚本中心 >
http://social.technet.microsoft.com /Forums/zh-CN/ITCG/threads 祝你有美好的一天!!!!!
Hello ,
I have the Following JavaScript()
<script language = "Javascript" type="text/javascript">
function ShowMessage ()
{
alert ( 'Hello World');
}
<Script>
this method is called when the page is loaded .
--------------
- in this Page , There is a Update Pannel which contains some textBoxes a button and a grid View .
- The User write datain textBoxes , press on Button , The DataViewd in GridView ( this Happened without postpack ) .
- Now I need to recall the method of JavaScript when the User button Clck . And I use the folloing Suntax :
protected Button_Click( object sender , event Args e)
{
// Some Code which take data from textBoxes and put it ig GridView .
ScriptManager ( this , this.GetType() , "MyScript" , ShowMessage(),true);
}
- I test the Page , when the user enter some dataIn textBoxes , the data viewd in GridView but the function in JavaScript not Called .
so How Can I call this JavaScript??
Note: The Pgae has a master page .
ASk
Hi,
Thank you for your post! I would suggest please post your question in the forum
Script Center > Scripting Forums > The Official Scripting Guys Forum!
located here: http://social.technet.microsoft.com/Forums/en-US/ITCG/threads
Have a great day!!!!!
这篇关于在更新面板中调用Java脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!