换掉它是什么意思?__doPostBack()方法是asp.net回发当前页的客户端代码,好多服务器控件,象LinkButton等都必须有这个方法才能正确工作。
解决方案 »
- 关于DateTime时间的比较问题
- 使用TreeViews 帮定数据问题
- 100求一个高效的算法。。。。
- 不是一般的Automation 服务器不能创建对象 问题?
- 庆祝奥运会圆满结束,中国队取得第二
- 如何把一个 html 文件的内容在一个单元格内显示出来?
- 如何做生成序列号或卡号的功能,请高手指教
- 如何将WIN2003的IIS里的默认网站目录内容设为可以读写呢?我现在的ASP.NET只读不能写呀!!
- 多行文本框动态添加。98%结贴率,大神都来看看
- 请教高手,怎样回到历史状态。迫不得已使用服务器端检查,检查不通过可以返回提交前的状态吗
- 如果我的aspx程序有问题,让别人访问如何能隐藏“应用程序中的服务器错误”
- 水晶报表打印的问题
Sub CreateFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim strFileName As String = funcParam.Value
'custom code to create a text file
End Sub
</script>
<html>
<head>
<script language="JavaScript">
//ask for user input and then create file
function CreateFile() {
//get filename from the user
var fileName = prompt('Type the name of the file you want to create:','');
//if the user clicks on OK and if they have entered something
if ((fileName) && (fileName!="")) {
//save the filename to the hidden form field 'funcParam'
document.forms['myForm'].elements['funcParam'].value = fileName;
//call the postback function with the right ID
__doPostBack('CreateFile','');
}
}
</script>
</head>
<body>
<form runat="server" id="myForm">
<a href="javascript:CreateFile();">Create Text file</a>
<asp:linkbutton id="CreateFile" runat="server" onclick="CreateFile_Click" />
<input type="hidden" runat="server" id="funcParam">
</form>
</body>
</html>