| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c# >> C# dai ma yu JavaScript han shu de xiang hu tiao yong
 

C# dai ma yu JavaScript han shu de xiang hu tiao yong

2008-08-15 05:14:18 编辑來源:互联网 评论
 
本文为【C#代码与JavaScript函数的相互调用】的拼音翻译版
  wo men tong guo wen da de fang shi lai wei da jia jie da C# yu JavaScript han shu de xiang hu tiao yong :
  1、 ru he zai JavaScript fang wen C# han shu ?
  2、 ru he zai JavaScript fang wen C# bian liang ?
  3、 ru he zai C# zhong fang wen JavaScript de yi you bian liang ?
  4、 ru he zai C# zhong fang wen JavaScript han shu ?
  wen ti 1: ru he zai JavaScript fang wen C# han shu ?
  da an ru xia :
  javaScript han shu zhong zhi xing C# dai ma zhong de han shu :
  fang fa yi :
  1、 shou xian jian li yi ge an niu , zai hou tai jiang tiao yong huo chu li de nei rong xie ru button_click zhong ;
  2、 zai qian tai xie yi ge js han shu , nei rong wei document.getElementById("btn1").click();
  3、 zai qian tai huo hou tai tiao yong js han shu , ji fa click shi jian , deng yu fang wen hou tai c# han shu ;
  fang fa er :
  1、 han shu sheng ming wei public
  hou tai dai ma ( ba public gai cheng protected ye ke yi )
  yi xia shi yin yong pian duan :
  public string ss()
  {
  return("a");
  }
  2、 zai html li , ke yi tiao yong qian tai jiao ben
  yi xia shi yin yong pian duan :
  <script language=javascript>
  var a = "<%=ss()%>";
  alert(a);
  </script>
  fang fa san :
  yi xia shi yin yong pian duan :
  <script language="javascript">
  <!--
  function __doPostBack(eventTarget, eventArgument)
  {
  var theForm = document.Form1; // zhi runat=server de form
  theForm.__EVENTTARGET.value = eventTarget;
  theFrom.__EVENTARGUMENT.value = eventArgument;
  theForm.submit();
  }
  -->
  </script>
  <input type="button" value=" an niu "
  onclick="">
  fang fa si :
  yi xia shi yin yong pian duan :
  script language="javascript">
  function SubmitKeyClick()
  {
  if (event.keyCode == 13)
  {
  event.cancelBubble = true;
  event.returnValue = false;
  document.all.FunName.value=" ni yao tiao yong de han shu ming ";
  document.form[0].submit();
  }
  }
  </script>
  <INPUT type="text">
  <input type="hidden" > 〈!-- yong lai cun chu ni yao tiao yong de han shu --〉
  zai .CS li you :
  yi xia shi yin yong pian duan :
  public Page_OnLoad()
  {
  if (!Page.IsPost())
  {
  string strFunName=Request.Form["FunName"]!=null?Request.Form["FunName"]:"";
  // gen ju chuan hui lai de zhi jue ding tiao yong na ge han shu
  switch(strFunName)
  {
  case "enter()":
  enter() ; // tiao yong gai han shu
  break;
  case " qi ta ":
  // tiao yong qi ta han shu
  break;
  default:
  // tiao yong mo ren han shu
  break;
  }
  }
  }
  public void enter()
  {
  //…… bi ru ji suan mou zhi
  } wen ti 2: ru he zai JavaScript fang wen C# bian liang ?
  da an ru xia :
  fang fa yi : tong guo ye mian shang yin cang yu fang wen <input type="hidden" runat="server">;
  fang fa er : ru hou tai ding yi le PUBLIC STRING N; qian tai js zhong yin yong gai bian liang de ge shi wei ’’ huo "++";
  fang fa san : huo zhe ni ke yi zai fu wu qi duan bian liang fu zhi hou zai ye mian zhu ce yi duan jiao ben ;
  "<script language=’javascript’>var temp=" + tmp + "</script>" tmp shi hou tai bian liang , ran hou js zhong ke yi zhi jie fang wen temp huo de zhi 。
  wen ti 3: ru he zai C# zhong fang wen JavaScript de yi you bian liang ?
  da an ru xia :
  fang fa yi :
  1、 qian tai shi yong jing tai wen ben kong jian yin cang yu , jiang js bian liang zhi xie ru qi zhong ;
  2、 hou tai yong request["id"] lai huo qu zhi ;
  fang fa er :
  ke yi yong cookie huo session。
  wen ti 4: ru he zai C# zhong fang wen JavaScript han shu ?
  da an ru xia :
  c# dai ma zhong zhi xing javaScript han shu :
  fang fa yi :
  Page.RegisterStartupScript("ggg"," ");
  fang fa er :
  shi yong Literal lei , ran hou
  yi xia shi yin yong pian duan :
  private void Button2_Click(object sender, System.EventArgs e)
  {
  string str;
  str="";
  //Literal1.Visible=true;
  Literal1.Text=str;
  }【原文】【汉音对照
 
 
 
 92.*.*.* 发表于2012-07-20 20:23:20
  Didn't know the forum rules alleowd such brilliant posts.(该评论有大约1条回复)
  回复
  
  
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
wo men tong guo wen da de fang shi lai wei da jia jie da C# yu JavaScript han shu de xiang hu tiao yong : 1、 ru he zai JavaScript fang wen C# han shu ? 2、 ru he zai JavaScript fang wen C# bian liang ? 3、 ru he zai C# zhong fang wen JavaScript de yi you bian liang ? 4、 ru he zai C# zhong fang wen JavaScript han shu ? wen ti 1: ru he zai JavaScript fang wen C# han shu ? da an ru xia : javaScript han shu zhong zhi xing C# dai ma zhong de han shu : fang fa yi : 1、 shou xian jian li yi ge an niu , zai hou tai jiang tiao yong huo chu li de nei rong xie ru button_click zhong ; 2、 zai qian tai xie yi ge js han shu , nei rong wei document.getElementById("btn1").click(); 3、 zai qian tai huo hou tai tiao yong js han shu , ji fa click shi jian , deng yu fang wen hou tai c# han shu ; fang fa er : 1、 han shu sheng ming wei public hou tai dai ma ( ba public gai cheng protected ye ke yi ) yi xia shi yin yong pian duan : public string ss() { return("a"); } 2、 zai html li , ke yi tiao yong qian tai jiao ben yi xia shi yin yong pian duan : <script language=javascript> var a = "<%=ss()%>"; alert(a); </script> fang fa san : yi xia shi yin yong pian duan : <script language="javascript"> <!-- function __doPostBack(eventTarget, eventArgument) { var theForm = document.Form1; // zhi runat=server de form theForm.__EVENTTARGET.value = eventTarget; theFrom.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } --> </script> <input type="button" value=" an niu " onclick=""> fang fa si : yi xia shi yin yong pian duan : script language="javascript"> function SubmitKeyClick() { if (event.keyCode == 13) { event.cancelBubble = true; event.returnValue = false; document.all.FunName.value=" ni yao tiao yong de han shu ming "; document.form[0].submit(); } } </script> <INPUT type="text"> <input type="hidden" > 〈!-- yong lai cun chu ni yao tiao yong de han shu --〉 zai .CS li you : yi xia shi yin yong pian duan : public Page_OnLoad() { if (!Page.IsPost()) { string strFunName=Request.Form["FunName"]!=null?Request.Form["FunName"]:""; // gen ju chuan hui lai de zhi jue ding tiao yong na ge han shu switch(strFunName) { case "enter()": enter() ; // tiao yong gai han shu break; case " qi ta ": // tiao yong qi ta han shu break; default: // tiao yong mo ren han shu break; } } } public void enter() { //…… bi ru ji suan mou zhi } wen ti 2: ru he zai JavaScript fang wen C# bian liang ? da an ru xia : fang fa yi : tong guo ye mian shang yin cang yu fang wen <input type="hidden" runat="server">; fang fa er : ru hou tai ding yi le PUBLIC STRING N; qian tai js zhong yin yong gai bian liang de ge shi wei ’’ huo "++"; fang fa san : huo zhe ni ke yi zai fu wu qi duan bian liang fu zhi hou zai ye mian zhu ce yi duan jiao ben ; "<script language=’javascript’>var temp=" + tmp + "</script>" tmp shi hou tai bian liang , ran hou js zhong ke yi zhi jie fang wen temp huo de zhi 。 wen ti 3: ru he zai C# zhong fang wen JavaScript de yi you bian liang ? da an ru xia : fang fa yi : 1、 qian tai shi yong jing tai wen ben kong jian yin cang yu , jiang js bian liang zhi xie ru qi zhong ; 2、 hou tai yong request["id"] lai huo qu zhi ; fang fa er : ke yi yong cookie huo session。 wen ti 4: ru he zai C# zhong fang wen JavaScript han shu ? da an ru xia : c# dai ma zhong zhi xing javaScript han shu : fang fa yi : Page.RegisterStartupScript("ggg"," "); fang fa er : shi yong Literal lei , ran hou yi xia shi yin yong pian duan : private void Button2_Click(object sender, System.EventArgs e) { string str; str=""; //Literal1.Visible=true; Literal1.Text=str; }
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚性感的燕子(3)
时尚性感的燕子(2)
纯美的女生生活写真(14)
纯美的女生生活写真(13)
来自束河[]
恰巧-巧家~~
高尔夫
行摄匆匆天子山
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有