Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 27, 2012 02:56 AM by Frank Jiang - MSFT
Feb 25, 2012 04:48 AM|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 04:57 AM|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 05:04 AM|LINK
My main problem is that the new page is not showing the url address of the hyperlink.
Feb 25, 2012 05:09 AM|LINK
simple window.open() never works, you got to specify some parameters...
Feb 25, 2012 05:29 AM|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 02:56 AM|LINK