Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Running WebDialogWindow from a button

Last post 09-02-2008 6:45 by Jesus Bosch. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-08-2008 4:42

    • collism
    • Not Ranked
    • Joined on 06-01-2008
    • Points 120

    Running WebDialogWindow from a button

    Hi Guys,

    I'm having problem getting a DiaglogWindow to appear on the click of a button. Using Vs2005, Web Project w/AJAX, CLR2.0.

    When i try and run the project i get hit with the follow message: Compiler Error Message: BC30456: 'javascript' is not a member of 'ASP.forms_firstresponse_aspx'.

    <igtxt:WebImageButton ID="cmdLookup1" runat="server" Style="left: 280px; position: absolute;

    top: 104px" TabIndex="5" Text="Lookup..." UseBrowserDefaults="False" Width="88px" OnClick="BLOCKED SCRIPT$find('WebDialogWindow1').set_WindowState($IG.DialogWindowState.Normal);">

    Could anyone advise or help me modify my code accordingly - I'm quite new to all of this. Thanks all.

     

    Joe

     

     

     

    • Post Points: 35
  • 08-08-2008 5:42 In reply to

    Re: Running WebDialogWindow from a button

    The problem is that onclick refers to the server-side event, while for client-side event we expose the ClientEvents collection. Example:

        <script type="text/javascript">
       
        function showWindow()
        {
            $find('WebDialogWindow1').set_WindowState($IG.DialogWindowState.Normal);
        }
       
        </script>
       
        <igtxt:WebImageButton ID="WebImageButton1" runat="server">
            <ClientSideEvents Click="showWindow" />
        </igtxt:WebImageButton>

     

    More information on the client-side object model (CSOM) can be found here:

    http://help.infragistics.com/NetAdvantage/NET/2008.2/CLR3.5/ 

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 35
  • 08-08-2008 8:37 In reply to

    • collism
    • Not Ranked
    • Joined on 06-01-2008
    • Points 120

    Re: Running WebDialogWindow from a button

    Thanks for the help Rumen, Now reading up.

    • Post Points: 5
  • 08-08-2008 12:04 In reply to

    • collism
    • Not Ranked
    • Joined on 06-01-2008
    • Points 120

    Re: Running WebDialogWindow from a button

    I Opened a new project just to test your example.

    Dragged an imgbutton and Scriptmanager and Weddiagwindow1 onto quick design.

     Pasted your code and it doesn't work.

     Can't eval ShowWindow(oControl, ig_FireEvent.arguments[2]);

     

    • Post Points: 20
  • 08-12-2008 9:10 In reply to

    Re: Running WebDialogWindow from a button

    That's weird, I have just tested again and it worked fine. I have created a slightly different setup for you, could you please try it. Also, please note the case sensitivity of javascript - if a method starts with small letter, the same should be reflected in its ClientSideEvents server side counterpart

        <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
       
        <script type="text/javascript">
      
        function showWindow()
        {
            $find('WebDialogWindow1').show();
        }
      
        </script>
      
        <igtxt:webimagebutton ID="WebImageButton1" runat="server" Text="Show Window" AutoSubmit="false">
            <ClientSideEvents Click="showWindow" />
        </igtxt:webimagebutton>

        <cc1:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="300px"  WindowState="Hidden"
            Width="400px">
        </cc1:WebDialogWindow>

    and this is what I am getting as a result when I click the button

     


    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 08-14-2008 10:13 In reply to

    • collism
    • Not Ranked
    • Joined on 06-01-2008
    • Points 120

    Re: Running WebDialogWindow from a button

    It works great now, thanks Rumen.

    I did have to change cc1 to ig.

     

    thanks again.

    • Post Points: 5
  • 08-16-2008 13:00 In reply to

    Re: Running WebDialogWindow from a button

    Hi,

     Is there any way to show up the dialog from the server side? for example

    Me.Page.ClientScript.RegisterClientScriptBlock(Me.Page.GetType(), "script", "ShowDialog('" & Me.WebDialogWindow1.ClientID & "');", True)

     

    This does not work, I don't understand how the dialog is rendered, but I get a javascript error: object not found. I think this is a necessary functionality, a dialog is useful when you want to apply a decision to a server side logic, for example, after a failed login or something like that.

     

    • Post Points: 20
  • 09-02-2008 1:41 In reply to

    Re: Running WebDialogWindow from a button

    Helo, Maybe you can play with the WindowState property of the control? Setting it to DialogWindowState.Hidden hides the window, setting it to Normal shows it. There are also a couple of other states - Mazimized and Minimized. protected void Page_Load(object sender, EventArgs e) { WebDialogWindow1.Modal = true; WebDialogWindow1.WindowState = DialogWindowState.Normal; } Will this work in your case?
    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 09-02-2008 6:45 In reply to

    Re: Running WebDialogWindow from a button

    yes, it works fine.

     

    Thanks

    • Post Points: 5
Page 1 of 1 (9 items)
Powered by Community Server (Commercial Edition), by Telligent Systems