Dev::ASP.NET,C#

C#내부에서 Post 로 값 넘기기

bluemong 2016. 5. 19. 18:04
반응형
using System.Collections.Specialized;



// 호출

NameValueCollection data = new NameValueCollection();


data.Add("pparam1", "post_val1");

data.Add("pparam2", "post_val2");

     

HttpHelper.RedirectAndPOST(this.Page, "/Dest.aspx?param1=param1_value&param2=param2_value", data);




// 수신

string getParam1 = Request["param1"];

string getParam2 = Request["param2"];



System.Collections.Specialized.NameValueCollection postedValues = Request.Form;

          

string postParam1 = postedValues["pparam1"];

string postParam2 = postedValues["pparam2"];