을 클래스 내에서 사용 할 필요가 있지만 방법 않습니다왜 HttpContext.Current는 예를 들어
public partial class Product_Detail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string id = Request.QueryString["p"];
}
}
을하지만, 수업 중에 있지만 어떤 방법으로도 사용하지 않으면 다음 중 하나를 사용해야합니다.
public partial class Product_Detail : System.Web.UI.Page
{
string id = HttpContext.Current.Request.QueryString["p"];
protected void Page_Load(object sender, EventArgs e)
{
}
}
왜 그런가요?
두 코드 예제에서 모두 Page 클래스에 들어있어 혼란 스럽습니다. –
답변을 업데이트 해 주셔서 감사합니다. –