<%@ Page Language="C#" %> <form id="f" runat="server"> <% var v = Request.Form["x"]; if (!IsPostBack) { %> <input name="x" /><input type="submit" /> <% } else if (v != null) { Session["x"] = v; %> <a href="javascript:f.submit()">click here</a> <% } else { %>you said: <%=Session["x"]%><% } %></form>