Results 1 to 7 of 7

Thread: Pop Up window

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Pop Up window

    Hi!

    I am working on an application. I am using ASP.net with VB.Net as code behind.

    I am coding in the code behind page to display some links (the text of which comes from the table).

    heres the code,

    VB Code:
    1. Dim r As TableRow
    2.        Dim c As TableCell
    3.        Dim Hyp As HyperLink
    4.  
    5.                 c = New TableCell
    6.                 Hyp = New HyperLink
    7.                 Hyp.NavigateUrl = "Address.aspx?OmniId=" & OmniId & "&SubOffId= " & SubOffID
    8.                 Hyp.Text = Address
    9.                 c.Controls.Add(Hyp)
    10.                 r.Cells.Add(c)
    11.  
    12.                 tblDetails.Rows.Add(r)
    13.             Next j
    14.         End If
    15.         '**************************************
    See that I am making hyperlink with the code:
    VB Code:
    1. Hyp = New HyperLink
    2.                 Hyp.NavigateUrl = "Details.aspx?OmniId=" & OmniId & "&SubOffId= " & SubOffID
    3.                 Hyp.Text = Address

    But, I want to open the subsequent page as a popup (Details.aspx). How to achieve that??
    Thanks.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: Pop Up window

    This is the code:

    VB Code:
    1. Dim r As TableRow
    2. Dim c As TableCell
    3. Dim Hyp As HyperLink
    4.  
    5. c = New TableCell
    6. Hyp = New HyperLink
    7. Hyp.NavigateUrl = "Details.aspx?OmniId=" & OmniId & "&SubOffId= " & SubOffID
    8. Hyp.Text = Address
    9. c.Controls.Add(Hyp)
    10. r.Cells.Add(c)
    11.  
    12. tblDetails.Rows.Add(r)

    Hyp.NavigateUrl opens Details.aspx as another page. I want it as a pop up ( a new browser window).
    Thanks.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: Pop Up window

    I figured it out....its done through..

    Hyp.Target = "_blank"

    after the Hyp.NavigateUrl

    But, can I adjust the size of the new browser window?
    Thanks.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: Pop Up window

    Can it be done using Javascript?
    Thanks.

  5. #5
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Pop Up window

    window.open('daWindow', url, 500, 500);
    Magiaus

    If I helped give me some points.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: Pop Up window

    I know the javascript function? My problem is how to call the javascript function from the link, i have made in the code behind.

    Had I to call the function from the click of a button, I would have used this code

    bt.Attributes.Add("onclick", "return OpenWindow();")

    Will it work in case of a link also?
    Thanks.

  7. #7
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Pop Up window

    Code:
    href="javascript:popWindow();"
    Magiaus

    If I helped give me some points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width