Assume that i have 2 .aspx page (From.aspx and To.aspx)
and i have a hyperlink control inside the From.aspx which navigate to To.aspx and i used javascript to open a new window..

so now i have a Label inside From.aspx which have text = 1000. and i want pass it to To.aspx label value and to display. how can i do that? i've tried so many ideas with my reasearch, but i still can't work with it.

Recommended Answers

All 4 Replies

You can pass it as a query string in the URL. The. On the receiving page use the server.querystring collection to retrieve the value.

could you show me a simple example?
i've tried using PostBackUrl attribute and PreviousPage.FindControl() but is still can't work. :/

I am not clear on what you are doing on the from page, but you need to build the hyperlink so that it contains the query string parameter and value. For example,

yourDomain.com/to.aspx?q=1000

Then on the to.aspx page you can retrieve that value in the page load subroutine.

Vb example.

Label1.text = request.querystring("q")

You can also pass values from page to page if the source page is using a form. On the receiving page you can use request.form() to retrieve the values.

i've solved the problem by using cookie method and globa method :) Thanks anyway.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.