프로그램/c# asp.net tip

aspx 에서 Post 방식 페이지 호출

뭉치냐옹 2009. 2. 25. 19:06

Set  - form 태그의 runat="server" 제거

<form id="form1" action="Default2.aspx" method=post>
    <div>
        Default.aspx<br />
        <br />
        <input id="txtName" type="text" name="txtName" />
        <input id="Pwd" type="text" name="Pwd"/><br />
        <input type=hidden id=txtTest name=txtTest value="000" />
        <input id="btnSend" type=submit value="button"/></div>
    </form>

 

 

Get - 코드비하인드에서 받음

    protected void Page_Load(object sender, EventArgs e)
    {
        string strName = Request.Form["txtName"].ToString();
        string strTest = Request.Form["txtTest"].ToString();
        string Name = Request.Form["Pwd"];
    }