How to move text from one web form text box to ano

2019-09-12 09:12发布

I'm trying to load text from one text box in my Admin Web Form, to my Home Page web form text box

I have tried this code but I literally can not get it working since my admin class will not detect the control from the other web form..

1条回答
太酷不给撩
2楼-- · 2019-09-12 09:42

You can use Session variables to transfer text (or data) from one page to another.

In the source page, you save the data in the Session variable:

Session["HomeText"] = txtHomeEntry.Text;

In the destination page, you load the save text:

txtHome.Text = (string)Session["HomeText"];

You can use additional Session variables (e.g. Session["AboutUs"]) to transfer the other data.

查看更多
登录 后发表回答