1

I am designing an ASP.Net chat application. I have an online user list which are LinkButtons in a ListView. I want to click one of them and open a pop-up window. How can I do that?

1 Answer 1

1

Set your LinkButtons so they have an onclick attribute that opens a popup window.

Codebehind:

Dim username as String = "foo"
lnkbtn.Attributes.Add("onClick", "javascript:openWindow(" & username & ");return false;")
'The "return false" part is important - it stops the LinkButton from doing a postback.

Client-side:

function openWindow(username) {
    window.open(my_url + username); //Where my_url is the URL that you want to open.
}

username is just there as an example of how you can pass values through to Javascript.

Sign up to request clarification or add additional context in comments.

Comments

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.