[CLOSED] [1.0] Ext.Msg.Show Code behind

  1. #1

    [CLOSED] [1.0] Ext.Msg.Show Code behind

    I have a Window that pops up with a Accept and Decline button. When the Decline button is clicked, it does some processing and database updating on the backend.

    If the database fails to update, I want to show a MessageBox with the error. However, no matter what I have tired, I've had no luck showing the MessageBox.


    <ext:Window ID="wDecline" runat="server" Title="Decline?" Icon="Delete" Modal="true" Resizable="false" Layout="Fit" Width="300" Height="250">
            <ext:Label runat="server" Text="Stuff here" />
            <ext:Button ID="bDecline" runat="server" Text="Decline" Icon="Delete">
                    <Click OnEvent="bDecline_Click" />
            <ext:Button ID="bAbort" runat="server" Text="Abort" Icon="Reload">
                    <Click Handler="wDecline.hide();" />

    protected void bDecline_Click(object sender, DirectEventArgs e)
        Exception error = null;
            // Do database stuff here
        catch(Exception ex)
            error = ex;
        if (error != null)
            // TODO: Want to show Ext.Messagebox from here with the error.
            // I have tried AddScript, etc. with no luck
  2. #2

    RE: [CLOSED] [1.0] Ext.Msg.Show Code behind


    Did you try X.Msg class?

    Please see examples from Examples Explorer

  3. #3

    RE: [CLOSED] [1.0] Ext.Msg.Show Code behind

    Here's a full X.Msg.Alert sample.


    <%@ Page Language="C#" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <script runat="server">
        protected void Button1_Click(object sender, DirectEventArgs e)
            X.Msg.Alert("Server Time", DateTime.Now.ToString()).Show();
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Ext.NET Example</title>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Button runat="server" Text="Submit" OnDirectClick="Button1_Click" />
    X.Msg.Notify is also a handy option to play with.

    Geoffrey McGill
  4. #4

    RE: [CLOSED] [1.0] Ext.Msg.Show Code behind

    The key point to remember with the X.Msg related Methods is to ensure you call .Show().

    Geoffrey McGill
  5. #5

    RE: [CLOSED] [1.0] Ext.Msg.Show Code behind

    Hey, this worked!

    Thanks guys!
  6. #6

    RE: [CLOSED] [1.0] Ext.Msg.Show Code behind

    As well, the X.Msg is just an alias for the full MessageBox class, which you can instantiate an instance of directly if you wish.


    protected void Button1_Click(object sender, DirectEventArgs e)
        var msg = new MessageBox();
        // do something....
        msg.Alert("Server Time", DateTime.Now.ToString());
        // do something else...
    Hope this helps.

    Geoffrey McGill

Similar Threads

  1. [CLOSED] problem show TableLayout from code behind
    By tactime10 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 05, 2011, 1:15 PM
  2. [CLOSED] Window Created in Code Behind does not show
    By sisa in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 09, 2011, 3:13 PM
  3. Replies: 3
    Last Post: May 26, 2011, 8:02 AM
  4. Which control can show html code?
    By nixjojo in forum 1.x Help
    Replies: 2
    Last Post: Sep 30, 2010, 10:36 AM
  5. ext:window.Show from VB code behind
    By Groovepoets in forum 1.x Help
    Replies: 1
    Last Post: Jun 22, 2009, 3:43 PM

Posting Permissions