473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

updated value from a master page

hi,

i would like to know
how to get the updated value from a master page so that i can update my content page.

Description:
i have a menu bar in master page and a dropdown control in Content page.
wen i select another item from the dropdown accordingly some actions must occur in the master page also...

but my code executes only for the content page alone.
Jun 22 '07 #1
3 1158
Frinavale
9,735 Expert Mod 8TB
hi,

i would like to know
how to get the updated value from a master page so that i can update my content page.

Description:
i have a menu bar in master page and a dropdown control in Content page.
wen i select another item from the dropdown accordingly some actions must occur in the master page also...

but my code executes only for the content page alone.
Hi Mahalaxmi :) Welcome to theScripts.
Hope you like it here.

Have you thought about putting the menu into your content page?
What are you using for your menu?

-Frinny
Jun 22 '07 #2
Hi mahalaxmi
Welcome to asp.net

One way of making the change from the content page to master page is to dynamically update the menu.
Add the new item, by right-clicking your project and click on the add item, add the sitemap. Fill the sitemap, by providing the "title", "description", "url" to navigate.
then add the Menu from the navigation Tab of toolbar and choose the new sitemapdatasource.

then on the ContentPage create an event of OnSelectedIndexChanged, by double clicking the comboBox or from the property of the ComboBox/DropDown
then add the following code. DAL in the code is just a CS file which open and close the connection to DB.
Expand|Select|Wrap|Line Numbers
  1. if (!IsPostBack)
  2.         {
  3.             SqlConnection source = DAL.getConnection();
  4.  
  5.             SqlCommand cmd = new SqlCommand("SELECT * FROM table_statics", source);
  6.             DAL.openConnection();
  7.             SqlDataReader reader1 = cmd.ExecuteReader();
  8.  
  9.              string sFileName = Server.MapPath("web.sitemap");//@"C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\admin-site\Web.sitemap");
  10.  
  11.             Encoding enc = Encoding.UTF8;
  12.             XmlTextWriter objXMLTW = new XmlTextWriter(sFileName, enc);
  13.             try
  14.             {
  15.  
  16.                 objXMLTW.WriteStartDocument();//xml document open
  17.  
  18.                 objXMLTW.WriteStartElement("siteMap");
  19.                 //first Node of the Menu open
  20.                 objXMLTW.WriteStartElement("siteMapNode");
  21.                 //Title attribute set
  22.                 objXMLTW.WriteAttributeString("title", "Home");
  23.                 objXMLTW.WriteAttributeString("description",
  24.                          "This is home");//Description attribute set
  25.                 objXMLTW.WriteAttributeString("url",
  26.                          "http://www.home.com");//URL attribute set
  27.                 //Loop and create nodes
  28.                 while (reader1.Read())
  29.                 {
  30.                     // int MasterID = reader1.GetInt32(0);
  31.                     objXMLTW.WriteStartElement("siteMapNode");
  32.                     objXMLTW.WriteAttributeString("title",
  33.                                     reader1.GetString(1));
  34.                     objXMLTW.WriteAttributeString("description",
  35.                                           reader1.GetString(2));
  36.                     objXMLTW.WriteAttributeString("url",
  37.                                   reader1.GetString(3));
  38.  
  39.  
  40.  
  41.                     objXMLTW.WriteEndElement();//Close the siteMapNode
  42.                 }
  43.  
  44.  
  45.                 objXMLTW.WriteEndElement();//Close the first siteMapNode
  46.                 objXMLTW.WriteEndDocument();//xml document closed
  47.  
  48.             }
  49.             finally
  50.             {
  51.                 objXMLTW.Flush();
  52.                 objXMLTW.Close();
  53.                 reader1.Close();
  54.  
  55.             }
  56.             source.Close();
  57.  
  58.         }
  59.         DAL.closeConnection();
  60.  
By adding this function, if you change the url in DB you'll see that the changes are automatically occure in master pages
Jun 22 '07 #3
Frinavale
9,735 Expert Mod 8TB
Thanks Kashifkashif for the detailed help!
Hopefully he is using a menu control and this information can help him out :)

-Frinny
Jun 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Clara | last post by:
Hi, can somebody help me,..I have an assignment due next week but now I'm stuck with this problem.... I tried to get values from entry widget using the widgetcontrolvariable.get(),..but it seems...
3
by: Brynjar Glesnes | last post by:
Hi, I've browsed the Fop FAQ, usenet and the internet hoping to find a solution to my problem, but in vain. I am using Xerces 2.6.2, Xalan-J 2.6.0 and Fop 0.20-5 to create PDF-documents. In...
0
by: Mike | last post by:
Hello, We are using mysql v4.0.24 on Linux machines. I'm trying to set up replication with a master and only one slave database. The syncronization seems to work well, the relay file on slave...
1
by: xxnonexnonexx | last post by:
I use the following piece of code to show when the page thats being accessed was last updated: <!-- var modified = new Date(document.lastModified); document.write("<b>Last Updated:<i>...
4
by: ¿ Mahesh Kumar | last post by:
Hi groups, I'm following Master page concept of ASP.NET 2.0, in which I'm deriving all the following page from master page for Theme. So unfortunately i'm dont get any Form Tag in my derived...
3
by: Joao Batista | last post by:
Hi all, I have a MasterPage with a menu, populated from a database, my problem now is when i chose an option , how can i pass (catch) the value to my products page??? Thanks Joao Batista
9
by: Lammert | last post by:
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...
5
by: Aussie Rules | last post by:
Hi, Within the code of a content page, how do you say set the .text value of a label thats on the master page.... Thanks
2
by: cleary1981 | last post by:
Hi, Im not sure if im doing this right but when I create my pdf the values do not show where ive used xsl:value-of. My xml is generated from php and im using apache fop <?xml version="1.0"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
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...

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.