| Author |
Topic Search Topic Options
|
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Topic: Opening New Window Posted: 11 November 2004 at 2:15am |
I used the following code:
<%# IIF(FieldValueIsMissing(Databinder.Eval(Container.DataItem, "WebSite")), "", "<a href=''onclick='OpenNewWindow(""" & DataBinder.Eval (Container.DataItem, "WebSite") & """)'>Go To Web Site</a>")%>
There's a problem with the bolded part. This is strange, but it shows the web site address that it is on instead of the actual web site address that comes from the database. For example, if this listing is on http://www.webwiz.net/forum.asp, it will show http://www.webwiz.net instead of the web site address from the database. Let's say that the web site address from the database is http://www.yourwebsite.com. It will not show that web site address. Can someone please help me with this?
Edited by Misty
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 November 2004 at 2:56am |
|
Try changing the bold bit to:
onclick=""OpenNewWindow('" & DataBinder.Eval (Container.DataItem, "WebSite") & "');""
|
 |
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 November 2004 at 4:42pm |
|
I tried <%# IIF(FieldValueIsMissing(Databinder.Eval(Container.DataItem, "WebSite")), "", "<a href=onclick=""OpenNewWindow('" & DataBinder.Eval (Container.DataItem, "WebSite") & "');""Go To Web Site</a>")%>. It will not show the web site address anymore. The web site address exists. Can someone please help me with this?
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 November 2004 at 4:58pm |
|
try what I said...
you are going <A href=onclick="..."> which is not how you do
it... btw If you only want to open it in a new window why don't
you just use target="_black" on the hyperlink tag?
|
 |
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 November 2004 at 5:16pm |
I tried using "<a href="target="_black" & DataBinder.Eval (Container.DataItem, "WebSite") & "'>Go To Web Site</a>")%>, but it would not work. I am lost on this. I am still getting used to the syntax in ASP.net.
I just want to be able to open the web site that comes from the database in a new window.
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 November 2004 at 5:33pm |
|
eek partly my fault for mis spelling blank but it should be
<a href="http://www.yoururl.com" target="_blank">Your Text</a>
so you would need
"<a href=""" & DataBinder.Eval (Container.DataItem, "WebSite") & """ target="_blank">Go to website</a>"
|
 |
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 November 2004 at 1:02pm |
|
I had to use <%# IIF(FieldValueIsMissing(Databinder.Eval(Container.DataItem, "WebSite")), "", "<a href='" & DataBinder.Eval (Container.DataItem, "WebSite") & "' target='_blank'>Go to website</a>")%> to get it working.
|
 |