<script language="VB" runat="server">
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
Response.Write(strFileName)
End Sub
</script>
<script type="text/javascript" language="JavaScript">
function CreateFile() {
var fileName = prompt('Type the name of the file you want to create:','');
if ((fileName) && (fileName!="")) {
document.forms['myForm'].elements['funcParam'].value = fileName;
}
__doPostBack('CreateFile','');
}
</script>
<form runat="server" id="myForm">
<a href="javascript:CreateFile();">ทดลองข้อมูล</a>
<asp:linkbutton id="CreateFile" runat="server" onclick="CreateFile_Click" />
<input type="hidden" runat="server" id="funcParam">
</form>
ลองดูครับใช้ odPostBack มาช่วย