473,387 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Context.Handler ?

I'm studying for C# Cert and i found a question about Context.Handler and i
didn't understand.
Could someone please explain me when and how do i use ?
I'd like to make webapplication here for understanding better! wich kind of
webapplication could i do ?

Thanks in advance,

--
Daniel Groh
CTF Technologies do Brasil LTDA
Analista Programador
Fone: 11 3837-4203
E-mail: dg***@ctf.com.br
Nov 17 '05 #1
1 10002
Context handler is one the many ways of exchanging data between aspx pages.
See the example below. It work with Server.Transfer only.

public class Context1 : System.Web.UI.Page
{
// Create a property to return the value of a text box.
internal string Value
{
get
{
return txtValue.Text;
}
}

private void butNext_Click(object sender, System.EventArgs e)
{
// Transfer to the next page.
Server.Transfer("Context2.aspx");
}
}
public class Context2 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
// Declare an object using the previous page's type.
Context1 LastPage;
// Coerce the Context.Handler object to the page's type.
LastPage = (Context1)Context.Handler;
// Display the Value property.
lblValue.Text = LastPage.Value;
}
}

private void butBack_Click(object sender, System.EventArgs e)
{
// Transfer back to the preceding page.
Server.Transfer("Context1.aspx");
}
}
JB
Nov 17 '05 #2

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

Similar topics

1
by: | last post by:
I am wondering if I have a single destination page, and 2 or more source pages, is there a way to tell which type of class is currently in the context.Handler? So if i am on the destination...
9
by: Albert Wagner | last post by:
What is the evaluation context of the setTimeout args below? I have a separate Timer instance for each sprite in my program. As coded, "this.Clock" doesn't work. Thanks ahead for any advice. ...
0
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler"...
0
by: VP | last post by:
G'day folks, well i am attempting to get an understanding on how to create the menuitems in a context menu on the fly. So far I have managed to actually achieve the menu items being created for...
1
by: Dennis | last post by:
I'm using VS 2003 my project uses COM interop and the Tao Framework. I have a custom control derived from UserControl. It implements many functions similar to the Tao's SimpleOpenGLControl, for...
8
by: Steph | last post by:
Hi, Is it better to use the URL method to send informations to a page, or to use the context method ? Thanks.
5
by: james | last post by:
Hello, I am having a little trouble creating an event handler for a context menu toolstripmenuitem. I've seen various tutorials and so on, but I keep getting a bit stuck! So far I have a second...
2
by: deepak.bhardwaj | last post by:
Hi, I have implemented the IHttpHandler interface for generating images and writing them to response stream in binary format. I use an IHttpHandlerFactory to instantiate that handler. A .aspx...
0
by: superman | last post by:
Hi, I have implemented the IHttpHandler interface for generating images and writing them to response stream in binary format. I use an IHttpHandlerFactory to instantiate that handler. A .aspx...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.