Good morning,
I create an ASP.NET 2.0 web application. The situation:
1. One masterpage where the users can select an organisation in a
DropDownList.
2. Different content pages.
I will get the value of the DropDownList in the Page_PreInit event. How
can I do that? The content in the content and master pages is based on
the selected value of the DrowDownList.
Kind regards,
Lammert 9 3409
"Lammert" <lv****@hotmail .com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. . I create an ASP.NET 2.0 web application. The situation:
1. One masterpage where the users can select an organisation in a DropDownList. 2. Different content pages.
I will get the value of the DropDownList in the Page_PreInit event. How can I do that? The content in the content and master pages is based on the selected value of the DrowDownList.
Store the selected value from the DropDownList in a Session variable.
Mark Rae schreef: "Lammert" <lv****@hotmail .com> wrote in message news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
I create an ASP.NET 2.0 web application. The situation:
1. One masterpage where the users can select an organisation in a DropDownList. 2. Different content pages.
I will get the value of the DropDownList in the Page_PreInit event. How can I do that? The content in the content and master pages is based on the selected value of the DrowDownList.
Store the selected value from the DropDownList in a Session variable.
Hi,
When must I store the selected value from the DropDownList in a Session
variable? When I add a SelectIndex_Cha nged event to the DropDownList,
this event is handled after the Page_Init event. How can I do this?
"Lammert" <lv****@hotmail .com> wrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. . Store the selected value from the DropDownList in a Session variable.
Hi,
When must I store the selected value from the DropDownList in a Session variable? When I add a SelectIndex_Cha nged event to the DropDownList, this event is handled after the Page_Init event. How can I do this?
When the user selects a different organisation, presumably this needs to
change the organisation for all the child pages?
If so, then the child pages need to get the organisation from the Session
variable, not the Master Page.
I will get the value of the selected item of the DropDownList in the
Page_Init event of the Master Page, not the Page_Init event of the
content page. I have a DropDownList (AutoPostback = true), when the
user selects another item in the DropDownList i will get the selected
value in the Page_Init event of the Master Page. That's the question.
Mark Rae schreef: "Lammert" <lv****@hotmail .com> wrote in message news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Store the selected value from the DropDownList in a Session variable.
Hi,
When must I store the selected value from the DropDownList in a Session variable? When I add a SelectIndex_Cha nged event to the DropDownList, this event is handled after the Page_Init event. How can I do this?
When the user selects a different organisation, presumably this needs to change the organisation for all the child pages?
If so, then the child pages need to get the organisation from the Session variable, not the Master Page.
"Lammert" <lv****@hotmail .com> wrote in message
news:11******** **************@ c74g2000cwc.goo glegroups.com.. . I will get the value of the selected item of the DropDownList in the Page_Init event of the Master Page, not the Page_Init event of the content page.
Hmm - even if you EnableViewState for your DropDownList, it's value might
not be available before the Page_Load event...
I have a DropDownList (AutoPostback = true), when the user selects another item in the DropDownList i will get the selected value in the Page_Init event of the Master Page. That's the question.
But then what? When the user selects a different organisation, what do you
want to happen next?
The content in the content pages and master page is based on the
selected value in the DropDownList.
Example:
When the user selects another organization the master page must the
masterpage display another header and title.
The content pages must display other content for that specific
organization.
Mark Rae schreef: "Lammert" <lv****@hotmail .com> wrote in message news:11******** **************@ c74g2000cwc.goo glegroups.com.. .
I will get the value of the selected item of the DropDownList in the Page_Init event of the Master Page, not the Page_Init event of the content page.
Hmm - even if you EnableViewState for your DropDownList, it's value might not be available before the Page_Load event...
I have a DropDownList (AutoPostback = true), when the user selects another item in the DropDownList i will get the selected value in the Page_Init event of the Master Page. That's the question.
But then what? When the user selects a different organisation, what do you want to happen next?
"Lammert" <lv****@hotmail .com> wrote in message
news:11******** **************@ p79g2000cwp.goo glegroups.com.. . The content in the content pages and master page is based on the selected value in the DropDownList.
Example: When the user selects another organization the master page must the masterpage display another header and title. The content pages must display other content for that specific organization.
I'm afraid I *really* can't see what the problem is here...
1) When the value of the DropDownList on the master page changes, it causes
a postback which updates the Session variable with the new organisation.
2) The master page amends its content according to the new value of the
Session variable, which it reads in its Page_Load method
3) The content pages DO NOT get the value of the organistion from the master
page - they get it from the Session variable, same as the master page does.
Mark Rae schreef: "Lammert" <lv****@hotmail .com> wrote in message news:11******** **************@ p79g2000cwp.goo glegroups.com.. .
The content in the content pages and master page is based on the selected value in the DropDownList.
Example: When the user selects another organization the master page must the masterpage display another header and title. The content pages must display other content for that specific organization. I'm afraid I *really* can't see what the problem is here...
1) When the value of the DropDownList on the master page changes, it causes a postback which updates the Session variable with the new organisation.
This is the problem. Where must I update the Session variable. When I
update the Session variable in the event SelectedIndex_C hanged from the
DropDownList the Session variable is updated after the Page_Load event
from the Master page and the Content pages is executed. So the Session
variable is too late updated. I don't know the right solution for this
problem. 2) The master page amends its content according to the new value of the Session variable, which it reads in its Page_Load method
3) The content pages DO NOT get the value of the organistion from the master page - they get it from the Session variable, same as the master page does.
"Lammert" <lv****@hotmail .com> wrote in message
news:11******** **************@ r2g2000cwb.goog legroups.com... This is the problem. Where must I update the Session variable. When I update the Session variable in the event SelectedIndex_C hanged from the DropDownList the Session variable is updated after the Page_Load event from the Master page and the Content pages is executed. So the Session variable is too late updated. I don't know the right solution for this problem.
In the SelectedIndex_C hanged method, do two things:
1) Set the Session variable to the new organisation
2) Reload the page - something like
Response.Redire ct(Request.Url. AbsoluteUri) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Julius Fenata |
last post by:
Dear all,
I have created client-side scripting to trigger event onChange from
code-behind, like this:
DropDownList1.Attributes = "GenerateArticleID()";
At the script on Windows Form, I added this function to have the value of
DropDownList1
|
by: Nathan Sokalski |
last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an event is fired by one of the controls contained in the User Control, these variable are reset. Here is my current code (I have a little more to add later, right now I am just concerned about the variables getting reset):
Public Class DatePicker2...
|
by: ad |
last post by:
Hi,
I have set the this.Page.Theme in a MasterPage, but it no affect.
I have set break point at this line, but it never execute.
void Page_PreInit(object sender, System.EventArgs args)
{
this.Page.Theme = "Web";
}
|
by: Edward |
last post by:
Hi All,
Would anyone know if there is an event similar to the Page_PreInit that I
can code just once, at a global initialization level, that applies to all
pages executed?
Therefore, instead of placing the code below in every page codebehind, I
could code it just once.
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.PreInit
|
by: Francois |
last post by:
Hello,
ASP NET 2.0 visual studio 2005.
I am tryng to create a dynamic dropdownlist in the Page_Load event.
myDDL = new DropDownList
I populate it in the IsPostBack branch of Page_Load.
| |
by: Redhairs |
last post by:
Is it possible to get DropDownList.SelectedValue in Page_PreInit() event
during the postback?
|
by: Chris |
last post by:
Hi,
When choosing a value in the dropdownlist, i try to put that selectedvalue
in the label, but i always get the first value 'a'.
EnableViewState is by default set to true, so ... what's wrong in my code?
Thanks
Chris
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
|
by: Dan |
last post by:
Hi,
I create 5 dropdownlist in code-behind. I want to insert their
selectedvalues in a table by making a string separated with ":"
I can get their selecedvalues but i'm stuck when i want to execute the
insert.
The error is "name dd is not declared" (in line: selvalue = selvalue &
Session("dd" & dd.id) & ":"
Any idea how to solve this?
|
by: Ahmedhussain |
last post by:
Hi there,
I m doing work on a gridview and Im getting an error:
A potentially dangerous Request.Form value was detected from the client (ctl00$Content$GridView1$ctl03$TextBox1="<span class='txtColo...")
Im using an access database. and when ever I try to update this it doesnt work.
<%@ Page Language="C#" MasterPageFile="Mysite.master" Title="Untitled Page" %>
<script runat = "server">
protected void Page_Load(object sender,...
|
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,...
|
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...
| |
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |