I recently made a little thing and found that hyperlink Transmission Parameters in datalist are not easy to do. I have found many forums,ArticleI finally found the implementation method and posted it to everyone for sharing!
The Writing Method in the source code of the ASPX page is as follows:
<Asp: hyperlink id = "hyperlink1" runat = "server" width = "177px" navigateurl = '<% # "togoal. aspx? Id = "+ databinder. eval (container. dataitem, "ID") %> '> <% # databinder. eval (container. dataitem, "text") %> </ASP: hyperlink> </TD>
After this, I felt a little unsatisfied, because I want to open a new page, instead of redirecting from the original page.
Response. Write ("<script language = JavaScript> window. Open ('new. aspx '); </SCRIPT> ")
It is considered that the pop-up window is blocked by the browser, so you have to try other methods. Later I found that I could write it below.
<Asp: hyperlink id = "hyperlink1" runat = "server" width = "177px"> <a href = "http://www.sina.com" target = "_ blank"> <% # databinder. eval (container. dataitem, "text") %> </a> </ASP: hyperlink> </TD>
If your link address is obtained from the database, write it as follows:
<Asp: hyperlink id = "hyperlink1" runat = "server" width = "177px"> <a href = '<% # "http: //" + databinder. eval (container. dataitem, "url") %> 'target = "_ blank"> <% # databinder. eval (container. dataitem, "url") %> </a> </ASP: hyperlink> </TD>