简体   繁体   中英

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?

You can use

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

你可以使用它

Request.QueryString["album"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM