Passing a value from Content Page to another Content Page

Hello.

I have a site master page with two ContentPlaceHolders (CPH).

I have two UserControls: UC1 has a TreeView control and UC2 has a Form control that uses an ObjectDataSource.

My Default page populates CPH1 with UC1 and CPH2 with UC2.

The TreeView populates the way I want with no issues and the Form is bound correctly to the datasource.

I would like to click on a TreeNode and have the data in the Form change to the appropriate record based on the selected node whose value is the record ID.

I have studied the various tutorials on this site and have tried to implement several different methods, but there is always something in the tutorial the prevents me from succeeding.

I think I want to use the Raising and Consuming Events methods because the CPH2 will be populated with any number of different User Controls pages.  Tutorial #7, Interacting with the Content Page from the Master Page, did not work for me because I could not figure out how to get to UC1 on the master page.  I also had trouble trying to pass the record ID value to UC2.

Please let me know what code snippets you may need to help me with my problem.  I can also post screen shots to show what I'm trying to do.

Thanks for you help,

Robin Simmons

 

0
RASENT
11/20/2008 12:20:08 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

1 Replies
722 Views

Similar Articles

[PageSpeed] 1

RASENT:

Hello.

I have a site master page with two ContentPlaceHolders (CPH).

I have two UserControls: UC1 has a TreeView control and UC2 has a Form control that uses an ObjectDataSource.

My Default page populates CPH1 with UC1 and CPH2 with UC2.

The TreeView populates the way I want with no issues and the Form is bound correctly to the datasource.

I would like to click on a TreeNode and have the data in the Form change to the appropriate record based on the selected node whose value is the record ID.

I have studied the various tutorials on this site and have tried to implement several different methods, but there is always something in the tutorial the prevents me from succeeding.

I think I want to use the Raising and Consuming Events methods because the CPH2 will be populated with any number of different User Controls pages.  Tutorial #7, Interacting with the Content Page from the Master Page, did not work for me because I could not figure out how to get to UC1 on the master page.  I also had trouble trying to pass the record ID value to UC2.

Please let me know what code snippets you may need to help me with my problem.  I can also post screen shots to show what I'm trying to do.

Thanks for you help,

Robin Simmons

 

 

Hi Robin Simmons,

Please try to read this link and the demo code to solve your problem,

http://bytes.com/archives/net-asp/681840-find-control-user-control-master-page (find control in user control in master pag)

Code:

Add a iframe (named "iframeContent") on a page or a user control, and set the Target as "iframeContent" SelectedNode of the TreeView control, see the code,

HTML:

   <asp:TreeView ID="TreeView1" runat="server"
            onselectednodechanged="TreeView1_SelectedNodeChanged">
        </asp:TreeView>
        <iframe id="iframeContent" name="iframeContent"></iframe>

CODE:

   protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        TreeView1.SelectedNode.Target = "iframeContent";
    }

 

 


Hong-Gang Chen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Hong
11/24/2008 1:44:02 PM
Reply:

Similar Artilces:

Having Problem in Posting Value from a Content Page to another Content Page within a Same Master Page
Hello, I have a Master Page which contains two Content pages named: Default.aspx and Default2.aspx. I want to post a TextBox1 value (in Default.aspx) to Default2.aspx in the Master Pages and all my pages are in ContentPlaceHolder, but it is not working.   Is there Any kind of help?  Hi,you can pass value between two web forms by Query string, session  or by using cookieFor query string  refer : http://www.codeproject.com/KB/aspnet/QueryString.aspxSession: save session in default.aspx Session("t1")=text1.text retrieve session astext2.text = session(&quo...

How to pass the form contents of aspx page in .Net to Jsp page
Hi,   I want to pass the login information from aspx page to jsp page. plz help me how to do it. Please reply asap. Thanks...

How to Opening New Window from Content Page Or Sub Page & Assigning the return value to the Content Page
I Have Master Page & Content Page. In Content Page I am able to open new Window, But after i select a value from the new window it is not flowing to the content pages Text box control. this code is working fine when i use an Ordinary Page, What about the Master/Content Page Can any one please help me out . thanks in Advance   Hi, Base on your description, you opened a new window in the content page and after you select a value from the new wondow, but you cannot  get the value in the textbox control, but this works fine in the ordinary page, right? In fact, if you use ...

Passing values from master page to content page.
Hello everyone,  I have an odd problem that I am not sure how to work around.  If anyone could provide some guidance I would appreciate it.  I am an armature programmer working on a VB.Net site.  I hope am able to explain my problem with the following explanation.   I am using a master page that will build up search criteria.  There are four items that can be used to search for things.  One text box and three data lists make up this search feature.  I have created public properties for each of them.  Please see below.   Public Propert...

Value Passing From Master Page To Content Page
Hey I have a menu control in a master page.I have bound that menu control to my Header Table like this public void CreateMenu(Menu menuid) {objds=new DataSet();objds=objsqlhelper.ExecuteSqlDataset("select rev_header_id,header_desc,page_url from review_header_master", CommandType.Text);   menuid.Items.Clear(); try {foreach (DataRow dr in objds.Tables[0].Rows) {  MenuItem objmnuitem = new MenuItem();  objmnuitem.Text = dr["header_desc"].ToString(); objmnuitem.Value = dr["rev_header_id"].ToString();objmnuitem.NavigateUrl = dr["pag...

convertion from page to content page or from user control to content page
Hi, I have converted an asp.net 1.1 application to 2.0.  Now what I am looking for some enhancement.  I added a master page and now I want to add other pages as content pages. but those pages which I am converting into content have some user control. Now either I can convert those user control to content pages ( which i want to look for if it is possible),  Or I am thinking i shouldn't convert those user control to content pages cause they might be just good. So looking for some of those people opinion who have worked through this so can I get opinion here please.thanks&nb...

How do I put a content home page/form into a master page content placeholder
How do I put the current HTML Home page shown below into the ContentPlaceHolder on the New Content ASP Home page?  Do I put the Current Home Page between the ASP tags on the New Content ASP Home page?  If so, how much of the Current Home Page do I place between the tags?  In addition, how do I put Content ASP Home page into the content placeholder area of a Master page?  I will have multiple pages and want to put them into the content placeholder of the Master page one at a time when I click on the navigation treeview.  I understand how to make a Master page but do n...

Show content in both Master Page ContentPlaceholder AND Content Page Content control
I note that by default or rendering rules, when you add content/controls to the Content Page ASP:Content control matched to a Master Page ContentPlaceholder, any content/controls in the matching Master Page ContentPlaceholder is not displayed. Is there a setting that can be made to merge or show both content/controls in the Master Page ContentPlaceholder and content/controls in the matching Content Page Content control? Thanks         Don't think so. If you specify a content control in your page then whatever is in there displays and anything in the...

Passing Values from a databound control in a Master page to a content page.
Need help with a dropdown menu in the Master page passing values to a Content page. Basically I have a dropdown menu on my master that I want to select and update the content in my Gridview on the subsequent page? I feel silly for asking I know this should be easy.   Bill I wrote an article to do exactly that.  Take a look:http://www.dotnetadvisor.com/Blog/MasterPageControls.aspx Rob Millswww.dotnetadvisor.com In the menu on the master page (or in a web.sitemap file), you can specify urls with querystrings attached (eg ~/Page.aspx?id=1). When you navigate to th...

Passing values from content page to user control on master page
I have a content page that pulls the info for a product. Surrounding this is a master page that has some user controls on it that show content that is specific to the data being pulled in the content page. I already have the content page setting properties on the master page in the code behind, and then the master pages code behind feeding the user controls - all seems to work but seems a tad inefficient in some cases - fine when I need to go back to the databse to fetch more related records, but this particular issue shouldn't need to do that.  My content page initiates a Product cla...

Contents of Master Page doesn't appear in the contents of the Content Page !!
I created the Master Page, & I created the content page as I read in many books & articles: Website>>add new item>>web form>>check the Select master page>>add Then, only the content box appeared. What should I do?? thanks What did you place in your Master page? If you only use a simplest master page with only 1 ContentPlaceHolder and 1 Lable (don't put the Lable inside ContentPlaceHolder), would the Label appear in content page?Welcome to my SQL/ASPNET forum for Chinese http://51up.org/bbs/forumdisplay.php?fid=38 pic. of master &...

Using an Update Panel in a Content page of Master.page/content.page scenario
When I place an Update Panel inside a content page of a Masterpage I get the following error: Element 'UpdatePanel' is not a known element. This can occur if there is a compilation error in the Web site.  Is the Update Panel suppose to work with a content page, etc.?  Can't seem to find any Docs that talk about where the Update Panel is allowed. Warren     Well, don't you know it.  Right after I put out the original post, I then downloaded the latest release of the ajax extensions and it looks like they have fixed the problem with the update panel not working ...

CSS not accessable from content page when Master Page and Content Pages are in different folder.
I can't seem to find a solution to this problem.  I have a master page and content pages and a CSS file all in the root folder.  I have created a sub folder called News and have added a content page that references the master page in the root directory with the following: MasterPageFile="~/Default.master". The issue is that the page in the News folder is not picking up the CSS styles from the master page.  Has anybody else ran into a problem like this and was able to find a solution? Any help would be greatly appreciated? Thanks, Neeraj    N...

How to pass a webcontrol's value in a master page to a content page???
In masterpage.master, I use a TextBox webcontrol <asp:TextBox ID="Symbol" runat="server" Width="50px" ></asp:TextBox>  , and a <asp:contentplaceholder id="PageContent" runat="server" /> In another page (ABC.aspx), I use <%@ Page Language="C#" MasterPageFile="masterpage.master" AutoEventWireup="true" CodeFile="ABC.aspx.cs" Inherits="ABC" %> <asp:Content ID="Content1" ContentPlaceHolderID="PageContent" Runat="Server"/> and want to get the value of Symbol.Text. Anyone plz help me out. Thanks Hi, you need to expose a method in the Master...

Web resources about - Passing a value from Content Page to another Content Page - asp.net.web-forms

Passing off - Wikipedia, the free encyclopedia
This article includes a list of references , related reading or external links , but its sources remain unclear because it lacks inline citations ...

Facebook Gets Passing Grade From Irish Agency Audit - AllFacebook
Facebook received its report card in the form of a detailed audit by the Office of the Irish Data Protection Commissioner, and its grades were ...

Whether passing the 9/11 Health Bill,... - Kirsten Gillibrand - Facebook
Whether passing the 9/11 Health Bill, repealing DADT, or my call to action for women, I have always urged New Yorkers to make their voices heard. ...

Thread: Buck-passing bullshit.
The Repubs are tempting fate, trying to allocate blame for Obama's loss in November. Obviously it's a little presumptuous. If Romney wins, it's ...

Scripting News: People are asking about the history of RSS today because of Aaron's passing.
People are asking about the history of RSS today because of Aaron's passing. In April 2004 I put together a timeline of the various specs that ...

AfroCat ◆ Cute and free pet game ◆ Perfect for passing the time! on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about AfroCat ◆ Cute and free pet game ◆ Perfect for passing the time!. ...

walmart donated a palette of water. everyone was great about passing the bottles back
Explore pinguino's photos on Flickr. pinguino has uploaded 16442 photos to Flickr.

Astronauts Mark Leonard Nimoy’s Passing - YouTube
NASA Astronaut Mike Fincke and ESA European Space Agency Astronaut Luca Parmitano reflect on the inspiration that actor Leonard Nimoy’s character ...

UAE remembers Zayed 10 years after his passing
Several activities will be taking place on Ramadan 19th marking the 10th anniversary of Sheikh Zayed’s passing.

Should IVF be used to avoid passing on mutations?
Should IVF be used to avoid passing on mutations?

Resources last updated: 12/30/2015 6:25:06 AM