MoOoG
MoOoG

Reputation: 303

asp.net c# how to get value from href?

I have a page MojiAlbumi.aspx where is this line of code: href='Album.aspx?album="+id_galerija +"'

On click, you get redirected to Album.aspx where i'd like to access to the value written in the link "Album.aspx?album='xxx'". How could I do that if it's possible to save it in some string?

Is it only possible with getting link and spliting it with regex?

Upvotes: 0

Views: 2069

Answers (2)

Rajeev Kumar
Rajeev Kumar

Reputation: 4963

You can get it using

Request.QueryString["album"]

Upvotes: 1

Ozan Deniz
Ozan Deniz

Reputation: 1087

You can use

HttpContext c = HttpContext.Current;
string album = c.Request["album"];

Upvotes: 1

Related Questions