Click here to Skip to main content
11,578,241 members (63,598 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads
Add your own
alternative version

Implement Script Callback Framework in ASP.NET 1.x

, 2 Aug 2004 334.5K 4.2K 123
It allows calls to server events from client script code without causing the page to post back and refresh.
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Employee.ascx.cs" Inherits="ScriptCallbackFramework.Employee" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<HTML>
	<HEAD>
		<script language="javascript">
	function ShowEmployeeDetailHandler(responseText, context) {
		if (context != null)
			context.innerHTML = responseText;
	}
	
	function ShowEmployeeErrorHandler(responseText, context) {
		alert(responseText);
		if (context != null)
			context.innerHTML = "";				
	}
		</script>
	</HEAD>
	<body>
		<P>
			<asp:Label id="Label1" runat="server" Font-Names="Arial">Please select an employee to see the his/her information</asp:Label><BR>
			<SELECT style="WIDTH: 160px" runat="server" id="employeeList">
				<OPTION selected></OPTION>
			</SELECT>
		</P>
		<P>
			<asp:Label id="LabelTitle" runat="server" Font-Names="Arial">
				<B>Employee Information</B></asp:Label>
			<br>
		</P>
		<DIV style="DISPLAY: inline; WIDTH: 100%; HEIGHT: 100%" ms_positioning="FlowLayout" runat="Server"
			id="txtEmployeeDetail"></DIV>
		<P></P>
		<P></P>
	</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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Elvin Cheng
Singapore Singapore
Elvin Cheng is currently living in Woodlands, Singapore. He has been developing applications with the .NET Framework, using C# and ASP.NET since October 2002. Elvin specializes in building Real-time monitoring and tracking information system for Semi-conductor manufacturing industry. During his spare time, he enjoys reading books, watching movie and gym.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 3 Aug 2004
Article Copyright 2004 by Elvin Cheng
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid