473,699 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quickie: definition of "context"?

Roy
From the MS site:
NAME: ClientScriptMan ager.GetCallbac kEventReference (Control, String,
String, String)
DESCRIPTION: Obtains a reference to a client-side function that, when
invoked, initiates a client call back to a server-side event. The
client-side function for this overloaded method includes a specified
control, argument, client-side script, and context.

What is "context?"

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Jan 26 '06 #1
1 1483
Roy,
the Documentation for GetCallBackEven tReference describes all the parameters
and even provides code samples:

http://msdn2.microsoft.com/library/m...us,vs.80).aspx

"Context" is the client-side script that is evaluated on the client prior to
initiating the callback. The result of the script is passed back to the
client-side event handler.

The example shows the creation (excerpt):

// Define one of the callback script's context.
// The callback script will be defined in a script block on the page.
StringBuilder context1 = new StringBuilder() ;
context1.Append ("function ReceiveServerDa ta1(arg, context)");
context1.Append ("{");
context1.Append ("Message1.inne rText = arg;");
context1.Append ("value1 = arg;");
context1.Append ("}");

// Define callback references.
String cbReference1 = cs.GetCallbackE ventReference(t his, "arg",
"ReceiveServerD ata1", context1.ToStri ng());
String cbReference2 = cs.GetCallbackE ventReference(" '" +
Page.UniqueID + "'", "arg", "ReceiveServerD ata2", "",
"ProcessCallBac kError", false);
String callbackScript1 = "function CallTheServer1( arg, context) {" +
cbReference1 + "; }";
String callbackScript2 = "function CallTheServer2( arg, context) {" +
cbReference2 + "; }";

// Register script blocks will perform call to the server.
cs.RegisterClie ntScriptBlock(t his.GetType(), "CallTheServer1 ",
callbackScript1 , true);
cs.RegisterClie ntScriptBlock(t his.GetType(), "CallTheServer2 ",
callbackScript2 , true);

--Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Roy" wrote:
From the MS site:
NAME: ClientScriptMan ager.GetCallbac kEventReference (Control, String,
String, String)
DESCRIPTION: Obtains a reference to a client-side function that, when
invoked, initiates a client call back to a server-side event. The
client-side function for this overloaded method includes a specified
control, argument, client-side script, and context.

What is "context?"

Thanks

*** Sent via Developersdex http://www.developersdex.com ***

Jan 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5215
by: john bailo | last post by:
I wrote a c# program that does some file manipulation on a remote server. Testing it from my workstation, it ran fine. When I copied it to another server, and ran it from there, on load, it threw a balloon message: "This application is running in a partially trusted context. Some functionality in the application may be disabled due to
0
2459
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's context menu when you right-click over a folder (or the drive root). The menu item text is "Open .Net Command Window Here". When you click it, it opens a command window positioned at that directory and runs the vsvars32.bat file to set the .Net Framework environment variable settings. This makes it...
8
19260
by: H. S. | last post by:
I am getting this error if I try to compile the file demarcated below. What I am missing here? I am using g++ (GCC) 3.3.5 (Debian 1:3.3.5-8). {tp2}> g++ -ansi -g -Wall tp2.cc -o tp2 tp2.cc: In member function `void Other::DoSomething()': tp2.cc:11: error: `int Base::iX' is protected tp2.cc:29: error: within this context // %< %< ----------------------------------- %< %<
2
55605
by: Eirik M. | last post by:
Hi, I've got the following piece of code that's causing me a bit of a problem XmlDocument doc = new XmlDocument (); XmlNode rootNode = doc.CreateNode (XmlNodeType.Element, "usersettings", null); User user = new User (userid); XmlNode rolesNode = user.GetRoles (); rootNode.AppendChild (rolesNode);
5
72279
by: Horst Walter | last post by:
What is wrong here? IPAddress ipAddress = IPAddress.Parse("10.10.20.1"); IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, this.port); this.tcpClient = new TcpClient(ipEndPoint); // PROBLEM HERE => Exception: "The requested address is not valid in its context" This works:
3
1635
by: trint | last post by:
Here is the "catch exception" message: "The requested lookup key was not found in any active activation context" Here is where it happens: public void DoRead(IAsyncResult ar) { int BytesRead; string strMessage;
5
3075
by: | last post by:
Hoping someone can help with a simple but puzzling problem. I have some code that I want to build as a class method. The code works fine when I embed it in Page_Load. But when I try to generalize the code into the method of a class I am trying to build, it gives me strange errors: "CS0103: The name 'Server' does not exist in the current context". (Server being a call to Server.MapPath.) I'm working in ASP.NET 2.0 and VS.NET 2005. ...
0
1491
by: Blasting Cap | last post by:
I had some old code set to throw an email to me when a user hit an exception. VS 2003 worked fine with the code, VS 2005 when I run it in debug mode pauses over the code each time, and gives me the message: "HTTPException was unhandled by user code. Request Not Available in this context." This is the code that it says it doesn't like:
2
9916
by: Jeff | last post by:
hey asp.net 2.0 (C'#) In the code behind file I have this method: public String AddBR(Object param) { String text = (String) param; return text; }
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.