473,624 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setting an ASPX variable from ASCX

I've figured out how to read a variable in one ASCX file from another. Works
great.

I now would like to have one ASCX file set a variable in its parent ASPX or
another ASCX file. Can that be done? I can't read the variable from the ASCX
or ASPX file, because the control that is setting the variable is being
loaded dynamically, so I can't reference it directly (as the other control
wouldn't necessary know it is there.)

Google returns lots of the opposite...sett ing a variable in an ASCX file
from ASPX, but not the other way around.

-Darrel
Nov 18 '05 #1
1 2437
You could raise an event...

"Darrel" <no*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I've figured out how to read a variable in one ASCX file from another.
Works great.

I now would like to have one ASCX file set a variable in its parent ASPX
or another ASCX file. Can that be done? I can't read the variable from the
ASCX or ASPX file, because the control that is setting the variable is
being loaded dynamically, so I can't reference it directly (as the other
control wouldn't necessary know it is there.)

Google returns lots of the opposite...sett ing a variable in an ASCX file
from ASPX, but not the other way around.

-Darrel

Nov 18 '05 #2

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

Similar topics

3
9849
by: Tom | last post by:
Hi, I have an index.aspx page which includes top.aspx, left.aspx, main.aspx and bottom.aspx. In the left.aspx, there is a login web control - login.ascx. It keeps session of username and role after successful login and shows welcome user message and his shopping cart link.
1
992
by: Darrel | last post by:
Is it possible to set a variable in one UserControl that another UserControl can read? For example: page.aspx navigationControl.ascx pageBanner.ascx the navigation control builds a menu by transforming some XML for me. Based
2
3095
by: Ric | last post by:
im new to asp.net. from what i understand, you have the aspx file (presentation), user-control(ascx file), code-behind(vb file) and components(compiled vb and dll files). the aspx file contains a reference to the ascx which can contain a reference to a component. can an aspx file contain a reference to an ascx file which contains a reference to a code-behind file? ive tried to do this then load the user-control via LoadControl(), but i...
6
2608
by: Martin Eyles | last post by:
Hi, I have a .aspx page which has a .ascx file included through the lines <%@ Register TagPrefix="aspcustom" TagName="menu" Src="Menu.ascx" %> and <aspcustom:menu id="Menu1" runat="server"></aspcustom:menu> both of these files have vb.net code behind. I am processing some information from a post back in the code behind for the
3
3909
by: Mark Rae | last post by:
Hi, Just a general quickie on setting properties of user controls from the parent form. Let's say I have a user control called note.ascx which displays a datagrid. That datagrid is populated according to an integer variable in the ViewState of the parent form. The code behind (still in v1.1) of the user control contains the following:
5
14335
by: Fernando Chilvarguer | last post by:
I'm sure this has come up before but I could not find any post on it. How can I read a variable or property that has been set on a ASPX page from inside a ASCX control. ASPX code: public partial class MyClass: System.Web.UI.Page { protected string _companyID;
2
5564
by: John Haycock | last post by:
Hi All I have a user control that uses a repeater to build a list of menu links: <itemtemplate> <li> <a href='news.aspx?newsID=<%# DataBinder.Eval(Container.DataItem,"newsID") %>'> <%# DataBinder.Eval(Container.DataItem, "newsHeadline") %> </a> </li>
2
3350
by: DC | last post by:
Hi, I want to keep all my layout information in the .ascx file of a UserControl. If I require layout related data in codebehind, I would usually use properties defined in the codebehind, e.g. string tdStyle; public string TdStyle {
6
11067
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to how those properties are set. I want to be able to do two other things: a) add User control instances to my page, filling in the place of placeholder controls, and b) programmatically setting custom properties on those dynamically spawned...
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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
8334
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
7158
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...
1
6108
isladogs
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...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.