- function test(param)
- {
- var theform;
- theform = document.forms[0];
- if(!theform.__TEST)
- {
- theform.appendChild(document.createElement("<input type='hidden' name='__TEST'>"));
- }
- theform.__TEST.value = param;
- if ((typeof(theform.onsubmit) == "function"))
- {
- if(theform.onsubmit()!=false)
- {
- theform.submit();
- }
- }
- else
- {
- theform.submit();
- }
- }
我可以通过后台的 Request("__TEST")来获取值。其实说简单点,就是form表单提交到本页,将隐藏值的__TEST一同通过Post的方法提交到后台。
接下来再谈谈对Asp.net中服务器控件的理解,比如asp:Button,大家可能知道如果没有把asp:Button服务器控件放到form容器中的话,会报错,那是因为其实服务器控件是封装了Http的Post方法的,将在点击按钮时会自动的调用Post方法,将本页面回传。
1549



被折叠的 条评论
为什么被折叠?



