1

Please see the code below:

tc.Attributes.Add("onclick", "this.style.backgroundColor='goldenrod'; open('ds://123','_blank','')")

tc references TableCell:https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.tablecell(v=vs.110).aspx

The code opens an application client (person: 123). However, a new Internet Explorer Window is also opened. How do I stop the new Internet Explorer window from opening?

0

1 Answer 1

2

You're explicitly asking for another window to be opened, by calling window.open.

Instead, if the ds: protocol handler will launch something else anyway, you may just want to assign to location, e.g. change

open('ds://123','_blank','')

to

location = 'ds://123';

Just check that relative links within the page still work after you've clicked that to launch the client.

If that doesn't work, create a zero-height iframe and set its src:

document.getElementById("the-iframe-id").src = "ds://123";
Sign up to request clarification or add additional context in comments.

1 Comment

'Location' has done the trick. Thanks. +1. I will accept once the time limit expires.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.