天天看点

怎么样才可以让Form表单在加载的时候只自动提交一次?

方案一:

 使用body标签的onload方法提交form表单即可。

   具体如下例:

方案二:

通过javascript起到主动提交表单的作用

代码a部分:

代码b部分:

<head runat="server">

a与b均为前台aspx页面的代码,该javascript代码的运行需要在后台,调用,后台调用代码如下:

  clientscript.registerstartupscript(this.gettype(), "message", "<script language='javascript' >sub();</script>");

继续阅读