473,387 Members | 1,553 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,387 software developers and data experts.

How to access public method of user control?

I have a default.aspx page. Default.aspx has placeholders. ASCX user controls
are loaded into these placeholders at Page_Load.

Each user control has a MultiView, within that there are two views for each
user control. One view is the “readonly” view and the other is the “Edit” view

The key is that I only want one user control to be in EDIT mode at a given
time. If the user tries to change the ActiveViewIndex of control A to be in
EDIT mode, then I want to reset the ActiveViewIndex of all other controls =
0; for all other user controls’ MultiView objects (B,C,D). . Likewise, if
they go into “edit mode” on user control B, then A,C,D need to reset their
ActiveViewIndex = 0;

How do I access the ActiveViewIndex of the other user controls outside the
current control I’m processing? (given that each control is defined within
its own .ASCX page? ). I did change the cancel buttons on each of the user
controls from protected to public, but Im stuck from there.

Any help appreciated. I hope this made sense.
--
JP
..NET Software Developer
Mar 28 '07 #1
1 1853
The Controls are all part of the same Page. So, you access them via the
Page.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
Networking Components, Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"JP" <JP@discussions.microsoft.comwrote in message
news:DF**********************************@microsof t.com...
>I have a default.aspx page. Default.aspx has placeholders. ASCX user
controls
are loaded into these placeholders at Page_Load.

Each user control has a MultiView, within that there are two views for
each
user control. One view is the "readonly" view and the other is the "Edit"
view

The key is that I only want one user control to be in EDIT mode at a given
time. If the user tries to change the ActiveViewIndex of control A to be
in
EDIT mode, then I want to reset the ActiveViewIndex of all other controls
=
0; for all other user controls' MultiView objects (B,C,D). . Likewise, if
they go into "edit mode" on user control B, then A,C,D need to reset their
ActiveViewIndex = 0;

How do I access the ActiveViewIndex of the other user controls outside the
current control I'm processing? (given that each control is defined within
its own .ASCX page? ). I did change the cancel buttons on each of the user
controls from protected to public, but Im stuck from there.

Any help appreciated. I hope this made sense.
--
JP
.NET Software Developer

Mar 29 '07 #2

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

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: paul meaney | last post by:
All, myself and another developer have been staring blankly at a screen for the past 48 hours and are wondering just what stunningly obvious thing we are missing. We are trying to load up 2...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
2
by: Jon Hyland | last post by:
This might be a dumb question, but what is the best way for one instance of a user control to access properties of an instance of another user control? For example, let's say I have an instance...
10
by: Dav risson | last post by:
Please can someone tell me how on earth to create an instance of my top level (base) Page class so that I can access it's objects from an user control?? Someone told me public myParent =...
9
by: Anders K. Jacobsen [DK] | last post by:
Hi I have this that adds some usercontrol (UCTodays.ascx) to a placeholder foreach(A a in B){ UCTodays ucline = (UCTodays )LoadControl("UCTodays.ascx");...
2
by: N. Demos | last post by:
I have a user control with code behind of which two instances are created/declared in my aspx page. The aspx page has code behind also, as I need to access methods of the usercontrols on page...
1
by: Nathan Sokalski | last post by:
I have a problem that is driving me crazy. I have a User Control composed of three DropDownLists that will be used to select a date. I have everything working except for one thing. When I select a...
5
by: c676228 | last post by:
Hi, I guess I am confused. In aspx script, I mean (you won't use Codebehind="enrollinfo.aspx.vb", but mix code with html and code together) You can access user control's property directly. Since I...
7
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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,...

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.