日期:2014-05-17 浏览次数:20513 次
//aspx文件中
<a id="ff" onclick="__doPostBack('this',1)" runat="server" class="buttonLink" >try</a>
//插入的html代码
<script language="javascript" type="text/javascript">
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)){
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
</script>
//cs文件中:
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack) {
int Fid=Int32.Parse(Request.Form["__EVENTARGUMENT"]);
Session["Fid"]=Fid;
Response.Redirect("SingleItem.aspx");
}
}