小技术(ASP.NET)
一:在页面中使用隐藏字段的方法:
A:定义隐藏字段
RegisterHiddenField(变量名, 初始值)
B:在运行中设置隐藏字段的内容
javascript:document.forms[0].变量名.value='';document.forms[0].submit;
C:取得隐藏字段的值
Request.Form(变量名)
例:Page_Load....
RegisterHiddenField('__hideField','')
IF Not Request.Form('__hideField') Is Nothing Then
Response.Write(Request.Form('__hideField'))
End IF
-----------------------------------------------------------------------------------
在需设定隐藏字段内容的方法中
Dim SetValue as string
SetValue = '<script>document.forms[0].__hideField.value='FSVision';' _
& ' document.forms[0].submit;</script>'
Page.RegisterStartupScript('SetValue ', SetValue )