Last post Feb 27, 2012 03:56 AM by Frank Jiang - MSFT
Feb 25, 2012 05:48 AM|24Kev|LINK
Not done hyperlinks before.
Have page that is populated from a database.
Have a field that I want as a hyperlink.
The page shows a hyperlink and if I click the field it opens another
window showing exactly the same. That is not the destination url.
In the script section I do not know if there should be something in
the window.open(""). Seems that there should be. But what.
Many thanks any assistance.
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#"
String ArtistID = Request.QueryString["ArtistID"];
if (ArtistID == "")
Response.Write("Invalid Artist ID");
sqlcmd = new SqlCommand("select tblArtists.ArtistID, tblArtists.ArtistName, tblArtists.Origin, tblArtists.Genre,
tblArtists.WebAddress, tblAlbums.AlbumName, tblYearReleased.YearReleased from tblAlbums INNER JOIN tblArtists
ON tblAlbums.ArtistID = tblArtists.ArtistID INNER JOIN tblYearReleased ON tblAlbums.YearReleasedID = tblYearReleased.YearReleasedID
where tblArtists.ArtistID='" + ArtistID + "' order by tblYearReleased.YearReleased", sqlcon);
da = new SqlDataAdapter(sqlcmd);
if (dt.Rows.Count > 0)
TextBox1.Text = ArtistID;
TextBox2.Text = dt.Rows.ToString();
TextBox3.Text = dt.Rows.ToString();
TextBox4.Text = dt.Rows.ToString();
TextBox5.Text = dt.Rows.ToString();
HyperLink1.Text = dt.Rows.ToString();
Feb 25, 2012 05:57 AM|ramiramilu|LINK
opening a page in a new window depends on browser settings, if you configured your browser to open all new windows in new tabs, then what ever you do it really doesnt matter, all window.open() will open in new tabs..
Feb 25, 2012 06:04 AM|24Kev|LINK
My main problem is that the new page is not showing the url address of the hyperlink.
Feb 25, 2012 06:09 AM|ramiramilu|LINK
simple window.open() never works, you got to specify some parameters...
Feb 25, 2012 06:29 AM|24Kev|LINK
I have put _blank as Target in the asp:hyperlink section and left the
rest unchanged. "The sURL is loaded into a new, unnamed window. msdn site says "
All I get now is an blank window. NOT that of the site name.
Feb 27, 2012 03:56 AM|Frank Jiang - MSFT|LINK