get post 提交

<% @ Page Language = " C# "  AutoEventWireup = " true "  CodeFile = " Default4.aspx.cs "  Inherits = " Default4 "   %>

<! DOCTYPE html PUBLIC  " -//W3C//DTD XHTML 1.0 Transitional//EN "   " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >

< html xmlns = " http://www.w3.org/1999/xhtml "   >
< head runat = " server " >
    
< title > 无标题页 </ title >
</ head >
< body >
    
< form action = " Default4.aspx "  method = " get " >  
  
< input TYPE = " text "  name = " Text "  VALUE = " Hello get " ></ input >  
  
< input TYPE = " submit "  VALUE = " method=Get " ></ input >  
  
</ form >  
  
< BR >  
  
< form action = " Default4.aspx "  method = " post " >  
  
< input TYPE = " text "  name = " Text "  VALUE = " Hello Post " ></ input >  
  
< input TYPE = " submit "  VALUE = " method=Post " ></ input >  
  
</ form >  
  
< br  />
  
<%   if ( ! string .IsNullOrEmpty(Request.QueryString[ " Text " ])) { %>  
  通过get方法传递来的字符串是:
<%=  Request.QueryString[ " Text " %>
  
<%  } %>  
  
< br  />
  
<%   if ( ! string .IsNullOrEmpty(Request.Form[ " Text " ])) { %>  
  通过Post方法传递来的字符串是:
<%=  Request.Form[ " Text " %>
  
<% } %>  
</ body >
</ html >

你可能感兴趣的:(post)