473,626 Members | 3,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2.0 Master page: Where to Set/Get session value?

Hi all,

I've got a DropDownList for the connection string in a master page.
Transitioning between content pages causes it to reset to the first
value.

Under what conditions and where should I do the following?

1 - Initialize the DropDownlist.
2 - Set the default SelectedIndex value.
2 - Save the SelectedIndex value in session variable
3 - Retrieve the session value.

Down below is a trace of the flow.

Thanks...

------------------------------------------------------------
TestPage::TestP age
MyMasterPage::M yMasterPage
MyMasterPage::M yMasterPage_Ini t:!IsPostBack
MyMasterPage::M yMasterPage_Ini t:SelectedIndex (1)
TestPage::TestP age_Init:!IsPos tBack
TestPage::TestP age_Load:!IsPos tBack
MyMasterPage::M yMasterPage_Loa d:!IsPostBack

------------------------------------------------------------
TestPage::TestP age
MyMasterPage::M yMasterPage
MyMasterPage::M yMasterPage_Ini t:IsPostBack
MyMasterPage::M yMasterPage_Ini t:SelectedIndex (0)
TestPage::TestP age_Init:IsPost Back
TestPage::TestP age_Load:IsPost Back
MyMasterPage::M yMasterPage_Loa d:IsPostBack
MyMasterPage::C onnectionString DDL_SelectedInd exChanged FIRED
MyMasterPage::F ireing off Index(0)
ConnStrChangedE ventArgs::ConnS trChangedEventA rgs (0)
TestPage::Maste r_ConnStrChange d

------------------------------------------------------------
TestPage::TestP age
MyMasterPage::M yMasterPage
MyMasterPage::M yMasterPage_Ini t:!IsPostBack
MyMasterPage::M yMasterPage_Ini t:SelectedIndex (1)
TestPage::TestP age_Init:!IsPos tBack
TestPage::TestP age_Load:!IsPos tBack
MyMasterPage::M yMasterPage_Loa d:!IsPostBack

------------------------------------------------------------
TestPage::TestP age
MyMasterPage::M yMasterPage
MyMasterPage::M yMasterPage_Ini t:IsPostBack
MyMasterPage::M yMasterPage_Ini t:SelectedIndex (0)
TestPage::TestP age_Init:IsPost Back
TestPage::TestP age_Load:IsPost Back
MyMasterPage::M yMasterPage_Loa d:IsPostBack
MyMasterPage::C onnectionString DDL_SelectedInd exChanged FIRED
MyMasterPage::F ireing off Index(0)
ConnStrChangedE ventArgs::ConnS trChangedEventA rgs (0)
TestPage::Maste r_ConnStrChange d

Jul 28 '06 #1
0 1337

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

Similar topics

14
2390
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a standard ASPX page with minor modifications to it. All of my pages inherit from a "BasePage.cs" class, that handles common things like getting the user's information out of the session, determines if a page should or should not be password...
5
3112
by: Juanjo | last post by:
I need to know how to maintain de status (nodes expanded and selected) of a treeview in a master page. I have a master page with a treeview. I have a default page, when the treeview is expanded and a node is selected then redirects to a another page Response.Redirect("Page2.aspx") And run's ok, but the treeview in this page is colapsed. The treeview maintain its aspect, the images for the nodes, etc, but is colapsed and
8
1412
by: William Buchanan | last post by:
Hi folks I have a "Search" text box and LinkButton in my master page. When this is submitted, I do a Server.Transfer to a page which contains a gridview. The gridview is filtered on a hidden field which I set in the page load method (from the search text box text). Now, the grid view appears to filter correctly, however, when I select a record in the gridview to populate a DetailsView, I loose the original filter and so the returned...
1
2941
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is browsed to, I need to check to see if the user has logged in or not. Then if they have logged in, I need to pull their information from the database to display in the header. In previous applications, I made use of a base web page that all the...
9
16265
by: ad | last post by:
Hi, How can I dynamically change the MasterPager of a web page?
4
4331
by: Sam | last post by:
I have an asp.net 2.0 app that uses a sitemap, Master Page, and has several content pages. While this feature has simplified the process of creating a data-driven site menu, it does seem to have some big restrictions. Namely, maintaining state on the Master Page across all content pages. I simply want to keep track of a key value across all content pages. The only solution I can come up with is using a session variable, which I hate.
6
4180
by: Matt | last post by:
On my master page i have build 5 link buttons. First Page I receive ID and set the ID in master page Property so i can do the work with it. How ever when i clicked to second button i lose this ID. How would i keep this ID thru these 5 pages. so i wont lose this ID.. Master.page link1 link2 link3, public string AppID { get { return Label1.Text; }
13
5305
by: Kirk | last post by:
I have been reading Scott Allen's article on Master Pages (http:// odetocode.com/Articles/450.aspx) but I am having problems understanding a concept. Specifically, I have created a property (called "CurFlag") on my master page that can be accessed from content pages, but not from separate code modules. I tried doing something like this in my VB code module: Dim myMaster As MasterPage = CType(ProjectMgmt.Master, MasterPage)
4
7647
by: Ganesh | last post by:
I've couple of button on master page, based on user login from default.aspx i control visibility of controls. I thought once i hide the button from default.aspx it should be same for other pages aswell. but it doesn't. it works only for default.aspx only. How can i do that? do i need refresh master page or call my condition in every page to setup master's button visiblity Thanks Ganapathi
1
4873
by: hemantkamb | last post by:
Hi…. I have created one website with Master and content page . I have taken TreeView Control on master page. And I wants that when I click to tree node the value of tree node is added to Session and data from database regarding to that tree node value. Will fetch the records and load that on content page on Content Page Load event. But the problem is that When click tree node the fallowing events occurs ...
0
8192
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
8637
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
8358
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
7188
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5571
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
4090
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...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
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
2
1504
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.