方法1:p1.InnerHtml = item;//p1是p标签的id

方法2:定义全局变量

public static string f;
protected void Button2_Click(object sender, EventArgs e)
{

foreach (string item in list)
{
f = item;//把item赋值给全局变量:
//p1.InnerHtml = item;
Response.Write(item);
string a = item;
string b = Session["demo"].ToString();
}

前台接受值<p ><%=f%></p>//(<%=f%>)接收变量的值

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-04-27
相关资源
相似解决方案