Solved

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

Posted on 2007-12-07
3
2,074 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
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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

777 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