Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-12-07
3
Medium Priority
?
2,095 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Expert Comment

by:scorpiia
ID: 20426896
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
ID: 20426912
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 2000 total points
ID: 20427143
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

730 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