Solved

How to pass variable from master page to contents page on postback?

Posted on 2007-12-07
3
2,066 Views
Last Modified: 2009-04-05
Hi All,
My master page has a dropdown box with a submit button.
When user clicks the button I need to send selecteditem's value  to the contents page's page_load event.

Can someone please give me the *** code ***, preferably in C#.

Much appreciated.

Thanks
0
Comment
Question by:ctncomms
3 Comments
 
LVL 4

Expert Comment

by:scorpiia
Comment Utility
To send the parameters:
Response.Redirect("StaffProfile.aspx?StaffID=" + parameter.ToString());

StaffProfile is the page you want to redirected to.
Parameter is the one you want to pass


To get the Parameters:

 parameter= int.Parse(Request.Params.Get("StaffID").ToString());

you don't need to use Int, the data type can be different
0
 

Author Comment

by:ctncomms
Comment Utility
Hi Scorpiia,
I can not use querystring or cookies or sessions.

Thanks for your time.

Any other approach? like using properties? or whatever?

0
 
LVL 37

Accepted Solution

by:
samtran0331 earned 500 total points
Comment Utility
Yes, properties (variables, controls, events) made public can be read between a master/content page.
This is a nice, short article on it:
http://aspnet.4guysfromrolla.com/articles/013107-1.aspx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now