CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 2/6/2007 4:03:38 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 32 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
rizwanaslamdar
Asp.Net User
Passing Variable from Content Page to Web User Control embedded in a Master Page2/6/2007 4:03:38 PM

0/0

Hi there,

I have a content page (mypictures.aspx).

 

I have a Master Page with the following code:

<%@ Register TagPrefix="ECC" TagName="LeftNav" Src="leftnav.ascx" %>

......................... 

<ECC:LeftNav ID="LeftNav1" Section="Sales" SubSection="" TertiarySection="" runat="server"/>

................................ 

 

I have the LeftNav - Web User Control (leftnav.ascx).

 

Question:

Depending on the content page i am viewing (i.e. mypictures.aspx), I want to change a graphic file in leftnav.ascx file which is embedded or called by the Master Page.

I am pretty novice in ASP.NET. How will I go about doing this?

Thanks

 


 


Target
bpag
Asp.Net User
Re: Passing Variable from Content Page to Web User Control embedded in a Master Page2/6/2007 5:06:08 PM

0/0

You should be able to make changes to public properties on that user control by doing something like this in your page (note that I'm doing this in C# and I'm assuming the name of the class of your control is LeftNav. If you're using VB or your class is named something different you'll have to change the code to reflect the differences.):

Control ctl = Master.FindControl("LeftNav1");

((LeftNav)ctl).YourProperty = "whatever you want";

 

So you use FindControl on the Master of the current page to get access to the left nav control. Then in the second line you cast it to the type it really is so you can access the public properties of the control and you set the "YourProperty" to whatever you want. Note that in addition to this I think you need to put a register directive for your left nav control in the .aspx page you are going to do this from so that it can locate and resolve the reference to the LeftNav type.You say you want to change a graphic file so you'll need to have a public property in the leftnav.ascx control that you can set with the proper graphic name and then your control will have to use that property when it loads the graphic.


If this post answered your question please remember to 'Mark as Answer'!
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:

Web:
How to pass variable from master page to contents page on postback ... Tags: master, content, pass, from. Hi All, My master page has a dropdown box with .... Yes, properties (variables, controls, events) made public can be read ...
Passing Variables Between Nested Master Pages : asp.net 2.0 VB Web.UI.MasterPage Protected Sub Page_Load(ByVal sender As Object, ... You can call it from a MasterPage, Page Content, UserControl, whatever. ...
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... NET web form using a master page, the content page (.aspx) and master ... In fact, the MasterPage class derives from the UserControl class. ...
.NET ASP Page 48 - Bytes Site Map Session is null · How to reference and populate controls on Content Page · appDomain and IIS problem .Net 2.0 - WebBrowser control embedded in IE causes ...
CodeProject: ASP.NET Common Web Page Class Library - Part 1. Free ... This can be used to disable or enable all edit controls on a web page, .... in the code module passing the values from the two variables noted above as ...
ASP Net [Archive] - Page 289 [Archive] Page 289 microsoft.public.dotnet.framework.aspnet. ... controls in Formview itemtemplate · Windows forms user control embedded inside a web form? ...
ASP.NET Master Pages Tips and Tricks Jun 14, 2007 ... NET 2.0 derives from UserControl and just like user controls, .... Create a content page that references MasterPage.master (the one you ...
Web Development with Visual Web Developer 2005 Express Edition and ... The content page references the master page with the MasterPageFile="" ... On this page, we had added a LoginView control, with a Login control embedded ...
ASP.NET 2.0 MasterPages and FindControl() - Rick Strahl's Web Log Master.FindControl("Content") in your example above as its own variable, ..... This code will locate a linkbutton and a user control on a master page. ...
asp.net control to run in web page like just COM Issues With User Control Embedded Into Web Page Since Installing .NET 2.0 ... Newbie - passing variable from content page to masterpage ...




Search This Site:










implementing font property in composite control

problem creating wap after sp1 installed

answering to a posted ad...

dnn 2.1.2 updating problem

cdottext v0.2 .text blogs with dnn

emergency! trying to upgrade a production site from 3.0.13 to 3.1 and receive the following error....

get set label text of gridview

authentication error

movings tabs

tutorial videos

html/text module didn't load

where is the community???

does exist any irc servers for dotnetnuke comunities?

vwd2008: losing focus when switching between design and source mode

dnn 3.0.5 issue - wrong ressource files

dnn 3.2.2 log viewer error

2 little questions

getting error "login failed for user ''. the user is not associated with a trusted sql server connection" on trying to authenticate a user

error when running sps_096.sql

sitemap not working based on roles

is there a dropdowncheckboxlist control?

xml web services exposed by .text

terms of use

logged in users information

importing users into 2.0

recovery password control not working

ibs

efficionconsulting articles module installation problem

new letters

one of the best database documentors i've seen - and it's free!

 
All Times Are GMT