私は背後に、次のコードを持っている:あるページから別のページにパラメータを渡すにはどうすればよいですか?
public partial class _Default : System.Web.UI.Page
{
List<GlassesCollection> gc= BL.Example.GetCategory() ;
protected void Page_Load(object sender, EventArgs e)
{
rpt1.DataSource = gc;
rpt1.DataBind();
}
protected void rpt1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Button btn = (Button)e.Item.FindControl("btn1");
btn.CommandArgument = DataBinder.Eval(e.Item.DataItem,"CollectionID").ToString();
}
}
私は別のASPX.CSファイルに配置ラベルのイベントにbtn.CommandArgumentのコンテンツを渡したいです。 これを実装する方法はありますか? ありがとうございます!
上のQueryStringを読んで、他のページにパラメータを渡す方法の多くは、GET経由で送信し、そこにありますメソッド "?param = value&param2 = value2"などを使用したり、セッションオブジェクトまたはアプリケーションオブジェクトに格納したり、静的クラス/オブジェクトを使用してページから渡すパラメータを格納することさえできます。実装は基本的には、作業するアプリケーションのアーキテクチャに依存します。 – Afshin
クロスページの投稿がオプションの場合は、次のページをご覧ください:http://stackoverflow.com/questions/8747946/what-is-the-best-method-to-retrieve-the-post-value-on-another -page-in-asp-net-4/8748657#8748657 –