Search code examples
c#href

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?


Solution

  • You can use

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