Reputation: 1
We have a HTML page(suppose links.html) with many links. When I click on certain link it redirects me to new HTML page(for one link one new html page) and data related to that link will be displayed on that new html page from SQL server. Now coming to our requirement we need to create a new single .aspx
page which should display the data from SQL server dynamically based on the link which we click on the links.html
page.
My questions are:
Should I change the code of links.html page onclick
event so that it can re-direct me to new .aspx
page?
How can I pass the value of particular link on link.html page to new .aspx page so that it displays that selected link data?
Upvotes: 0
Views: 227
Reputation: 34846
The two most common solutions to this problem are:
Query string parameters
Pros:
Cons:
Customer
class objects).In-process session state variables
Pros:
Customer
objects.Cons:
Upvotes: 0
Reputation: 17637
You can pass information using the Query String, for example:
On your HTML:
<a href="MyPage.aspx?linkID=9">Goto page 9</a>
Then in your ASPX code behind:
protected void Page_Load(object sender, EventArgs e)
{
String linkID = Request.QueryString["linkID"];
}
Upvotes: 1