in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

opening a webdialog by clicking on image

Last post 12-23-2007 11:43 PM by C1_SergeiS. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-27-2007 10:46 AM

    opening a webdialog by clicking on image

    Hi,

      I am trying to open a web dialog when the user clicks on the image. It is showing the web dialog for few seconds and it is closing them again.

     

    Following is the code I am using to show the webdialog

    // image control 

    <input type="image" onclick="showReports('<%= Request.ApplicationPath %>/Reports/MyRptViewer.aspx')" value="Export to Crystal" />

    // javascript

    function showReports(link)

    {

    var dialog = $get("C1WebDialog1").control;

    dialog.setUrl(link);

    dialog.show();

    }

    Please let me know if I am doing anything wrong.

    Thanks,

    sridhar.

  • 12-04-2007 1:33 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 483

    Re: opening a webdialog by clicking on image

    The problem is the main page is being refreshed when you click on an image.  You can get around this by putting the image in an UpdatePanel so the whole page doesn't refresh and close the dialog.

    Hope that helps,
    Greg L

    Filed under: ,
  • 12-23-2007 11:43 PM In reply to

    Re: opening a webdialog by clicking on image

    Hi,
     
    try to replace
     
    onclick="showReports('<%= Request.ApplicationPath %>/Reports/MyRptViewer.aspx')"
     
    with
     
    onclick="showReports('<%= Request.ApplicationPath %>/Reports/MyRptViewer.aspx'); return false"
     
    Regards,
    Sergey.
    <DATISDEVELOPMENT> wrote in message news:199930@10.0.1.98...

    Hi,

      I am trying to open a web dialog when the user clicks on the image. It is showing the web dialog for few seconds and it is closing them again.

     

    Following is the code I am using to show the webdialog

    // image control 

    <input type="image" onclick="showReports('<%= Request.ApplicationPath %>/Reports/MyRptViewer.aspx')" value="Export to Crystal" />

    // javascript

    function showReports(link)

    {

    var dialog = $get("C1WebDialog1").control;

    dialog.setUrl(link);

    dialog.show();

    }

    Please let me know if I am doing anything wrong.

    Thanks,

    sridhar.



    http://helpcentral.componentone.com/cs/forums/p/73654/199930.aspx#199930

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.