click 那个链接不能postback,但是click按钮是可以的。代码如下:
cal.aspx
-----------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="cal.aspx.cs" Inherits="cal" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    
</head>
<body>
    <form id="form1" runat="server"  >
        <input type="submit" value="click to submit" /> </form>  
  <a href="javascript:void(0)" onclick="validate()">click to submit</a>
    <script language="javascript">
    function validate()
    {
        var oform1 = window.document.getElementById( "form1" );
        oform1.submit();
    }
    </script></body>
</html>cal.aspx.cs
---------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class cal : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            Response.Write("not back");
        }
        else
        {
            Response.Write("we are in back now!!!");
        }
    }
}

解决方案 »

  1.   

    用linkbutton,把text属性设为空,即可隐藏
      

  2.   

    IsPostBack只是服务器控件回调的时候才触发的。
      

  3.   

    我改了你的两个地方,就实现了你说的点击链接可以使得页面postback
    1.添加form标签中的属性  method="post"
    2.将超链接改为<a href="#" onclick="validate()">click to submit</a>
    如下:
    <form id="form1" runat="server" method="post">
            <input type="submit" value="click to submit" /> </form>  
      <a href="#" onclick="validate()">click to submit</a>
        <script language="javascript">
        function validate()
        {
            var oform1 = window.document.getElementById( "form1" );
            oform1.submit();
        }
        </script>
      

  4.   

    是有点奇怪,好象以前是工作的,试一下其他IE版本但我一般是这么做的:  <a href="javascript:void(validate())">click to submit</a>
      

  5.   

    http://msdn.microsoft.com/library/en-us/script56/html/js56jsoprvoid.asp?frame=true
      

  6.   

    <a href="javascript:validate()">click to submit</a>
    还是写成这样好。问一下思归老大,为什么要加一个void在外面啊?有什么特别的讲究吗?
      

  7.   

    没有什么特别的讲究,就象文档说的,do not want the results visible to the remainder of the script在有些情形下,不用void(),你会发现页面会有问题,譬如试一下<a href="javascript:validate()">click to submit</a>
        <script language="javascript">
        function validate()
        {
    window.open("abc.html");
            //var oform1 = window.document.getElementById( "form1" );
            //oform1.submit();
    return true;
        }
        </script>
      

  8.   

    IsPostBack只是服务器控件回调的时候才触发的。
      

  9.   

    多谢老大帮助。总结一下吧:
    通过click <a>来submit form,用
    <a href="javascript:validate()"> 或者 <a href="javascript:void(validate())">通过click <a>来执行一共客户端操作,用
    <a href="javascript:void(validate())">================================================
    另外我觉得应该避免使用
    <a href="#">,不太规范
      

  10.   

    IsPostBack只是服务器控件回调的时候才触发的。