1

I am a beginner in using ASP.NET and JavaScript. I've stumbled upon this problem:

  1. In my page1.aspx, I use Response.Redirect("page1.aspx#download") using an anchor.
  2. Now, I want to get the Request.QueryString upon loading on the client side using JavaScript.

Can someone help me with this?

4

1 回答 1

0

page1.aspx#下载

根据上述声明,您将无法在其他页面上以文本形式获取此下载。你需要像这样声明它

page1.aspx?Value=下​​载

在 page1.aspx 服务器端,您需要通过调用来获取值

lblText.Text = Request.QueryString["Value"];

lblText 在此页面的客户端将是 asp:label ,您可以在页面加载时调用它,以便显示您的值。

于 2022-01-10T17:15:27.660 回答