Printing from Modal Dialogs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lisa

    Printing from Modal Dialogs

    I have an aspx page that has a print button on it. The code for the
    clicked event of the print button is:

    Dim strScript As String
    strScript = "<script language='javas cript'>"
    strScript += "window.pri nt;"
    strScript += "</script>"
    Page.RegisterSt artUpScript("pi rnt", strScript)

    The aspx page above is opened using the following code from another
    aspx page:

    strScript = "var windowOptions = 'dialogHeight: 400px; dialogWidth:
    600px;
    center: yes; help: no; resizable: no; status: no;'; "
    strScript += "window.showMod alDialog(Page1. aspx, null,
    windowOptions); "

    Page.RegisterSt artUpScript("Su cessScript", "<script
    language='javas cript'>" + strScript + "</script>")

    When compiled and ran locally, the print button will envoke the Print
    dialog. If I compile the same code and run it from my server the
    button does nothing. Anyone know why and what I can do to fix this?

    It works in both places when it is not a modal dialog.
  • Martin Honnen

    #2
    Re: Printing from Modal Dialogs



    Lisa wrote:
    [color=blue]
    > I have an aspx page that has a print button on it. The code for the
    > clicked event of the print button is:
    >
    > Dim strScript As String
    > strScript = "<script language='javas cript'>"
    > strScript += "window.pri nt;"[/color]

    That should be
    strScript += "window.print() ;"



    --

    Martin Honnen

    Comment

    • RobG

      #3
      Re: Printing from Modal Dialogs

      Martin Honnen wrote:[color=blue]
      >
      >
      > Lisa wrote:
      >[color=green]
      >> I have an aspx page that has a print button on it. The code for the
      >> clicked event of the print button is:
      >>
      >> Dim strScript As String
      >> strScript = "<script language='javas cript'>"
      >> strScript += "window.pri nt;"[/color]
      >
      >
      > That should be
      > strScript += "window.print() ;"[/color]

      It should also be:

      strScript = "<script type='text/javascript'>"



      --
      Rob

      Comment

      Working...