PopUP Window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalini166
    New Member
    • Apr 2008
    • 70

    PopUP Window

    Hi

    Anyone help me.I need a popup window when i click button.


    When i click button it show the popup window with employee code from database table.

    I used ASP.net(C#) with sqlserver


    Pls help me
    Its urgent for my project.


    Regards
    Shalini
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Any popups would have to be created with a client side script, not ASP.NET. ASP.NET runs on the server. To get the javascript you need to create a popup window, try here (first google result for javascript popup window).

    What you should do is create the page that you want to appear in the popup window. Have it use a querystring (Request.QueryS tring["key"];) to pass on the key value(s) to select against from your database table.\

    Originally posted by shalini166
    Hi

    Anyone help me.I need a popup window when i click button.


    When i click button it show the popup window with employee code from database table.

    I used ASP.net(C#) with sqlserver


    Pls help me
    Its urgent for my project.


    Regards
    Shalini

    Comment

    • shalini166
      New Member
      • Apr 2008
      • 70

      #3
      Thank u very much for ur reply.

      I got the window.Onpage load of the popwindow i load employee id.I want to select the id from the pop up window ,based on the id all the details of that particular id will display in lots textbox.


      I want to know how to select item from the popup window.

      pls help me.

      Comment

      • kunal pawar
        Contributor
        • Oct 2007
        • 297

        #4
        do you mean, you want to take value from Child window ?

        Comment

        • shalini166
          New Member
          • Apr 2008
          • 70

          #5
          yes In my child window there is one list box containing employee id.when i select any one employee id from child window,it should display in my parent window.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Originally posted by shalini166
            Hi

            Anyone help me.I need a popup window when i click button.


            When i click button it show the popup window with employee code from database table.

            I used ASP.net(C#) with sqlserver


            Pls help me
            Its urgent for my project.


            Regards
            Shalini
            You need to apply JavaScript to the button so that it opens the ASPX page that displays your employee in a new window.

            The JavaScript to do this is the following:
            [code=javascript]
            window.open("na meOfAspxPage.as px","nameOfWind ow", "toolbar=yes,me nubar=yes, width=980, height=700, resizable=yes,s crollbars=yess" )
            [/code]


            You need to call this JavaScript code on the Client Side onclick event.
            So you need to add it to your button's attributes:

            VB:
            [code=vbnet]
            theButtonThatOp ensTheWindow.At tributes.Add("o nclick","JavaSc ript:window.ope n("""+"nameOfAs pxPage.aspx"""+ ","""+"nameOfWi ndow"""+", """+"toolbar=ye s,menubar=yes, width=980, height=700, resizable=yes,s crollbars=yes"" "+"); return false;")
            [/code]

            C#:
            [code=vbnet]
            theButtonThatOp ensTheWindow.At tributes.Add("o nclick","JavaSc ript:window.ope n(\"nameOfAspxP age.aspx\",\"na meOfWindow\", \"toolbar=yes,m enubar=yes, width=980, height=700, resizable=yes,s crollbars=yes\" ); return false;")
            [/code]

            Please note that I added a "return false" after the window.open() method call. This prevents the ASPX button from posting back to the server.

            Cheers

            -Frinny

            Comment

            Working...