java script function in .net function

Dear All,

I€™m trying to open up a window with a form in it, but first I need to make sure that the user checked at least one or more item on a list with checkboxes in each row on the page where I push the button to open the window from.

I use the following simple code:

Public Sub btnLog_onClick(ByVal sender As System.Object, ByVal e As System.EventArgs)

 

        Dim myCsv = getTickedItems(1)

        If myCsv = "" Then

            Exit Sub

        Else

            Dim myUrl As String

            Response.Write("")

        End If

    End Sub

The only problem is, the pop up is not focused on and I can€™t get it to be focused on. Can someone tell me how to fix this?

0
gorgenyi
4/6/2006 4:11:13 PM
📁 asp.net.client-side
📃 24353 articles.
⭐ 2 followers.

💬 6 Replies
👁️‍🗨️ 1316 Views

Try using RegisterStartupScript("OpenerScript", "your script goes here") instead of Response.Write

NC...

0
NC01
4/6/2006 6:43:29 PM

Thanks for suggestion, but that doesn€™t seem to work either.

I put windows.focus() in the pop up, but it's still not great as the pop up appears, disappears, then gets focused on. Bit clumsy

0
gorgenyi
4/7/2006 12:51:20 PM

You might look at this as it's a complete sample using window.open that refreshes the parent window when closed.
     http://forums.asp.net/1241427/ShowThread.aspx#1241427

NC...

0
NC01
4/7/2006 2:07:28 PM

hi

javascript write in aspx page

in backend file write this

public dim myUrl As String

Dim myCsv = getTickedItems(1)

        If myCsv = "" Then

            Exit Sub

        Else

buttonID.attributes['onclick']="return OpenPage();"         

        End If

    End Sub

 


Warm Regards,

Jayu.
Impossible Is Nothing
0
jayu
4/11/2006 5:11:19 AM

Which is exactly what is detailed out in the link that I posted, except it shows 2 different ways to open the child -- 1. Before the PostBack (as Jayu posted) and 2. After the PostBack in case you need to do something server-side before opening the window.

NC...

 

0
NC01
4/11/2006 11:42:28 AM
Hi,

Thanks, I'll have a look at these

Yes I need to check if any and which checkboxes are checked within a dataGrid before I open the pop up as users must not be able to open the pop up unless they have ticked at least item, plus I need the pop up to know the ids of the checkboxes in order for them to be processed on the form on the pop up.

What I have works, only the pop up doesnt get focused on, whihc is very irritating.
0
gorgenyi
4/11/2006 5:05:58 PM