Wasi
Wasi

Reputation: 751

How to use href to pass value on another page?

I have images which I am using to navigate to next page using href:

<a class="ajaxcolorbox" href="User.aspx">

Now I also want to pass some values so that I can display on some information depending on which image user has clicked.

Upvotes: 0

Views: 9793

Answers (2)

Pushpendra
Pushpendra

Reputation: 810

Use QueryString as Id

User.aspx?imageId=value

and read it from the next page

Upvotes: 0

nunespascal
nunespascal

Reputation: 17724

Use the query string.

<a class="ajaxcolorbox" href="User.aspx?id=<YOUR_ID>">

It is the easiest method to pass data around.

You can read it back on User.aspx as follows:

var id = Request.QueryString["id"];

Upvotes: 1

Related Questions