Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Opening New Window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Opening New Window

 Post Reply Post Reply
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2004 at 2:56am
Try changing the bold bit to:

onclick=""OpenNewWindow('" & DataBinder.Eval (Container.DataItem, "WebSite") & "');""
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post 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.

 

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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>"
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.