<%@ Import Namespace="System.Data" %>

<asp:HiddenField ID="hfOrdinaryType" runat="server" />

 

<script type="text/javascript">

function onClickReg()

{

  document.getElementById("<%=hfOrdinaryType.ClientID%>").value=type.toString();

}
</script>

 

 

<!--ajax-->

web.config

<httpHandlers>

        <add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
</httpHandlers>

<script type="text/javascript">

function onClickReg()

{

  Soft_NewGroup.SetHfType(1,type);

}
</script>

public partial class Soft_NewGroup : WebBasePage
{

protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            //注册Ajax类型
            Ajax.Utility.RegisterTypeForAjax(typeof(Soft_NewGroup));
        }
 
    }

[Ajax.AjaxMethod()]
    public void SetHfType(int id,int iType)
    {
        if (id == 1)
            hfOrdinaryType.Value = iType.ToString();
        else if (id == 2)
            hfSpontaneousType.Value = iType.ToString();
        else
            hfFixedType.Value = iType.ToString();
    }

}

相关文章:

  • 2021-07-13
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2021-07-27
  • 2021-10-21
  • 2022-12-23
  • 2021-09-25
  • 2021-12-10
相关资源
相似解决方案