js 调用的服务是指 web service 服务不?可以利用微软HTC组件.js 调用 HTC,HTC调用web service
解决方案 »
- c#如何裁剪图片并保存成新的图片
- C# 一个类库工程里建了多个组件最后编译后怎样能生成多个DLL文件
- win7 无法访问其它网络机器
- AllowDrop=true treeView还是不能拖动?????????????????
- VS2005中如何抑制交叉水晶报表的汇总,
- 帮忙解释一下,谢谢!!!
- 【版务帖】2008年7月C#版务帖
- 一个sqlDataAdapter初级问题
- c#.net winform 窗体连接远程服务器数据库的问题,谢谢~
- 外部文件如何与数据库中的内容比较
- 急~~~~~跪求高人指点线程级前瞻技术及部分线程进行重启具体实施方案~~~
- 动态获得记录信息,然后先将获得的记录信息保存在一个列表(内存中),再定义一个定时器,定期将列表中的记录(批量)写入数据库
http://blog.csdn.net/goody9807/articles/32465.aspx
JS调用后台事件 IE FF Firefox
在页面里面加入一下html代码 HTML code
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /></div>
<script type="text/javascript"><!--
var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; }function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } }// --></script>
下面是调用的代码 HTML code
<input id="Button2" type="button" value="button" onclick="SetFocus()" />
<script language="javascript">
function SetFocus()
{
__doPostBack('btn1','');
}
</script>还有 就是 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" EnableEventValidation="false" %>
加个 EnableEventValidation="false"HTML“
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" EnableEventValidation="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<script type="text/javascript"><!--
var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; }function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } }// --></script>
</div>
<input id="Button2" type="button" value="button" onclick="SetFocus()" />
<script language="javascript">
function SetFocus()
{
__doPostBack('Button1','');
}
</script> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</form>
</body>
</html>后台 using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = "dddd";
}
}