Dialogs in ASP.NET using server-side-blocked-calls

Last post 09-28-2006 6:04 AM by inchl. 0 replies.

Sort Posts:

  • Dialogs in ASP.NET using server-side-blocked-calls

    09-28-2006, 6:04 AM
    • Loading...
    • inchl
    • Joined on 04-14-2006, 5:45 PM
    • Posts 6
    Hi,

    I have created a true MVC-pattern for ASP.NET that allows dialogs windows in ASP.NET just like you would do when using WinForms. I am using a technique called server-side-blocked calls (server-side AJAX).
    On my website there are four demos online and also a recording of a live-coding-example (executable desktoprecording).

    The framework is freeware and is currently being applied in several projects.

    For more information visit http://www.inchl.nl

     

    Here is a code sample of a small demo that contains:

    1. A page containing a button and a textbox. The button shows a searchwindow. The search result is put into the textbox when the searchwindow closes.

    2. A page representing the search window containing two buttons and a textbox. The first button cancels the window, the second button confirms the window and returns the text in the textbox as the search result.

    This demo currently runs on my website (http://www.inchl.nl/FrameworkDemo4)

     

     *** The code for the page ***

     1    using Business = inchl.Framework.Business;
     2    using Web = inchl.Framework.Web;
     3   
     4    public partial class _Default : Web.PageBase
     5    {
     6        protected void Page_Load(object sender, EventArgs e)
     7        {
     8        }
     9   
    10        // this method start the search window
    11        protected void Button1_Click(object sender, EventArgs e)
    12        {
    13            // create search window
    14            Business.Window mySearchWindow = new Business.Window("MySearchWindow");
    15            // show seach window using closed-handler
    16            mySearchWindow.ShowDialog(new Business.Window.EventHandler(SearchWindowClosed));
    17        }
    18   
    19        // this method is being called when search window closes.
    20        private void SearchWindowClosed(object sender, Business.Window.EventArgs e)
    21        {
    22            // check if window was closed succesfully (button ok)
    23            if ((bool)e.Window.DialogResult == true)
    24                // yes, then put search result into textbox
    25                TextBox1.Text = e.Window["MySearchResult"].ToString();
    26        }
    27    }

     

    *** the code for the search window ***

     1    using Business = inchl.Framework.Business;
     2    using Web = inchl.Framework.Web;
     3   
     4    [Web.RegisterGUI(Name = "MySearchWindow")]
     5    [Web.RegisterWindow(Width = 640, Height = 480, Title = "Search window...")]
     6    public partial class MySearchWindow : Web.PageBase
     7    {
     8        protected void Page_Load(object sender, EventArgs e)
     9        {
    10        }
    11   
    12        // this method closes the window (cancel)
    13        protected void ButtonCancel_Click(object sender, EventArgs e)
    14        {
    15            this.Window.DialogResult = false;
    16        }
    17   
    18        // this method closes the window (ok)
    19        protected void ButtonOk_Click(object sender, EventArgs e)
    20        {
    21            this.Window["MySearchResult"] = TextBox1.Text;
    22            this.Window.DialogResult = true;
    23        }
    24    }

     

    The framework has solved many problem for me..... it real cool.... and it free!!!     Please contact me for more information.

    Kind regards,

    Stephan Smetsers

    http://www.inchl.nl

Page 1 of 1 (1 items)
Microsoft Communities
Page view counter