You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(204) |
Dec
(147) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(52) |
Feb
(33) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Argiris K. <be...@us...> - 2005-12-11 17:42:17
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1579/Docs Modified Files: Changelog.html Log Message: Fixed a bug of MagicAjaxConfiguration when its properties are changed by code and made a change that reduces the GetState string. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Changelog.html 11 Dec 2005 01:53:54 -0000 1.10 --- Changelog.html 11 Dec 2005 17:42:03 -0000 1.11 *************** *** 58,61 **** --- 58,63 ---- <ul> <li> + Fixed a bug of MagicAjaxConfiguration when its properties are changed by code + <LI> The 'AjaxCallObject.js.aspx' external script request is now cached by the browser |
From: Argiris K. <be...@us...> - 2005-12-11 17:17:43
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29708/Docs Modified Files: Configuration.html Log Message: Corrected a mistake. Index: Configuration.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Configuration.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Configuration.html 27 Nov 2005 17:30:00 -0000 1.2 --- Configuration.html 11 Dec 2005 17:17:35 -0000 1.3 *************** *** 137,141 **** if ( !IsPostBack ) { ! MagicAjaxContext.Current.Configuration.PageStore = MagicAjax.Configuration.PageStoreMode.Session; } }</pre> --- 137,141 ---- if ( !IsPostBack ) { ! MagicAjaxContext.Current.Configuration.PageStore.Mode = MagicAjax.Configuration.PageStoreMode.Session; } }</pre> |
From: Argiris K. <be...@us...> - 2005-12-11 01:54:08
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11909/Docs Modified Files: Changelog.html Log Message: Minor update. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Changelog.html 10 Dec 2005 03:23:17 -0000 1.9 --- Changelog.html 11 Dec 2005 01:53:54 -0000 1.10 *************** *** 54,58 **** <p class="header" align="center">MagicAjax.NET Framework</p> <P class="header" align="center">Change Log</P> ! <P class="MainHeader" align="left">v0.2.2 (10 December 2005) - Maintenance Release</P> <p>Changes since 0.2.1</p> <ul> --- 54,58 ---- <p class="header" align="center">MagicAjax.NET Framework</p> <P class="header" align="center">Change Log</P> ! <P class="MainHeader" align="left">v0.2.2 (11 December 2005) - Maintenance Release</P> <p>Changes since 0.2.1</p> <ul> |
From: Argiris K. <be...@us...> - 2005-12-10 03:23:28
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26315/Core Modified Files: MagicAjaxModule.cs Log Message: The 'AjaxCallObject.js.aspx' external script request is now cached by the browser. Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** MagicAjaxModule.cs 5 Dec 2005 18:44:31 -0000 1.39 --- MagicAjaxModule.cs 10 Dec 2005 03:23:17 -0000 1.40 *************** *** 417,420 **** --- 417,421 ---- } context.Response.Write(cachedAjaxCallObjectJs); + context.Response.Cache.SetExpires(DateTime.Now.AddYears(1)); context.Response.End(); } |
From: Argiris K. <be...@us...> - 2005-12-10 03:23:28
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26315/Docs Modified Files: Changelog.html Log Message: The 'AjaxCallObject.js.aspx' external script request is now cached by the browser. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Changelog.html 10 Dec 2005 02:40:35 -0000 1.8 --- Changelog.html 10 Dec 2005 03:23:17 -0000 1.9 *************** *** 58,61 **** --- 58,64 ---- <ul> <li> + The 'AjaxCallObject.js.aspx' external script request is now cached by the + browser + <LI> Changed the MagicAjax.Configuration.PageStore struct to class <LI> |
From: Argiris K. <be...@us...> - 2005-12-10 02:40:44
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20134/Docs Modified Files: Changelog.html Log Message: Changed PageStore struct to class. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Changelog.html 9 Dec 2005 17:51:02 -0000 1.7 --- Changelog.html 10 Dec 2005 02:40:35 -0000 1.8 *************** *** 54,61 **** <p class="header" align="center">MagicAjax.NET Framework</p> <P class="header" align="center">Change Log</P> ! <P class="MainHeader" align="left">v0.2.2 (9 December 2005) - Maintenance Release</P> <p>Changes since 0.2.1</p> <ul> <li> Now AjaxPanel takes into account the changes made to form elements by the user and updates their values when necessary --- 54,63 ---- <p class="header" align="center">MagicAjax.NET Framework</p> <P class="header" align="center">Change Log</P> ! <P class="MainHeader" align="left">v0.2.2 (10 December 2005) - Maintenance Release</P> <p>Changes since 0.2.1</p> <ul> <li> + Changed the MagicAjax.Configuration.PageStore struct to class + <LI> Now AjaxPanel takes into account the changes made to form elements by the user and updates their values when necessary |
From: Argiris K. <be...@us...> - 2005-12-10 02:34:21
|
Update of /cvsroot/magicajax/magicajax/Core/Configuration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18969/Core/Configuration Modified Files: MagicAjaxConfiguration.cs Log Message: Made PageStore class instead of struct. Index: MagicAjaxConfiguration.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Configuration/MagicAjaxConfiguration.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MagicAjaxConfiguration.cs 25 Nov 2005 21:41:27 -0000 1.9 --- MagicAjaxConfiguration.cs 10 Dec 2005 02:34:12 -0000 1.10 *************** *** 21,25 **** } ! public struct PageStore { #region Private Fields --- 21,25 ---- } ! public class PageStore { #region Private Fields |
From: Argiris K. <be...@us...> - 2005-12-09 21:15:08
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10042 Modified Files: Readme.html Log Message: Updated the domain for MagicAjax's homepage. Index: Readme.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Readme.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Readme.html 29 Nov 2005 09:56:32 -0000 1.4 --- Readme.html 9 Dec 2005 21:14:54 -0000 1.5 *************** *** 78,82 **** <p class="MainHeader" align="left">Keeping Up To Date</p> <p align="left">The best place to keep up to date with developments on MagicAjax is ! the <a href="http://www.magicajax.gr">Official Web Site</a>. From there you can download the latest source code. You can choose between keeping bang up to date with CVS (Concurrent Versioning System) or by just getting the regularly --- 78,82 ---- <p class="MainHeader" align="left">Keeping Up To Date</p> <p align="left">The best place to keep up to date with developments on MagicAjax is ! the <a href="http://www.magicajax.net">Official Web Site</a>. From there you can download the latest source code. You can choose between keeping bang up to date with CVS (Concurrent Versioning System) or by just getting the regularly *************** *** 84,88 **** <p class="MainHeader" align="left">Getting Support</p> <p align="left">Please use our extensive forums if you need help or think you may ! have found a bug. Go to the <A href="http://www.magicajax.gr">main web site</A> and click on the Forums link.</p> <p class="MainHeader" align="left">Licensing</p> --- 84,88 ---- <p class="MainHeader" align="left">Getting Support</p> <p align="left">Please use our extensive forums if you need help or think you may ! have found a bug. Go to the <A href="http://www.magicajax.net">main web site</A> and click on the Forums link.</p> <p class="MainHeader" align="left">Licensing</p> |
From: Argiris K. <be...@us...> - 2005-12-09 18:06:37
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32099 Modified Files: AssemblyInfo.cs Log Message: Set version to 0.2.2 Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AssemblyInfo.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AssemblyInfo.cs 29 Nov 2005 09:56:32 -0000 1.5 --- AssemblyInfo.cs 9 Dec 2005 18:06:25 -0000 1.6 *************** *** 36,40 **** // by using the '*' as shown below: ! [assembly: AssemblyVersion("0.2.1.*")] // --- 36,40 ---- // by using the '*' as shown below: ! [assembly: AssemblyVersion("0.2.2.*")] // |
From: Argiris K. <be...@us...> - 2005-12-09 17:51:12
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27277 Modified Files: Changelog.html Log Message: Updated ChangeLog for the 0.2.2 release. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Changelog.html 9 Dec 2005 01:24:00 -0000 1.6 --- Changelog.html 9 Dec 2005 17:51:02 -0000 1.7 *************** *** 54,58 **** <p class="header" align="center">MagicAjax.NET Framework</p> <P class="header" align="center">Change Log</P> ! <P class="MainHeader" align="left"> </P> <p>Changes since 0.2.1</p> <ul> --- 54,58 ---- <p class="header" align="center">MagicAjax.NET Framework</p> <P class="header" align="center">Change Log</P> ! <P class="MainHeader" align="left">v0.2.2 (9 December 2005) - Maintenance Release</P> <p>Changes since 0.2.1</p> <ul> |
From: Argiris K. <be...@us...> - 2005-12-09 17:08:04
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15703/Core/UI/Controls Modified Files: Tag: STABLE AjaxPanel.cs Log Message: Removed ReflectFormControl method. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.28.2.2 retrieving revision 1.28.2.3 diff -C2 -d -r1.28.2.2 -r1.28.2.3 *** AjaxPanel.cs 9 Dec 2005 14:03:12 -0000 1.28.2.2 --- AjaxPanel.cs 9 Dec 2005 17:07:52 -0000 1.28.2.3 *************** *** 615,870 **** } - protected void ReflectContainedFormControls (Control container) - { - ArrayList elems = new ArrayList(); - if ( container is IPostBackDataHandler ) - elems.Add (container); - elems.AddRange (Util.GetChildControlsOfType(container, typeof(IPostBackDataHandler), typeof(RenderedByScriptControl), true)); - - for (int i=0; i < elems.Count; i++) - ReflectFormControl (elems[i] as Control); - } - - protected void ReflectLiteralFormControls() - { - for (int i=0; i < this.Controls.Count; i++) - { - if ( ! IsHtmlHolder(this.Controls[i]) ) - ReflectContainedFormControls (this.Controls[i]); - } - } - - #region ReflectFormControl - /// <summary> - /// Compares the value of the form control with the value of the client's - /// form element and sends javascript command to corrent the client's element - /// if necessary. - /// </summary> - /// <param name="control"></param> - protected virtual void ReflectFormControl (Control control) - { - NameValueCollection form = Context.Request.Form; - - if ( control is WebControl ) - { - #region Reflecting for WebControls - - string id = control.UniqueID; - - if ( control is RadioButton ) - { - RadioButton radio = control as RadioButton; - int index = radio.UniqueID.LastIndexOf(':'); - string uniqueGroupName = radio.UniqueID.Substring(0, index + 1) + radio.GroupName; - if ( radio.Checked && form[uniqueGroupName] != radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=true;\r\n", control.ClientID); - } - else if ( !radio.Checked && form[uniqueGroupName] == radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=false;\r\n", control.ClientID); - } - } - else if ( control is CheckBox ) - { - if ( !(control.Parent is CheckBoxList) ) - { - CheckBox chkbox = control as CheckBox; - if ( chkbox.Checked != (form[id] != null) ) - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", id, (chkbox.Checked) ? "true" : "false"); - } - } - else if ( control is CheckBoxList ) - { - CheckBoxList chklist = control as CheckBoxList; - for (int i=0; i < chklist.Items.Count; i++) - { - string itemid = String.Format("{0}:{1}", id, i); - if ( chklist.Items[i].Selected != (form[itemid] != null) ) - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", itemid, (chklist.Items[i].Selected) ? "true" : "false"); - } - } - else if ( control is DropDownList ) - { - DropDownList ddlist = control as DropDownList; - if ( (ddlist.SelectedIndex == -1 && form[id] != null) - || ddlist.SelectedValue != form[id] ) - AjaxCallHelper.WriteSetFieldScript (id, ddlist.SelectedValue); - } - else if ( control is ListBox ) - { - ListBox lstbox = control as ListBox; - if ( ListSelectionMode.Single == lstbox.SelectionMode ) - { - if ( (lstbox.SelectedIndex == -1 && form[id] != null) - || lstbox.SelectedValue != form[id] ) - AjaxCallHelper.WriteSetFieldScript (id, lstbox.SelectedValue); - } - else - { - string[] selections = form.GetValues(id); - bool elemWritten = false; - - // Make selections - for (int i=0; i < lstbox.Items.Count; i++) - { - if (lstbox.Items[i].Selected && Array.IndexOf(selections, lstbox.Items[i].Value) == -1) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", id); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=true;\r\n", i); - } - } - - // Make unselections - for (int i=0; i < selections.Length; i++) - { - for (int itemi=0; itemi < lstbox.Items.Count; itemi++) - { - if ( lstbox.Items[itemi].Value == selections[i] ) - { - if ( ! lstbox.Items[itemi].Selected ) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", id); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=false;\r\n", itemi); - } - break; - } - } - } - } - } - else if ( control is RadioButtonList ) - { - RadioButtonList rblist = control as RadioButtonList; - if ( rblist.SelectedIndex == -1 && form[id] != null ) - { - // Clear selection - for (int i=0; i < rblist.Items.Count; i++) - { - if (rblist.Items[i].Value == form[id]) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=false;\r\n", String.Format("{0}_{1}", control.ClientID, i)); - break; - } - } - } - else if ( rblist.SelectedIndex != -1 && rblist.SelectedValue != form[id] ) - { - // Make selection - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=true;\r\n", String.Format("{0}_{1}", control.ClientID, rblist.SelectedIndex)); - } - } - else if ( control is TextBox ) - { - TextBox txtbox = control as TextBox; - if ( txtbox.Text != form[id] ) - AjaxCallHelper.WriteSetFieldScript (id, txtbox.Text); - } - - #endregion - } - else if ( control is HtmlControl ) - { - #region Reflecting for HtmlControls - - if ( control is HtmlInputCheckBox ) - { - HtmlInputCheckBox chkbox = control as HtmlInputCheckBox; - if ( chkbox.Checked != (form[chkbox.Name] != null) ) - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", chkbox.Name, (chkbox.Checked) ? "true" : "false"); - } - else if ( control is HtmlInputRadioButton ) - { - HtmlInputRadioButton radio = control as HtmlInputRadioButton; - if ( radio.Name != String.Empty ) - { - int index = radio.UniqueID.LastIndexOf(':'); - string uniqueName = radio.UniqueID.Substring(0, index + 1) + radio.Name; - if ( radio.Checked && form[uniqueName] != radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=true;\r\n", control.ClientID); - } - else if ( !radio.Checked && form[uniqueName] == radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=false;\r\n", control.ClientID); - } - } - } - else if ( control is HtmlInputText ) - { - HtmlInputText txtbox = control as HtmlInputText; - if ( txtbox.Value != form[txtbox.Name] ) - AjaxCallHelper.WriteSetFieldScript (txtbox.Name, txtbox.Value); - } - else if ( control is HtmlSelect ) - { - HtmlSelect sel = control as HtmlSelect; - if ( ! sel.Multiple ) - { - if ( (sel.SelectedIndex == -1 && form[sel.Name] != null) - || sel.Value != form[sel.Name] ) - AjaxCallHelper.WriteSetFieldScript (sel.Name, sel.Value); - } - else - { - string[] selections = form.GetValues(sel.Name); - bool elemWritten = false; - - // Make selections - for (int i=0; i < sel.Items.Count; i++) - { - if (sel.Items[i].Selected && Array.IndexOf(selections, sel.Items[i].Value) == -1) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", sel.Name); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=true;\r\n", i); - } - } - - // Make unselections - for (int i=0; i < selections.Length; i++) - { - for (int itemi=0; itemi < sel.Items.Count; itemi++) - { - if ( sel.Items[itemi].Value == selections[i] ) - { - if ( ! sel.Items[itemi].Selected ) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", sel.Name); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=false;\r\n", itemi); - } - break; - } - } - } - } - } - else if ( control is HtmlTextArea ) - { - HtmlTextArea txtbox = control as HtmlTextArea; - if ( txtbox.Value != form[txtbox.Name] ) - AjaxCallHelper.WriteSetFieldScript (txtbox.Name, txtbox.Value); - } - - #endregion - } - } - #endregion - #region override PutTagOnPageForAjaxCall /// <summary> --- 615,618 ---- |
From: Argiris K. <be...@us...> - 2005-12-09 17:07:23
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15535/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Removed ReflectFormControl method. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AjaxPanel.cs 9 Dec 2005 14:02:54 -0000 1.34 --- AjaxPanel.cs 9 Dec 2005 17:07:14 -0000 1.35 *************** *** 615,870 **** } - protected void ReflectContainedFormControls (Control container) - { - ArrayList elems = new ArrayList(); - if ( container is IPostBackDataHandler ) - elems.Add (container); - elems.AddRange (Util.GetChildControlsOfType(container, typeof(IPostBackDataHandler), typeof(RenderedByScriptControl), true)); - - for (int i=0; i < elems.Count; i++) - ReflectFormControl (elems[i] as Control); - } - - protected void ReflectLiteralFormControls() - { - for (int i=0; i < this.Controls.Count; i++) - { - if ( ! IsHtmlHolder(this.Controls[i]) ) - ReflectContainedFormControls (this.Controls[i]); - } - } - - #region ReflectFormControl - /// <summary> - /// Compares the value of the form control with the value of the client's - /// form element and sends javascript command to corrent the client's element - /// if necessary. - /// </summary> - /// <param name="control"></param> - protected virtual void ReflectFormControl (Control control) - { - NameValueCollection form = Context.Request.Form; - - if ( control is WebControl ) - { - #region Reflecting for WebControls - - string id = control.UniqueID; - - if ( control is RadioButton ) - { - RadioButton radio = control as RadioButton; - int index = radio.UniqueID.LastIndexOf(':'); - string uniqueGroupName = radio.UniqueID.Substring(0, index + 1) + radio.GroupName; - if ( radio.Checked && form[uniqueGroupName] != radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=true;\r\n", control.ClientID); - } - else if ( !radio.Checked && form[uniqueGroupName] == radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=false;\r\n", control.ClientID); - } - } - else if ( control is CheckBox ) - { - if ( !(control.Parent is CheckBoxList) ) - { - CheckBox chkbox = control as CheckBox; - if ( chkbox.Checked != (form[id] != null) ) - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", id, (chkbox.Checked) ? "true" : "false"); - } - } - else if ( control is CheckBoxList ) - { - CheckBoxList chklist = control as CheckBoxList; - for (int i=0; i < chklist.Items.Count; i++) - { - string itemid = String.Format("{0}:{1}", id, i); - if ( chklist.Items[i].Selected != (form[itemid] != null) ) - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", itemid, (chklist.Items[i].Selected) ? "true" : "false"); - } - } - else if ( control is DropDownList ) - { - DropDownList ddlist = control as DropDownList; - if ( (ddlist.SelectedIndex == -1 && form[id] != null) - || ddlist.SelectedValue != form[id] ) - AjaxCallHelper.WriteSetFieldScript (id, ddlist.SelectedValue); - } - else if ( control is ListBox ) - { - ListBox lstbox = control as ListBox; - if ( ListSelectionMode.Single == lstbox.SelectionMode ) - { - if ( (lstbox.SelectedIndex == -1 && form[id] != null) - || lstbox.SelectedValue != form[id] ) - AjaxCallHelper.WriteSetFieldScript (id, lstbox.SelectedValue); - } - else - { - string[] selections = form.GetValues(id); - bool elemWritten = false; - - // Make selections - for (int i=0; i < lstbox.Items.Count; i++) - { - if (lstbox.Items[i].Selected && Array.IndexOf(selections, lstbox.Items[i].Value) == -1) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", id); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=true;\r\n", i); - } - } - - // Make unselections - for (int i=0; i < selections.Length; i++) - { - for (int itemi=0; itemi < lstbox.Items.Count; itemi++) - { - if ( lstbox.Items[itemi].Value == selections[i] ) - { - if ( ! lstbox.Items[itemi].Selected ) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", id); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=false;\r\n", itemi); - } - break; - } - } - } - } - } - else if ( control is RadioButtonList ) - { - RadioButtonList rblist = control as RadioButtonList; - if ( rblist.SelectedIndex == -1 && form[id] != null ) - { - // Clear selection - for (int i=0; i < rblist.Items.Count; i++) - { - if (rblist.Items[i].Value == form[id]) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=false;\r\n", String.Format("{0}_{1}", control.ClientID, i)); - break; - } - } - } - else if ( rblist.SelectedIndex != -1 && rblist.SelectedValue != form[id] ) - { - // Make selection - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=true;\r\n", String.Format("{0}_{1}", control.ClientID, rblist.SelectedIndex)); - } - } - else if ( control is TextBox ) - { - TextBox txtbox = control as TextBox; - if ( txtbox.Text != form[id] ) - AjaxCallHelper.WriteSetFieldScript (id, txtbox.Text); - } - - #endregion - } - else if ( control is HtmlControl ) - { - #region Reflecting for HtmlControls - - if ( control is HtmlInputCheckBox ) - { - HtmlInputCheckBox chkbox = control as HtmlInputCheckBox; - if ( chkbox.Checked != (form[chkbox.Name] != null) ) - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", chkbox.Name, (chkbox.Checked) ? "true" : "false"); - } - else if ( control is HtmlInputRadioButton ) - { - HtmlInputRadioButton radio = control as HtmlInputRadioButton; - if ( radio.Name != String.Empty ) - { - int index = radio.UniqueID.LastIndexOf(':'); - string uniqueName = radio.UniqueID.Substring(0, index + 1) + radio.Name; - if ( radio.Checked && form[uniqueName] != radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=true;\r\n", control.ClientID); - } - else if ( !radio.Checked && form[uniqueName] == radio.ID ) - { - AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked=false;\r\n", control.ClientID); - } - } - } - else if ( control is HtmlInputText ) - { - HtmlInputText txtbox = control as HtmlInputText; - if ( txtbox.Value != form[txtbox.Name] ) - AjaxCallHelper.WriteSetFieldScript (txtbox.Name, txtbox.Value); - } - else if ( control is HtmlSelect ) - { - HtmlSelect sel = control as HtmlSelect; - if ( ! sel.Multiple ) - { - if ( (sel.SelectedIndex == -1 && form[sel.Name] != null) - || sel.Value != form[sel.Name] ) - AjaxCallHelper.WriteSetFieldScript (sel.Name, sel.Value); - } - else - { - string[] selections = form.GetValues(sel.Name); - bool elemWritten = false; - - // Make selections - for (int i=0; i < sel.Items.Count; i++) - { - if (sel.Items[i].Selected && Array.IndexOf(selections, sel.Items[i].Value) == -1) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", sel.Name); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=true;\r\n", i); - } - } - - // Make unselections - for (int i=0; i < selections.Length; i++) - { - for (int itemi=0; itemi < sel.Items.Count; itemi++) - { - if ( sel.Items[itemi].Value == selections[i] ) - { - if ( ! sel.Items[itemi].Selected ) - { - if ( ! elemWritten ) - { - AjaxCallHelper.WriteFormat ("elem=document.forms[0][\"{0}\"];\r\n", sel.Name); - elemWritten = true; - } - AjaxCallHelper.WriteFormat ("elem.options[{0}].selected=false;\r\n", itemi); - } - break; - } - } - } - } - } - else if ( control is HtmlTextArea ) - { - HtmlTextArea txtbox = control as HtmlTextArea; - if ( txtbox.Value != form[txtbox.Name] ) - AjaxCallHelper.WriteSetFieldScript (txtbox.Name, txtbox.Value); - } - - #endregion - } - } - #endregion - #region override PutTagOnPageForAjaxCall /// <summary> --- 615,618 ---- |
From: Dion O. <dol...@us...> - 2005-12-09 14:03:20
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7265/magicajax/Core/UI/Controls Modified Files: Tag: STABLE AjaxPanel.cs Log Message: fix in ReflectUpdatedFormValues(string html): - using ClientID instead of name attribute for setting checkboxes Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.28.2.1 retrieving revision 1.28.2.2 diff -C2 -d -r1.28.2.1 -r1.28.2.2 *** AjaxPanel.cs 9 Dec 2005 01:25:06 -0000 1.28.2.1 --- AjaxPanel.cs 9 Dec 2005 14:03:12 -0000 1.28.2.2 *************** *** 482,486 **** case "checkbox": if (isChecked != (form[name] != null)) ! AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", name, (isChecked) ? "true" : "false"); break; case "radio": --- 482,486 ---- case "checkbox": if (isChecked != (form[name] != null)) ! AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", clientID, (isChecked) ? "true" : "false"); break; case "radio": |
From: Dion O. <dol...@us...> - 2005-12-09 14:03:07
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7147/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: fix in ReflectUpdatedFormValues(string html): - using ClientID instead of name attribute for setting checkboxes Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AjaxPanel.cs 9 Dec 2005 01:23:59 -0000 1.33 --- AjaxPanel.cs 9 Dec 2005 14:02:54 -0000 1.34 *************** *** 482,486 **** case "checkbox": if (isChecked != (form[name] != null)) ! AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", name, (isChecked) ? "true" : "false"); break; case "radio": --- 482,486 ---- case "checkbox": if (isChecked != (form[name] != null)) ! AjaxCallHelper.WriteFormat ("document.forms[0][\"{0}\"].checked={1};\r\n", clientID, (isChecked) ? "true" : "false"); break; case "radio": |
From: Dion O. <dol...@us...> - 2005-12-09 10:38:35
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883/magicajax/Examples/ExampleSite (.NET 2.0 only)/examples Added Files: Tag: STABLE Basic.aspx CallbackTimer.aspx DataGrid.aspx FormElementsTest.aspx MasterDetail.aspx WebParts.aspx Wizard.aspx Log Message: Added example site for .NET 2.0 --- NEW FILE: FormElementsTest.aspx --- <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void btnClearAll_Click(object sender, EventArgs e) { this.AspTextBox.Text = null; this.HtmlTextBox.Value = null; this.AspMultilineTextBox.Text = null; this.AspPasswordTextBox.Text = null; this.HtmlTextArea.Value = null; this.AspCheckBox.Checked = false; this.AspRadioButton.Checked = false; this.AspDropDownList.SelectedIndex = -1; this.AspListBox.SelectedIndex = -1; this.AspMultipleListBox.SelectedIndex = -1; this.AspCheckBoxList.SelectedIndex = -1; this.AspRadioButtonList.SelectedIndex = -1; } protected void btnSetAll_Click(object sender, EventArgs e) { this.AspTextBox.Text = "hello world"; this.HtmlTextBox.Value = "hello world"; this.AspMultilineTextBox.Text = "hello world"; //this.AspPasswordTextBox.Text = "secret"; //note:setting of password fields not possible this.HtmlTextArea.Value = "hello world"; this.AspCheckBox.Checked = true; this.AspRadioButton.Checked = true; this.AspDropDownList.SelectedIndex = 2; this.AspListBox.SelectedIndex = 2; this.AspMultipleListBox.SelectedIndex = -1; this.AspMultipleListBox.Items[1].Selected = true; this.AspMultipleListBox.Items[2].Selected = true; this.AspCheckBoxList.SelectedIndex = -1; this.AspCheckBoxList.Items[1].Selected = true; this.AspCheckBoxList.Items[2].Selected = true; this.AspRadioButtonList.SelectedIndex = 2; } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <asp:Button ID="btnClearAll" runat="server" Text="Clear all" OnClick="btnClearAll_Click" /> <asp:Button ID="btnSetAll" runat="server" Text="Set all" OnClick="btnSetAll_Click" /> <asp:Button runat="server" Text="Callback" /> <br /> <table> <tr> <td>asp:textbox</td> <td><asp:TextBox ID="AspTextBox" runat="server" /></td> </tr> <tr> <td>html:textbox</td> <td><input id="HtmlTextBox" runat="server" /></td> </tr> <tr> <td>asp:textbox(multiline)</td> <td><asp:TextBox ID="AspMultilineTextBox" TextMode="MultiLine" runat="server" /></td> </tr> <tr> <td>asp:textbox(password)</td> <td><asp:TextBox ID="AspPasswordTextBox" TextMode="Password" runat="server" /></td> </tr> <tr> <td>html:textarea</td> <td><textarea cols="20" rows="2" id="HtmlTextArea" runat="server"></textarea></td> </tr> <tr> <td>asp:checkbox</td> <td><asp:CheckBox ID="AspCheckBox" runat="server" /></td> </tr> <tr> <td>asp:radiobutton</td> <td><asp:RadioButton ID="AspRadioButton" runat="server" /></td> </tr> <tr> <td>asp:dropdownlist</td> <td><asp:DropDownList ID="AspDropDownList" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:DropDownList></td> </tr> <tr> <td>asp:listbox</td> <td><asp:ListBox ID="AspListBox" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:ListBox></td> </tr> <tr> <td>asp:listbox(multiple)</td> <td><asp:ListBox SelectionMode="Multiple" ID="AspMultipleListBox" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:ListBox></td> </tr> <tr> <td>asp:checkboxlist</td> <td><asp:CheckBoxList ID="AspCheckBoxList" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:CheckBoxList></td> </tr> <tr> <td>asp:radiobuttonlist</td> <td><asp:RadioButtonList ID="AspRadioButtonList" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:RadioButtonList></td> </tr> </table> </ajax:ajaxpanel> </form> </body> </html> --- NEW FILE: Wizard.aspx --- <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>ASP.NET 2.0 Wizard control (with validator)</legend> <i>An example of an ASP.NET 2.0 Wizard control using MagicAjax.<br />Entering your name in the first step is mandatory (using a RequiredFieldValidator).</i><br /><br /> <asp:Wizard ID="Wizard1" CellPadding="7" HeaderText="Example Wizard" SideBarStyle-VerticalAlign="Middle" runat="server" ActiveStepIndex="0" BackColor="#EFF3FB" BorderColor="#B5C7DE" BorderWidth="1px" Font-Names="Verdana" SideBarStyle-Width="100px" NavigationStyle-Width="300px" OnFinishButtonClick="Wizard1_FinishButtonClick"> <StepStyle ForeColor="#333333" /> <SideBarStyle BackColor="#507CD1" /> <NavigationButtonStyle BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284E98" /> <WizardSteps> <asp:WizardStep runat="server" Title="Step 1"> <asp:Label ID="Label1" runat="server" Text="Enter your name"></asp:Label> <asp:TextBox ID="TextBox1" runat="server" /><br /> <asp:RequiredFieldValidator runat="server" Display="Static" ControlToValidate="TextBox1" ErrorMessage="Please enter your name" /> </asp:WizardStep> <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 2"> <asp:CheckBox ID="CheckBox1" Checked="true" runat="server" Text="I like MagicAjax" /> </asp:WizardStep> <asp:WizardStep runat="server" StepType="Finish" Title="Overview"> <asp:Label runat="server" ID="overview" /> </asp:WizardStep> </WizardSteps> <SideBarButtonStyle BackColor="#507CD1" Font-Names="Verdana" ForeColor="White" /> <HeaderStyle BackColor="#284E98" BorderColor="#EFF3FB" BorderStyle="Solid" BorderWidth="2px" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> </asp:Wizard> <asp:Label runat="server" id="lblFinished" Text="Wizard is Finished!" Visible="false" BackColor="Khaki" /> </fieldset> </ajax:ajaxpanel> </asp:Content> <script runat="server"> private void Page_Load(object sender, EventArgs e) { if (IsPostBack) { overview.Text = string.Format("Hi {0}, {1} like MagicAjax.<br />Now click 'Finish'.", TextBox1.Text, CheckBox1.Checked ? "good to hear you" : "sorry to hear you don't"); } } protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e) { Wizard1.Visible = false; lblFinished.Visible = true; } </script> --- NEW FILE: CallbackTimer.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>Windows Processes (list is updated every 10 seconds using Callback Timer)</legend> <i>This example demonstrates the use of the MagicAjax CallbackTimer. <br />For this example we've set the Callback timer in the Page_Load event (hint: click 'View Source' at the bottom of this page to see the complete source of this aspx file).</i><br /><br /> <div style="overflow:auto;height:400px;width:325px"> <asp:DataGrid AutoGenerateColumns="false" AllowSorting="True" OnSortCommand="grid_SortCommand" runat="server" ID="DataGrid1" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="5" GridLines="Horizontal" > <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" /> <SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" /> <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" Mode="NumericPages" /> <AlternatingItemStyle BackColor="#F7F7F7" /> <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" /> <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" /> <Columns> <asp:BoundColumn DataField="ProcessName" SortExpression="ProcessName" HeaderText="Image Name" /> <asp:BoundColumn DataField="PhysicalMemory" SortExpression="PhysicalMemory" HeaderText="Mem Usage" DataFormatString="{0:###,###,###} K" /> <asp:BoundColumn DataField="HandleCount" SortExpression="HandleCount" HeaderText="Handles" DataFormatString="{0:###,###}" /> </Columns> </asp:DataGrid> </div> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // For automatic CallBack every 10 seconds. MagicAjax.AjaxCallHelper.SetAjaxCallTimerInterval(10000); } ShowProcesses(); } private void ShowProcesses() { System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcesses(); System.Data.DataTable dt = new System.Data.DataTable("Processes"); dt.Columns.Add("ProcessName"); dt.Columns.Add("PhysicalMemory", typeof(Int64)); dt.Columns.Add("HandleCount", typeof(Int32)); foreach (System.Diagnostics.Process process in processes) { dt.Rows.Add(new object[] {process.ProcessName, process.WorkingSet64 /1000, process.HandleCount }); } System.Data.DataView dv = dt.DefaultView; //sort data dv.Sort = SortExpression; //bind data DataGrid1.DataSource = dv; DataGrid1.DataBind(); } /// <summary> /// SortExpression of the grid (stored in ViewState!) /// </summary> private string SortExpression { get { if (ViewState["_grid_SortExpression"] != null) { return (string)ViewState["_grid_SortExpression"]; } else { return "PhysicalMemory desc"; //default } } set { ViewState["_grid_SortExpression"] = value; } } private void grid_SortCommand(object source, DataGridSortCommandEventArgs e) { string[] currentSort = SortExpression.Split(' '); if (currentSort[0] == e.SortExpression) { SortExpression = string.Format("{0} {1}", e.SortExpression, currentSort[1] == "desc" ? "asc" : "desc"); } else { SortExpression = e.SortExpression + " asc"; } //refill datagrid ShowProcesses(); } </script> --- NEW FILE: Basic.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>Simple button showing server time</legend> <i>The button makes a callback to the server and shows the server's date and time in a asp:Label tag.</i><br /><br /> <asp:Button runat="server" ID="ShowTime" Text="Show server's date & time" OnClick="ShowTime_Click" CausesValidation="false" /> <asp:Label runat="server" ID="lblShowTime" BackColor="Blue" ForeColor="White" /> </fieldset> <fieldset> <legend>Master/detail dropdown lists</legend> <i>An example of two connected dropdown lists (aka master-detail) without having to write any javascript client code. Note: to see the aspx source, click the 'View Source' link at the bottom of this page.</i><br /><br /> Please pick a car: <asp:DropDownList id="brand" runat="server" AutoPostBack="true" OnSelectedIndexChanged="brand_SelectedIndexChanged"> <asp:ListItem>- Select car brand -</asp:ListItem> </asp:DropDownList> <asp:DropDownList id="model" runat="server" AutoPostBack="true" Visible="false" OnSelectedIndexChanged="model_SelectedIndexChanged" /><br /><br /> <asp:Button id="select" runat="server" CausesValidation="false" Text="Select Car" Enabled="false" OnClick="select_Click" /> <asp:Label id="lblSelectedCar" runat="server" /> </fieldset> <fieldset> <legend>Textbox with a server-side validator</legend> <i>Demonstrate the use of server-side validators with MagixAjax. Works for all browsers ;)</i><br /><br /> Enter username: <asp:TextBox runat="server" ID="username" /> <asp:Button ID="username_submit" runat="server" Text="Submit" /> <asp:RequiredFieldValidator ID="username_check" runat="server" ControlToValidate="username" EnableClientScript="false" ErrorMessage="Please enter username." /> </fieldset> </ajax:ajaxpanel> <fieldset> <legend>Regular (Non-Ajax) Postback button</legend> <i>The 'Regular PostBack' button is used to demonstrate that the ViewState of the page is persisted between AJAX callbacks.</i><br /><br /> <asp:Button ID="Button1" runat="server" Text="Regular Postback" CausesValidation="false" /> </fieldset> <ajax:ajaxpanel ID="Ajaxpanel2" runat="server"> <fieldset> <legend>Button invoking a Response.Redirect()</legend> <i>This button calls the server side Response.Redirect() method to navigate to another page.</i><br /><br /> <asp:Button runat="server" CausesValidation="false" Text="Go to DataGrid example" OnClick="Redirect_Click" /> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //fill the car brands brand.Items.Add("VW"); brand.Items.Add("Mercedes"); brand.Items.Add("Citroen"); } } protected void ShowTime_Click(object sender, EventArgs e) { lblShowTime.Text = DateTime.Now.ToString(); } protected void brand_SelectedIndexChanged(object sender, EventArgs e) { model.Items.Clear(); model.Items.Add(new ListItem("- Select car model -", "")); model.Visible = true; select.Enabled = false; lblSelectedCar.Text = null; switch (brand.SelectedValue) { case "VW": model.Items.Add("Golf"); model.Items.Add("Passat"); model.Items.Add("Beetle"); model.Items.Add("Phaeton"); break; case "Mercedes": model.Items.Add("S Class"); model.Items.Add("E Class"); model.Items.Add("A Class"); model.Items.Add("M Class"); break; case "Citroen": model.Items.Add("C3 Pluriel"); model.Items.Add("C5 Break"); model.Items.Add("C8"); model.Items.Add("Berlingo"); break; default: model.Visible = false; break; } } protected void model_SelectedIndexChanged(object sender, EventArgs e) { select.Enabled = model.SelectedIndex != 0; lblSelectedCar.Text = null; } protected void select_Click(object sender, EventArgs e) { lblSelectedCar.Text = "You have picked the " + brand.SelectedValue + " " + model.SelectedValue; } protected void Redirect_Click(object sender, EventArgs e) { Response.Redirect("DataGrid.aspx"); } </script> --- NEW FILE: WebParts.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:WebPartManager ID="WebPartManager1" runat="server" Personalization-Enabled="true" /> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>ASP.NET 2.0 WebParts demo <asp:LinkButton runat="server" id="Toggle" Text="[Switch to EditMode]" OnClick="Toggle_Click" /></legend> <i>Very cool demo of ASP.NET 2.0 WebParts running on MagicAjax.<br />Switch to EditMode and move/add/delete WebParts without a visible postback.<br /> Note: Your modifications are stored in Session, so will be lost when you leave this site.<br /> Note2: Dragging and dropping of WebParts is a ASP.NET 2.0 feature that is only supported for IE.</i><br /><br /> <table width="100%"><tr><td valign="top" width="30%"> <asp:WebPartZone runat="server" ID="WebPartZone1" Width="100%"> <PartTitleStyle CssClass="WebPartTitle" BackColor="LightBlue" /> <ZoneTemplate> <uc1:Logo ID="Logo1" runat="server" /> </ZoneTemplate> </asp:WebPartZone> </td><td valign="top" width="30%"> <asp:WebPartZone runat="server" ID="WebPartZone2" Width="100%"> <PartTitleStyle CssClass="WebPartTitle" BackColor="LightBlue" /> <ZoneTemplate> <uc1:Calendar ID="Calendar1" runat="server" /> </ZoneTemplate> </asp:WebPartZone> </td><td width="10%"> </td><td valign="top" width="30%"> <asp:CatalogZone ID="CatalogZone1" runat="server"> <HeaderStyle BackColor="Khaki" /> <FooterStyle BackColor="Khaki" /> <CloseVerb Visible="false" /> <HeaderCloseVerb Visible="false" /> <ZoneTemplate> <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server" Title="Catalog"> <WebPartsTemplate> <uc1:Logo ID="Logo1" runat="server" /> <uc1:Calendar ID="Calendar1" runat="server" /> </WebPartsTemplate> </asp:DeclarativeCatalogPart> </ZoneTemplate> </asp:CatalogZone> </td></tr></table> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Force setting of Session id (workaround for bug in MagicAjax) Session["dummy"] = "dummy"; // Authenticate user with dummy userName, so the WebPartManager will allow // switching to Editmode. FormsAuthentication.SetAuthCookie("dummy", false); } } protected void Toggle_Click(object sender, EventArgs e) { if (WebPartManager1.DisplayMode == WebPartManager.BrowseDisplayMode) { Toggle.Text = "[Switch to ViewMode]"; WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode; } else { Toggle.Text = "[Switch to EditMode]"; WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode; } } </script> --- NEW FILE: MasterDetail.aspx --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DataGrid.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>Datagrid using MagicAjax (incl. sorting and selecting)</legend> <i>This is a very basic example of a datagrid that does sorting and selecting without a visible postback to the server.<br /> Try this: reduce the height of your browser window's, so you need to scroll down to see the grid. Notice that MagicAjax keeps the scroll-position after callbacks.</i><br /><br /> <asp:DataGrid Width="250px" id="grid" Runat="server" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="4" AllowSorting="True" PageSize="3" OnSortCommand="grid_SortCommand"> <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle> <SelectedItemStyle ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle> <ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle> <Columns> <asp:ButtonColumn Text="Select" CommandName="Select"></asp:ButtonColumn> </Columns> <PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle> </asp:DataGrid> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //fill datagrid (example 2) FillGrid(); } } /// <summary> /// Creates a DataTable and binds to grid /// </summary> private void FillGrid() { //create data System.Data.DataTable dt = new System.Data.DataTable("Person"); dt.Columns.Add("Brand"); dt.Columns.Add("Model"); dt.Rows.Add(new string[] {"BMW", "X3"}); dt.Rows.Add(new string[] {"Citroen", "Berlingo"}); dt.Rows.Add(new string[] {"Fiat", "Punto"}); dt.Rows.Add(new string[] {"Mercedes", "E Class"}); dt.Rows.Add(new string[] {"Opel", "Zafira"}); dt.Rows.Add(new string[] {"Peugeot", "206"}); dt.Rows.Add(new string[] {"Volvo", "V70"}); dt.Rows.Add(new string[] {"VW", "Golf"}); System.Data.DataView dv = dt.DefaultView; //sort data dv.Sort = SortExpression; //bind data grid.DataSource = dv; grid.DataBind(); } /// <summary> /// SortExpression of the grid (stored in ViewState!) /// </summary> private string SortExpression { get { if (ViewState["_grid_SortExpression"] != null) { return (string)ViewState["_grid_SortExpression"]; } else { return "Brand asc"; //default } } set { ViewState["_grid_SortExpression"] = value; } } private void grid_SortCommand(object source, DataGridSortCommandEventArgs e) { string[] currentSort = SortExpression.Split(' '); if (currentSort[0] != e.SortExpression) { grid.SelectedIndex = -1; SortExpression = e.SortExpression + " asc"; } else { SortExpression = string.Format("{0} {1}", e.SortExpression, currentSort[1] == "desc" ? "asc" : "desc"); } //refill datagrid FillGrid(); } </script> |
From: Dion O. <dol...@us...> - 2005-12-09 10:38:34
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/App_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883/magicajax/Examples/ExampleSite (.NET 2.0 only)/App_Data Added Files: Tag: STABLE customers.xml Log Message: Added example site for .NET 2.0 --- NEW FILE: customers.xml --- (This appears to be a binary file; contents omitted.) |
From: Dion O. <dol...@us...> - 2005-12-09 10:38:34
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only) In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883/magicajax/Examples/ExampleSite (.NET 2.0 only) Added Files: Tag: STABLE Default.aspx MasterPage.master Web.Config Web.sitemap readme.txt Log Message: Added example site for .NET 2.0 --- NEW FILE: Web.Config --- <?xml version="1.0"?> <configuration> <configSections> <section name="magicAjax" type="MagicAjax.Configuration.MagicAjaxSectionHandler, MagicAjax"/> </configSections> <magicAjax tracing="false"> <pageStore/> </magicAjax> <system.web> <authentication mode="Forms" /> <pages> <controls> <add namespace="MagicAjax.UI.Controls" assembly="MagicAjax" tagPrefix="ajax"/> <add src="~/webparts/Logo.ascx" tagPrefix="uc1" tagName="Logo"/> <add src="~/webparts/Calendar.ascx" tagPrefix="uc1" tagName="Calendar"/> </controls> </pages> <webParts> <personalization defaultProvider="SessionPersonalizationProvider"> <providers> <clear/> <add name="SessionPersonalizationProvider" type="SessionPersonalizationProvider" applicationName="/"/> </providers> </personalization> </webParts> <httpModules> <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/> </httpModules> <compilation debug="true" /> </system.web> </configuration> --- NEW FILE: Web.sitemap --- <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description=""> <siteMapNode url="examples/Basic.aspx" title="1. Basic controls using MagicAjax" description="" /> <siteMapNode url="examples/DataGrid.aspx" title="2. DataGrid using MagicAjax" description="" /> <siteMapNode url="examples/MasterDetail.aspx" title="3. GridView & DetailsView" description="" /> <siteMapNode url="examples/WebParts.aspx" title="4. WebPartManager using MagicAjax" description="" /> <siteMapNode url="examples/Wizard.aspx" title="5. Wizard control using MagicAjax" description="" /> <siteMapNode url="examples/CallbackTimer.aspx" title="6. Windows Processes (using Callback Timer)" description="" /> </siteMapNode> </siteMap> --- NEW FILE: MasterPage.master --- <%@ Master Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <style type="text/css"> body { font-family:verdana; font-size:small; margin-top: 0px; } fieldset { width: 700px; padding:10px 10px; } legend { padding:10px 0px 10px 0px; } </style> </head> <body> <form id="form1" runat="server"> <fieldset> <legend><b>MagicAjax.NET Examples for ASP.NET 2.0</b> (.NET version <%= System.Environment.Version %>)<br />Please select one of the demo pages:</legend> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" /> <asp:Menu ID="Menu1" DataSourceID="SiteMapDataSource1" runat="server" StaticSelectedStyle-BorderStyle="Dotted" StaticSelectedStyle-BorderWidth="2px" StaticSelectedStyle-BorderColor="Green" StaticSelectedStyle-Font-Bold="true" /> </fieldset> <hr style="border-style:dashed; border-color:black;" /> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" /> <ajax:ajaxpanel ID="AjaxSourcePanel" runat="server"> <br /><hr style="border-style:dashed; border-color:black;" /> <asp:LinkButton ID="ShowSource" runat="server" Text="Show Source" OnClick="ShowSource_Click" /> <pre runat="server" id="SourceSpan" style="background-color:PapayaWhip" /> </ajax:ajaxpanel> </form> </body> </html> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { AjaxSourcePanel.Visible = !Request.RawUrl.ToLowerInvariant().EndsWith("/default.aspx"); } protected void ShowSource_Click(object sender, EventArgs e) { //read current aspx source, and put in SourceSpan SourceSpan.InnerHtml = HttpUtility.HtmlEncode(System.IO.File.ReadAllText(Request.PhysicalPath).Replace("\t", " ")); } </script> --- NEW FILE: readme.txt --- Step 1: create a virtual dir in IIS, and map to this folder note: make sure the virtual dir runs with .NET 2.0. Step 2: place MagicAjax.dll in the Bin folder Now you should be able to run the demo pages --- NEW FILE: Default.aspx --- <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" %> |
From: Dion O. <dol...@us...> - 2005-12-09 10:38:34
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/webparts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883/magicajax/Examples/ExampleSite (.NET 2.0 only)/webparts Added Files: Tag: STABLE Calendar.ascx Logo.ascx Log Message: Added example site for .NET 2.0 --- NEW FILE: Calendar.ascx --- <%@ Control Language="C#" %> <%@ Implements Interface="System.Web.UI.WebControls.WebParts.IWebPart" %> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/pow_by_aspnet2.0.gif" /> <script runat="server"> public string CatalogIconImageUrl { get { return null; } set { } } public string Description { get { return null; } set { } } public string Subtitle { get { return null; } set { } } public string Title { get { return "Logo"; } set { } } public string TitleIconImageUrl { get { return null; } set { } } public string TitleUrl { get{ return null; } set{ } } </script> --- NEW FILE: Logo.ascx --- <%@ Control Language="C#" %> <%@ Implements Interface="System.Web.UI.WebControls.WebParts.IWebPart" %> <asp:Calendar ID="Calendar1" runat="server" /> <script runat="server"> public string CatalogIconImageUrl { get { return null; } set { } } public string Description { get { return null; } set { } } public string Subtitle { get { return null; } set { } } public string Title { get { return "Calendar"; } set { } } public string TitleIconImageUrl { get { return null; } set { } } public string TitleUrl { get{ return null; } set{ } } </script> |
From: Dion O. <dol...@us...> - 2005-12-09 10:38:34
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883/magicajax/Examples/ExampleSite (.NET 2.0 only)/images Added Files: Tag: STABLE first.GIF last.GIF next.gif pow_by_aspnet2.0.gif prev.GIF Log Message: Added example site for .NET 2.0 --- NEW FILE: pow_by_aspnet2.0.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: first.GIF --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: last.GIF --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev.GIF --- (This appears to be a binary file; contents omitted.) |
From: Dion O. <dol...@us...> - 2005-12-09 10:38:32
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/App_Code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883/magicajax/Examples/ExampleSite (.NET 2.0 only)/App_Code Added Files: Tag: STABLE SessionPersonalizationProvider.cs Log Message: Added example site for .NET 2.0 --- NEW FILE: SessionPersonalizationProvider.cs --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19561/magicajax/Examples/ExampleSite (.NET 2.0 only)/examples Added Files: Basic.aspx CallbackTimer.aspx DataGrid.aspx FormElementsTest.aspx MasterDetail.aspx WebParts.aspx Wizard.aspx Log Message: Added example site for .NET 2.0 --- NEW FILE: FormElementsTest.aspx --- <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void btnClearAll_Click(object sender, EventArgs e) { this.AspTextBox.Text = null; this.HtmlTextBox.Value = null; this.AspMultilineTextBox.Text = null; this.AspPasswordTextBox.Text = null; this.HtmlTextArea.Value = null; this.AspCheckBox.Checked = false; this.AspRadioButton.Checked = false; this.AspDropDownList.SelectedIndex = -1; this.AspListBox.SelectedIndex = -1; this.AspMultipleListBox.SelectedIndex = -1; this.AspCheckBoxList.SelectedIndex = -1; this.AspRadioButtonList.SelectedIndex = -1; } protected void btnSetAll_Click(object sender, EventArgs e) { this.AspTextBox.Text = "hello world"; this.HtmlTextBox.Value = "hello world"; this.AspMultilineTextBox.Text = "hello world"; //this.AspPasswordTextBox.Text = "secret"; //note:setting of password fields not possible this.HtmlTextArea.Value = "hello world"; this.AspCheckBox.Checked = true; this.AspRadioButton.Checked = true; this.AspDropDownList.SelectedIndex = 2; this.AspListBox.SelectedIndex = 2; this.AspMultipleListBox.SelectedIndex = -1; this.AspMultipleListBox.Items[1].Selected = true; this.AspMultipleListBox.Items[2].Selected = true; this.AspCheckBoxList.SelectedIndex = -1; this.AspCheckBoxList.Items[1].Selected = true; this.AspCheckBoxList.Items[2].Selected = true; this.AspRadioButtonList.SelectedIndex = 2; } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <asp:Button ID="btnClearAll" runat="server" Text="Clear all" OnClick="btnClearAll_Click" /> <asp:Button ID="btnSetAll" runat="server" Text="Set all" OnClick="btnSetAll_Click" /> <asp:Button runat="server" Text="Callback" /> <br /> <table> <tr> <td>asp:textbox</td> <td><asp:TextBox ID="AspTextBox" runat="server" /></td> </tr> <tr> <td>html:textbox</td> <td><input id="HtmlTextBox" runat="server" /></td> </tr> <tr> <td>asp:textbox(multiline)</td> <td><asp:TextBox ID="AspMultilineTextBox" TextMode="MultiLine" runat="server" /></td> </tr> <tr> <td>asp:textbox(password)</td> <td><asp:TextBox ID="AspPasswordTextBox" TextMode="Password" runat="server" /></td> </tr> <tr> <td>html:textarea</td> <td><textarea cols="20" rows="2" id="HtmlTextArea" runat="server"></textarea></td> </tr> <tr> <td>asp:checkbox</td> <td><asp:CheckBox ID="AspCheckBox" runat="server" /></td> </tr> <tr> <td>asp:radiobutton</td> <td><asp:RadioButton ID="AspRadioButton" runat="server" /></td> </tr> <tr> <td>asp:dropdownlist</td> <td><asp:DropDownList ID="AspDropDownList" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:DropDownList></td> </tr> <tr> <td>asp:listbox</td> <td><asp:ListBox ID="AspListBox" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:ListBox></td> </tr> <tr> <td>asp:listbox(multiple)</td> <td><asp:ListBox SelectionMode="Multiple" ID="AspMultipleListBox" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:ListBox></td> </tr> <tr> <td>asp:checkboxlist</td> <td><asp:CheckBoxList ID="AspCheckBoxList" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:CheckBoxList></td> </tr> <tr> <td>asp:radiobuttonlist</td> <td><asp:RadioButtonList ID="AspRadioButtonList" runat="server"><asp:ListItem Value="1" /><asp:ListItem Value="2" /><asp:ListItem Value="3" /></asp:RadioButtonList></td> </tr> </table> </ajax:ajaxpanel> </form> </body> </html> --- NEW FILE: Wizard.aspx --- <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>ASP.NET 2.0 Wizard control (with validator)</legend> <i>An example of an ASP.NET 2.0 Wizard control using MagicAjax.<br />Entering your name in the first step is mandatory (using a RequiredFieldValidator).</i><br /><br /> <asp:Wizard ID="Wizard1" CellPadding="7" HeaderText="Example Wizard" SideBarStyle-VerticalAlign="Middle" runat="server" ActiveStepIndex="0" BackColor="#EFF3FB" BorderColor="#B5C7DE" BorderWidth="1px" Font-Names="Verdana" SideBarStyle-Width="100px" NavigationStyle-Width="300px" OnFinishButtonClick="Wizard1_FinishButtonClick"> <StepStyle ForeColor="#333333" /> <SideBarStyle BackColor="#507CD1" /> <NavigationButtonStyle BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284E98" /> <WizardSteps> <asp:WizardStep runat="server" Title="Step 1"> <asp:Label ID="Label1" runat="server" Text="Enter your name"></asp:Label> <asp:TextBox ID="TextBox1" runat="server" /><br /> <asp:RequiredFieldValidator runat="server" Display="Static" ControlToValidate="TextBox1" ErrorMessage="Please enter your name" /> </asp:WizardStep> <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 2"> <asp:CheckBox ID="CheckBox1" Checked="true" runat="server" Text="I like MagicAjax" /> </asp:WizardStep> <asp:WizardStep runat="server" StepType="Finish" Title="Overview"> <asp:Label runat="server" ID="overview" /> </asp:WizardStep> </WizardSteps> <SideBarButtonStyle BackColor="#507CD1" Font-Names="Verdana" ForeColor="White" /> <HeaderStyle BackColor="#284E98" BorderColor="#EFF3FB" BorderStyle="Solid" BorderWidth="2px" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> </asp:Wizard> <asp:Label runat="server" id="lblFinished" Text="Wizard is Finished!" Visible="false" BackColor="Khaki" /> </fieldset> </ajax:ajaxpanel> </asp:Content> <script runat="server"> private void Page_Load(object sender, EventArgs e) { if (IsPostBack) { overview.Text = string.Format("Hi {0}, {1} like MagicAjax.<br />Now click 'Finish'.", TextBox1.Text, CheckBox1.Checked ? "good to hear you" : "sorry to hear you don't"); } } protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e) { Wizard1.Visible = false; lblFinished.Visible = true; } </script> --- NEW FILE: CallbackTimer.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>Windows Processes (list is updated every 10 seconds using Callback Timer)</legend> <i>This example demonstrates the use of the MagicAjax CallbackTimer. <br />For this example we've set the Callback timer in the Page_Load event (hint: click 'View Source' at the bottom of this page to see the complete source of this aspx file).</i><br /><br /> <div style="overflow:auto;height:400px;width:325px"> <asp:DataGrid AutoGenerateColumns="false" AllowSorting="True" OnSortCommand="grid_SortCommand" runat="server" ID="DataGrid1" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="5" GridLines="Horizontal" > <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" /> <SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" /> <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" Mode="NumericPages" /> <AlternatingItemStyle BackColor="#F7F7F7" /> <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" /> <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" /> <Columns> <asp:BoundColumn DataField="ProcessName" SortExpression="ProcessName" HeaderText="Image Name" /> <asp:BoundColumn DataField="PhysicalMemory" SortExpression="PhysicalMemory" HeaderText="Mem Usage" DataFormatString="{0:###,###,###} K" /> <asp:BoundColumn DataField="HandleCount" SortExpression="HandleCount" HeaderText="Handles" DataFormatString="{0:###,###}" /> </Columns> </asp:DataGrid> </div> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // For automatic CallBack every 10 seconds. MagicAjax.AjaxCallHelper.SetAjaxCallTimerInterval(10000); } ShowProcesses(); } private void ShowProcesses() { System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcesses(); System.Data.DataTable dt = new System.Data.DataTable("Processes"); dt.Columns.Add("ProcessName"); dt.Columns.Add("PhysicalMemory", typeof(Int64)); dt.Columns.Add("HandleCount", typeof(Int32)); foreach (System.Diagnostics.Process process in processes) { dt.Rows.Add(new object[] {process.ProcessName, process.WorkingSet64 /1000, process.HandleCount }); } System.Data.DataView dv = dt.DefaultView; //sort data dv.Sort = SortExpression; //bind data DataGrid1.DataSource = dv; DataGrid1.DataBind(); } /// <summary> /// SortExpression of the grid (stored in ViewState!) /// </summary> private string SortExpression { get { if (ViewState["_grid_SortExpression"] != null) { return (string)ViewState["_grid_SortExpression"]; } else { return "PhysicalMemory desc"; //default } } set { ViewState["_grid_SortExpression"] = value; } } private void grid_SortCommand(object source, DataGridSortCommandEventArgs e) { string[] currentSort = SortExpression.Split(' '); if (currentSort[0] == e.SortExpression) { SortExpression = string.Format("{0} {1}", e.SortExpression, currentSort[1] == "desc" ? "asc" : "desc"); } else { SortExpression = e.SortExpression + " asc"; } //refill datagrid ShowProcesses(); } </script> --- NEW FILE: Basic.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>Simple button showing server time</legend> <i>The button makes a callback to the server and shows the server's date and time in a asp:Label tag.</i><br /><br /> <asp:Button runat="server" ID="ShowTime" Text="Show server's date & time" OnClick="ShowTime_Click" CausesValidation="false" /> <asp:Label runat="server" ID="lblShowTime" BackColor="Blue" ForeColor="White" /> </fieldset> <fieldset> <legend>Master/detail dropdown lists</legend> <i>An example of two connected dropdown lists (aka master-detail) without having to write any javascript client code. Note: to see the aspx source, click the 'View Source' link at the bottom of this page.</i><br /><br /> Please pick a car: <asp:DropDownList id="brand" runat="server" AutoPostBack="true" OnSelectedIndexChanged="brand_SelectedIndexChanged"> <asp:ListItem>- Select car brand -</asp:ListItem> </asp:DropDownList> <asp:DropDownList id="model" runat="server" AutoPostBack="true" Visible="false" OnSelectedIndexChanged="model_SelectedIndexChanged" /><br /><br /> <asp:Button id="select" runat="server" CausesValidation="false" Text="Select Car" Enabled="false" OnClick="select_Click" /> <asp:Label id="lblSelectedCar" runat="server" /> </fieldset> <fieldset> <legend>Textbox with a server-side validator</legend> <i>Demonstrate the use of server-side validators with MagixAjax. Works for all browsers ;)</i><br /><br /> Enter username: <asp:TextBox runat="server" ID="username" /> <asp:Button ID="username_submit" runat="server" Text="Submit" /> <asp:RequiredFieldValidator ID="username_check" runat="server" ControlToValidate="username" EnableClientScript="false" ErrorMessage="Please enter username." /> </fieldset> </ajax:ajaxpanel> <fieldset> <legend>Regular (Non-Ajax) Postback button</legend> <i>The 'Regular PostBack' button is used to demonstrate that the ViewState of the page is persisted between AJAX callbacks.</i><br /><br /> <asp:Button ID="Button1" runat="server" Text="Regular Postback" CausesValidation="false" /> </fieldset> <ajax:ajaxpanel ID="Ajaxpanel2" runat="server"> <fieldset> <legend>Button invoking a Response.Redirect()</legend> <i>This button calls the server side Response.Redirect() method to navigate to another page.</i><br /><br /> <asp:Button runat="server" CausesValidation="false" Text="Go to DataGrid example" OnClick="Redirect_Click" /> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //fill the car brands brand.Items.Add("VW"); brand.Items.Add("Mercedes"); brand.Items.Add("Citroen"); } } protected void ShowTime_Click(object sender, EventArgs e) { lblShowTime.Text = DateTime.Now.ToString(); } protected void brand_SelectedIndexChanged(object sender, EventArgs e) { model.Items.Clear(); model.Items.Add(new ListItem("- Select car model -", "")); model.Visible = true; select.Enabled = false; lblSelectedCar.Text = null; switch (brand.SelectedValue) { case "VW": model.Items.Add("Golf"); model.Items.Add("Passat"); model.Items.Add("Beetle"); model.Items.Add("Phaeton"); break; case "Mercedes": model.Items.Add("S Class"); model.Items.Add("E Class"); model.Items.Add("A Class"); model.Items.Add("M Class"); break; case "Citroen": model.Items.Add("C3 Pluriel"); model.Items.Add("C5 Break"); model.Items.Add("C8"); model.Items.Add("Berlingo"); break; default: model.Visible = false; break; } } protected void model_SelectedIndexChanged(object sender, EventArgs e) { select.Enabled = model.SelectedIndex != 0; lblSelectedCar.Text = null; } protected void select_Click(object sender, EventArgs e) { lblSelectedCar.Text = "You have picked the " + brand.SelectedValue + " " + model.SelectedValue; } protected void Redirect_Click(object sender, EventArgs e) { Response.Redirect("DataGrid.aspx"); } </script> --- NEW FILE: WebParts.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:WebPartManager ID="WebPartManager1" runat="server" Personalization-Enabled="true" /> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>ASP.NET 2.0 WebParts demo <asp:LinkButton runat="server" id="Toggle" Text="[Switch to EditMode]" OnClick="Toggle_Click" /></legend> <i>Very cool demo of ASP.NET 2.0 WebParts running on MagicAjax.<br />Switch to EditMode and move/add/delete WebParts without a visible postback.<br /> Note: Your modifications are stored in Session, so will be lost when you leave this site.<br /> Note2: Dragging and dropping of WebParts is a ASP.NET 2.0 feature that is only supported for IE.</i><br /><br /> <table width="100%"><tr><td valign="top" width="30%"> <asp:WebPartZone runat="server" ID="WebPartZone1" Width="100%"> <PartTitleStyle CssClass="WebPartTitle" BackColor="LightBlue" /> <ZoneTemplate> <uc1:Logo ID="Logo1" runat="server" /> </ZoneTemplate> </asp:WebPartZone> </td><td valign="top" width="30%"> <asp:WebPartZone runat="server" ID="WebPartZone2" Width="100%"> <PartTitleStyle CssClass="WebPartTitle" BackColor="LightBlue" /> <ZoneTemplate> <uc1:Calendar ID="Calendar1" runat="server" /> </ZoneTemplate> </asp:WebPartZone> </td><td width="10%"> </td><td valign="top" width="30%"> <asp:CatalogZone ID="CatalogZone1" runat="server"> <HeaderStyle BackColor="Khaki" /> <FooterStyle BackColor="Khaki" /> <CloseVerb Visible="false" /> <HeaderCloseVerb Visible="false" /> <ZoneTemplate> <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server" Title="Catalog"> <WebPartsTemplate> <uc1:Logo ID="Logo1" runat="server" /> <uc1:Calendar ID="Calendar1" runat="server" /> </WebPartsTemplate> </asp:DeclarativeCatalogPart> </ZoneTemplate> </asp:CatalogZone> </td></tr></table> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Force setting of Session id (workaround for bug in MagicAjax) Session["dummy"] = "dummy"; // Authenticate user with dummy userName, so the WebPartManager will allow // switching to Editmode. FormsAuthentication.SetAuthCookie("dummy", false); } } protected void Toggle_Click(object sender, EventArgs e) { if (WebPartManager1.DisplayMode == WebPartManager.BrowseDisplayMode) { Toggle.Text = "[Switch to ViewMode]"; WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode; } else { Toggle.Text = "[Switch to EditMode]"; WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode; } } </script> --- NEW FILE: MasterDetail.aspx --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DataGrid.aspx --- <%@ Page language="C#" MasterPageFile="~/MasterPage.master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <ajax:ajaxpanel ID="Ajaxpanel1" runat="server"> <fieldset> <legend>Datagrid using MagicAjax (incl. sorting and selecting)</legend> <i>This is a very basic example of a datagrid that does sorting and selecting without a visible postback to the server.<br /> Try this: reduce the height of your browser window's, so you need to scroll down to see the grid. Notice that MagicAjax keeps the scroll-position after callbacks.</i><br /><br /> <asp:DataGrid Width="250px" id="grid" Runat="server" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="4" AllowSorting="True" PageSize="3" OnSortCommand="grid_SortCommand"> <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle> <SelectedItemStyle ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle> <ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle> <Columns> <asp:ButtonColumn Text="Select" CommandName="Select"></asp:ButtonColumn> </Columns> <PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle> </asp:DataGrid> </fieldset> </ajax:ajaxpanel> </asp:Content> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //fill datagrid (example 2) FillGrid(); } } /// <summary> /// Creates a DataTable and binds to grid /// </summary> private void FillGrid() { //create data System.Data.DataTable dt = new System.Data.DataTable("Person"); dt.Columns.Add("Brand"); dt.Columns.Add("Model"); dt.Rows.Add(new string[] {"BMW", "X3"}); dt.Rows.Add(new string[] {"Citroen", "Berlingo"}); dt.Rows.Add(new string[] {"Fiat", "Punto"}); dt.Rows.Add(new string[] {"Mercedes", "E Class"}); dt.Rows.Add(new string[] {"Opel", "Zafira"}); dt.Rows.Add(new string[] {"Peugeot", "206"}); dt.Rows.Add(new string[] {"Volvo", "V70"}); dt.Rows.Add(new string[] {"VW", "Golf"}); System.Data.DataView dv = dt.DefaultView; //sort data dv.Sort = SortExpression; //bind data grid.DataSource = dv; grid.DataBind(); } /// <summary> /// SortExpression of the grid (stored in ViewState!) /// </summary> private string SortExpression { get { if (ViewState["_grid_SortExpression"] != null) { return (string)ViewState["_grid_SortExpression"]; } else { return "Brand asc"; //default } } set { ViewState["_grid_SortExpression"] = value; } } private void grid_SortCommand(object source, DataGridSortCommandEventArgs e) { string[] currentSort = SortExpression.Split(' '); if (currentSort[0] != e.SortExpression) { grid.SelectedIndex = -1; SortExpression = e.SortExpression + " asc"; } else { SortExpression = string.Format("{0} {1}", e.SortExpression, currentSort[1] == "desc" ? "asc" : "desc"); } //refill datagrid FillGrid(); } </script> |
From: Dion O. <dol...@us...> - 2005-12-09 09:45:30
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19561/magicajax/Examples/ExampleSite (.NET 2.0 only)/images Added Files: first.GIF last.GIF next.gif pow_by_aspnet2.0.gif prev.GIF Log Message: Added example site for .NET 2.0 --- NEW FILE: pow_by_aspnet2.0.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: first.GIF --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: last.GIF --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev.GIF --- (This appears to be a binary file; contents omitted.) |
From: Dion O. <dol...@us...> - 2005-12-09 09:45:30
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/webparts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19561/magicajax/Examples/ExampleSite (.NET 2.0 only)/webparts Added Files: Calendar.ascx Logo.ascx Log Message: Added example site for .NET 2.0 --- NEW FILE: Calendar.ascx --- <%@ Control Language="C#" %> <%@ Implements Interface="System.Web.UI.WebControls.WebParts.IWebPart" %> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/pow_by_aspnet2.0.gif" /> <script runat="server"> public string CatalogIconImageUrl { get { return null; } set { } } public string Description { get { return null; } set { } } public string Subtitle { get { return null; } set { } } public string Title { get { return "Logo"; } set { } } public string TitleIconImageUrl { get { return null; } set { } } public string TitleUrl { get{ return null; } set{ } } </script> --- NEW FILE: Logo.ascx --- <%@ Control Language="C#" %> <%@ Implements Interface="System.Web.UI.WebControls.WebParts.IWebPart" %> <asp:Calendar ID="Calendar1" runat="server" /> <script runat="server"> public string CatalogIconImageUrl { get { return null; } set { } } public string Description { get { return null; } set { } } public string Subtitle { get { return null; } set { } } public string Title { get { return "Calendar"; } set { } } public string TitleIconImageUrl { get { return null; } set { } } public string TitleUrl { get{ return null; } set{ } } </script> |
From: Dion O. <dol...@us...> - 2005-12-09 09:45:29
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only) In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19561/magicajax/Examples/ExampleSite (.NET 2.0 only) Added Files: Default.aspx MasterPage.master Web.Config Web.sitemap readme.txt Log Message: Added example site for .NET 2.0 --- NEW FILE: Web.Config --- <?xml version="1.0"?> <configuration> <configSections> <section name="magicAjax" type="MagicAjax.Configuration.MagicAjaxSectionHandler, MagicAjax"/> </configSections> <magicAjax tracing="false"> <pageStore/> </magicAjax> <system.web> <authentication mode="Forms" /> <pages> <controls> <add namespace="MagicAjax.UI.Controls" assembly="MagicAjax" tagPrefix="ajax"/> <add src="~/webparts/Logo.ascx" tagPrefix="uc1" tagName="Logo"/> <add src="~/webparts/Calendar.ascx" tagPrefix="uc1" tagName="Calendar"/> </controls> </pages> <webParts> <personalization defaultProvider="SessionPersonalizationProvider"> <providers> <clear/> <add name="SessionPersonalizationProvider" type="SessionPersonalizationProvider" applicationName="/"/> </providers> </personalization> </webParts> <httpModules> <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/> </httpModules> <compilation debug="true" /> </system.web> </configuration> --- NEW FILE: Web.sitemap --- <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description=""> <siteMapNode url="examples/Basic.aspx" title="1. Basic controls using MagicAjax" description="" /> <siteMapNode url="examples/DataGrid.aspx" title="2. DataGrid using MagicAjax" description="" /> <siteMapNode url="examples/MasterDetail.aspx" title="3. GridView & DetailsView using MagicAjax" description="" /> <siteMapNode url="examples/WebParts.aspx" title="4. WebPartManager using MagicAjax" description="" /> <siteMapNode url="examples/Wizard.aspx" title="5. Wizard control using MagicAjax" description="" /> <siteMapNode url="examples/CallbackTimer.aspx" title="6. Windows Processes (using MagicAjax Callback Timer)" description="" /> </siteMapNode> </siteMap> --- NEW FILE: MasterPage.master --- <%@ Master Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <style type="text/css"> body { font-family:verdana; font-size:small; margin-top: 0px; } fieldset { width: 700px; padding:10px 10px; } legend { padding:10px 0px 10px 0px; } </style> </head> <body> <form id="form1" runat="server"> <fieldset> <legend><b>MagicAjax.NET Examples for ASP.NET 2.0</b> (.NET version <%= System.Environment.Version %>)<br />Please select one of the demo pages:</legend> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" /> <asp:Menu ID="Menu1" DataSourceID="SiteMapDataSource1" runat="server" StaticSelectedStyle-BorderStyle="Dotted" StaticSelectedStyle-BorderWidth="2px" StaticSelectedStyle-BorderColor="Green" StaticSelectedStyle-Font-Bold="true" /> </fieldset> <hr style="border-style:dashed; border-color:black;" /> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" /> <ajax:ajaxpanel ID="AjaxSourcePanel" runat="server"> <br /><hr style="border-style:dashed; border-color:black;" /> <asp:LinkButton ID="ShowSource" runat="server" Text="Show Source" OnClick="ShowSource_Click" /> <pre runat="server" id="SourceSpan" style="background-color:PapayaWhip" /> </ajax:ajaxpanel> </form> </body> </html> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { AjaxSourcePanel.Visible = !Request.RawUrl.ToLowerInvariant().EndsWith("/default.aspx"); } protected void ShowSource_Click(object sender, EventArgs e) { //read current aspx source, and put in SourceSpan SourceSpan.InnerHtml = HttpUtility.HtmlEncode(System.IO.File.ReadAllText(Request.PhysicalPath).Replace("\t", " ")); } </script> --- NEW FILE: readme.txt --- Step 1: create a virtual dir in IIS, and map to this folder note: make sure the virtual dir runs with .NET 2.0. Step 2: place MagicAjax.dll in the Bin folder Now you should be able to run the demo pages --- NEW FILE: Default.aspx --- <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" %> |
From: Dion O. <dol...@us...> - 2005-12-09 09:45:29
|
Update of /cvsroot/magicajax/magicajax/Examples/ExampleSite (.NET 2.0 only)/App_Code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19561/magicajax/Examples/ExampleSite (.NET 2.0 only)/App_Code Added Files: SessionPersonalizationProvider.cs Log Message: Added example site for .NET 2.0 --- NEW FILE: SessionPersonalizationProvider.cs --- (This appears to be a binary file; contents omitted.) |