Update of /cvsroot/magicajax/MagicAjax NET 1.1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26255/MagicAjax NET 1.1
Modified Files:
MagicAjax.csproj MagicAjaxModule.cs Web.config
Log Message:
- Made changes for using CallBackObject.js as embedded resource
- added a MagicAjax example page (with master/detail dropdowns and a datagrid)
Index: Web.config
===================================================================
RCS file: /cvsroot/magicajax/MagicAjax NET 1.1/Web.config,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Web.config 2 Nov 2005 21:53:00 -0000 1.2
--- Web.config 3 Nov 2005 21:28:21 -0000 1.3
***************
*** 8,12 ****
<!-- MagicAjax configuration :
! callBackScriptPath - the path for "CallBackObject.js", default is "~/script"
pageStore/mode - "NoStore" : Doesn't keep the page object, it is recreated for each callback
"Session" : Saves the page object in session, works only for "InProc" SessionState
--- 8,13 ----
<!-- MagicAjax configuration :
! [Optional] callBackScriptPath - Alternative path for "CallBackObject.js"
! If omitted, the embedded "CallBackObject.js" file is used (default).
pageStore/mode - "NoStore" : Doesn't keep the page object, it is recreated for each callback
"Session" : Saves the page object in session, works only for "InProc" SessionState
***************
*** 19,24 ****
pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages
limit is reached. Default is false -->
! <magicAjax
! callBackScriptPath="~/script">
<pageStore
mode="Session"
--- 20,24 ----
pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages
limit is reached. Default is false -->
! <magicAjax>
<pageStore
mode="Session"
Index: MagicAjax.csproj
===================================================================
RCS file: /cvsroot/magicajax/MagicAjax NET 1.1/MagicAjax.csproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MagicAjax.csproj 24 Oct 2005 23:41:39 -0000 1.1
--- MagicAjax.csproj 3 Nov 2005 21:28:21 -0000 1.2
***************
*** 149,152 ****
--- 149,156 ----
/>
<File
+ RelPath = "Examples\Examples.aspx"
+ BuildAction = "Content"
+ />
+ <File
RelPath = "Interfaces\ICallBackEventHandler.cs"
SubType = "Code"
***************
*** 174,178 ****
<File
RelPath = "script\CallBackObject.js"
! BuildAction = "Content"
/>
<File
--- 178,182 ----
<File
RelPath = "script\CallBackObject.js"
! BuildAction = "EmbeddedResource"
/>
<File
Index: MagicAjaxModule.cs
===================================================================
RCS file: /cvsroot/magicajax/MagicAjax NET 1.1/MagicAjaxModule.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MagicAjaxModule.cs 24 Oct 2005 23:41:39 -0000 1.1
--- MagicAjaxModule.cs 3 Nov 2005 21:28:21 -0000 1.2
***************
*** 151,157 ****
// Provides the location of the script file.
string location = _config.ScriptPath;
! // Create client script block.
! string includeScript = String.Format("<script language=\"javascript\" src=\"{0}/{1}\"></script>", location, "CallBackObject.js");
page.RegisterClientScriptBlock( "CALLBACK_FOR_AJAX", includeScript );
--- 151,169 ----
// Provides the location of the script file.
string location = _config.ScriptPath;
+ string includeScript;
! // If script location is null, use embedded CallBackObject.js file
! if (location == null)
! {
! using (System.IO.StreamReader reader = new System.IO.StreamReader(typeof(MagicAjaxModule).Assembly.GetManifestResourceStream("MagicAjax.script.CallBackObject.js")))
! {
! includeScript = "<script language=\"javascript\" type=\"text/javascript\">\r\n<!--\r\n" + reader.ReadToEnd() + "\r\n//-->\r\n</script>";
! }
! }
! else
! {
! // Point to external script source file
! includeScript = String.Format("<script language=\"javascript\" src=\"{0}/{1}\"></script>", location, "CallBackObject.js");
! }
page.RegisterClientScriptBlock( "CALLBACK_FOR_AJAX", includeScript );
|