Click here to Skip to main content
11,481,265 members (65,033 online)
Click here to Skip to main content
Articles » Web Development » Ajax » General » Downloads
Add your own
alternative version

Ajaxion - Standalone AJAX - Part 2 of 2 - C# and Java Example

, 22 Jan 2013 CPOL 35.9K 1.2K 41
An article about how to keep AJAX simple as it is and get the most out of it.
ajaxiontest1.0_java_src.zip
AjaxionTest
ajaxionTest.jpr
ajaxionTest.jpr.bak
AjaxionTest.jws
classes
ajaxionTest.cdi
pw
ajaxion
AjaxionEventConsumer.class
log
FileLog.class
servlet
ajaxionTest.class
servlet.cdi
public_html
css
images
processing.gif
ready.jpg
js
WEB-INF
pw.ajaxion
classes
pw
ajaxion
AjaxionEventConsumer.class
AjaxionEventHandler.class
pw.ajaxion.cdi
pw.ajaxion.jpr
src
pw
ajaxion
pw.log
classes
audit.log
pw
log
FileLog.class
pw.log.cdi
test
pw
log
FileLogTest.class
pw.log.jpr
src
pw
log
test
pw
log
src
servlet
ajaxiontest1.0_net1.1_src.zip
Ajaxion
Ajaxion.csproj.user
Ajaxion.ico
js
AjaxionTest.csproj.webinfo
Audit
Audit.csproj.user
Audit.ico
css
Global.asax
images
AjaxFlavour1.gif
AjaxFlavour2.gif
AjaxFlavour3.jpg
App.ico
HappyAccountant.jpg
processing.gif
ready.JPG
js
ajaxiontest1.0_net2.0_src.zip
Ajaxion.csproj.user
Ajaxion.ico
App_Code
Audit.csproj.user
Audit.ico
Global.asax
AjaxFlavour1.gif
AjaxFlavour2.gif
AjaxFlavour3.jpg
App.ico
HappyAccountant.jpg
processing.gif
ready.JPG
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="AjaxionTest.Default" enableViewState="False"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>Default</title> 
		<!--META HTTP-EQUIV="Pragma" CONTENT="no-cache"-->
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<script src="Ajaxion/js/ajaxion.js" type="text/javascript"></script>
		<script src="js/DefaultAspx_AjaxionEvents.js" type="text/javascript"></script>
	</HEAD>
	<body bgcolor="lavender">
		<form id="Form1" style="WIDTH: 100%; POSITION: static; HEIGHT: 100%" method="post" runat="server">
			<table id="Table1" height="100%" cellspacing="0" cellpadding="0" width="100%" align="center"
				border="0">
				<tr>
					<td style="FONT-WEIGHT: bold" align="center" bgcolor="silver" height="30">
						<table id="tblStatus" cellspacing="5" cellpadding="0" border="0">
							<tr>
								<td>
									<asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label></td>
								<td>
									<div id="status" style="DISPLAY: inline; FONT-WEIGHT: bold">
										Ready</div>
									&nbsp;
								</td>
								<td>
									<img id="statusImg" style="WIDTH: 150px; HEIGHT: 17px; BACKGROUND-COLOR: silver" height="17"
										width="150" src="images/ready.JPG" border="1"></td>
								<td style="BORDER-LEFT: black thin solid">
									&nbsp;<asp:HyperLink ID="lnDragDrop" runat="server" NavigateUrl="DragDrop.aspx" Font-Bold="True" ForeColor="Blue"> Drag'n Drop demo</asp:HyperLink></td>
								<td style="BORDER-LEFT: black thin solid">
									&nbsp;
									<asp:HyperLink ID="lnControlDemo" runat="server" ForeColor="Blue" Font-Bold="True" NavigateUrl="UseWebUserCtrl.aspx"> Control demo</asp:HyperLink></td>
								<td style="BORDER-LEFT: black thin solid">
									&nbsp;
									<asp:HyperLink ID="lnStandaloneAjax" runat="server" ForeColor="Blue" Font-Bold="True" NavigateUrl="standaloneAjax.htm"> Standalone Ajax demo</asp:HyperLink></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td style="FONT-WEIGHT: bold" align="center" bgcolor="whitesmoke" height="35">
						Text:
						<asp:TextBox ID="text" runat="server" EnableViewState="False" Width="200px" BorderWidth="2px"
							BorderStyle="Inset" Height="25px"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Text 
						from ajax call:
						<asp:TextBox ID="result" runat="server" ForeColor="Black" EnableViewState="False" Width="200px"
							BorderWidth="1px" BorderStyle="Solid" Height="25px" ReadOnly="True"></asp:TextBox></td>
				</tr>
				<tr>
					<td align="center" bgcolor="whitesmoke" height="35">
						<asp:Button ID="btnShowTextAspNet" runat="server" EnableViewState="False" Width="227px" Text="Show Text - Asp.Net normal POST"
							ForeColor="#C000C0" OnClick="btnShowTextAspNet_Click"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="btnShowTextAjaxSamePage" style="WIDTH: 199px; HEIGHT: 24px" onclick="ajaxion.postUrl('Default.aspx', 'textTest', GetTextCallback)"
							type="button" value="Show Text - Ajax call this page" size="20" disabled>&nbsp;
						<input id="btnShowTextAjaxOtherPage" style="WIDTH: 203px; HEIGHT: 24px" onclick="ajaxion.getUrl('AjaxCallbackPage.aspx?dummy=params already', 'textTest', GetTextCallback)"
							type="button" value="Show Text - Ajax call other page"></td>
				</tr>
				<tr>
					<td align="center" bgcolor="gainsboro">
						<table id="Table2" bordercolor="silver" cellspacing="0" cellpadding="1" width="100%" border="1">
							<tr>
								<td align="center">
									<input id="btnXmlTest" style="WIDTH: 136px; HEIGHT: 24px" onclick="ajaxion.postUrl('AjaxCallbackWs.asmx/GetXmlHtml', 'xmlTest', GetXmlHtmlCallback)"
										type="button" value="Call WS - XML Test" name="btnXmlTest"></td>
								<td align="center">
									<div id="divHost">
										Receive data here.</div>
								</td>
								<td align="center">
									<input id="btnXmlTestClear" style="WIDTH: 136px; HEIGHT: 24px" onclick="ajaxion.postUrl('AjaxCallbackWs.asmx/GetXmlHtml', 'xmlTestClear', GetXmlHtmlCallback)"
										type="button" value="Clear XML Test" name="btnXmlTestClear"></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td style="FONT-WEIGHT: bold" align="center" bgcolor="#ffcccc" height="30">
						<input id="btnStart" style="WIDTH: 92px; HEIGHT: 24px" onclick="ajaxion.postUrl('AjaxCallbackWs.asmx/GetLevel', 'showLevel', ShowLevelCallback)"
							type="button" value="Start Thread">&nbsp;&nbsp;&nbsp;<asp:TextBox ID="level" runat="server" Font-Bold="True" ForeColor="#0000C0" EnableViewState="False"
							Width="204px" BorderWidth="1px" BorderStyle="Solid" Height="24px" ReadOnly="True" BackColor="#E0E0E0" Font-Size="Small"></asp:TextBox>&nbsp;&nbsp;
						<input id="btnStop" style="WIDTH: 135px; HEIGHT: 24px" onclick="ajaxion.postUrl('AjaxCallbackWs.asmx/ResetLevel', 'resetLevel', ResetLevelCallback)"
							type="button" value="Stop / Reset Thread"></td>
				</tr>
				<tr>
					<td style="FONT-WEIGHT: bold" align="center" bgcolor="lightsteelblue" height="30">
						Get image from WS:&nbsp;
						<select id="dropDown" style="WIDTH: 155px">
							<option value="HappyAccountant.jpg" selected>HappyAccountant.jpg</option>
							<option value="AjaxFlavour1.gif">AjaxFlavour1.gif</option>
							<option value="AjaxFlavour2.gif">AjaxFlavour2.gif</option>
							<option value="AjaxFlavour3.jpg">AjaxFlavour3.jpg</option>
						</select>
						&nbsp;&nbsp;&nbsp;<input id="btnAjaxWsGetImgUrl_ie6" style="WIDTH: 131px; COLOR: red; HEIGHT: 24px" type="button"
							value="Get as url (IE only)" runat="server">&nbsp;&nbsp;<input id="btnAjaxWsGetImgUrl" style="WIDTH: 77px; HEIGHT: 24px" type="button" value="Get as url"
							name="Button1" runat="server">&nbsp;<input id="btnAjaxWsGetImgBinary" style="WIDTH: 77px;
								HEIGHT: 24px" type="button" value="Get binary" runat="server"></td>
				</tr>
				<tr>
					<td align="center" bgcolor="#b0c4de" height="100%">
						<img id="image" title="HappyAccountant.jpg" src="images/HappyAccountant.jpg">
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

radumi
Software Developer
New Zealand New Zealand
Coder

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 22 Jan 2013
Article Copyright 2008 by radumi
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid