473,399 Members | 2,774 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,399 software developers and data experts.

How to pass data from one control (ascx) to another?

Hello,
relatively new .net programmer. using vb.net (v2.0)

I have an aspx page that contains 2 user controls (ascx) on it.
the left control is basically navigation hyperlinks
the right control is basically content display depending on what was
clicked in the left control.
** trying it this way to avoid using frames **

I was hoping to get some help with was how to pass info to the right
control what was selected from the left control (IDs, etc). can you
specify a "target" like in frames in the URL of the nav link? not
sure how to "call" the right control with data to drive its display.
I'm looking to avoid using the main "page" as the URL in the nav
control and then read the query string variables in the content
control as I'm trying to avoid doing a full page read/refresh/reload,
which leads into my next question...

I'm also looking to have only the right control refresh itself and
leave the remainder of the page untouched (as to not disrupt the
current state of the nav links control, there is collapsible tree
like display there). the nav control is populated by data from a
database and fed into a label field (not generated in vb code). I'm
pretty sure the only answer to that question is to use AJAX. so if
you happened to know a good link to show how to do this I'd appreciate
that too.

thank you for reading this. simon

Jun 12 '07 #1
2 3487
Here I've documented the details you need to know to pass data between two
user controls:
http://SteveOrr.net/faq/PassDataBetweenControls.aspx
http://SteveOrr.net/faq/PassDataToUserControl.aspx
http://SteveOrr.net/faq/PassDataFromUserControl.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"simon" <me@here.comwrote in message
news:o6********************************@4ax.com...
Hello,
relatively new .net programmer. using vb.net (v2.0)

I have an aspx page that contains 2 user controls (ascx) on it.
the left control is basically navigation hyperlinks
the right control is basically content display depending on what was
clicked in the left control.
** trying it this way to avoid using frames **

I was hoping to get some help with was how to pass info to the right
control what was selected from the left control (IDs, etc). can you
specify a "target" like in frames in the URL of the nav link? not
sure how to "call" the right control with data to drive its display.
I'm looking to avoid using the main "page" as the URL in the nav
control and then read the query string variables in the content
control as I'm trying to avoid doing a full page read/refresh/reload,
which leads into my next question...

I'm also looking to have only the right control refresh itself and
leave the remainder of the page untouched (as to not disrupt the
current state of the nav links control, there is collapsible tree
like display there). the nav control is populated by data from a
database and fed into a label field (not generated in vb code). I'm
pretty sure the only answer to that question is to use AJAX. so if
you happened to know a good link to show how to do this I'd appreciate
that too.

thank you for reading this. simon
Jun 12 '07 #2
thank you steve!
going to dig into those pages now
thanks once again!
On Tue, 12 Jun 2007 13:47:12 -0700, "Steve C. Orr [MCSD, MVP, CSM, ASP
Insider]" <St***@Orr.netwrote:
>Here I've documented the details you need to know to pass data between two
user controls:
http://SteveOrr.net/faq/PassDataBetweenControls.aspx
http://SteveOrr.net/faq/PassDataToUserControl.aspx
http://SteveOrr.net/faq/PassDataFromUserControl.aspx
Jun 13 '07 #3

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

Similar topics

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...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
9
by: Frank Rizzo | last post by:
I've got a number of user controls on the web page. How can I pass some data to it? I don't see where the user control is instantiated in the page code-behind page. Thanks.
5
by: Ben | last post by:
Hi I am using a User Control which is referenced by an ASPX page. How can I pass a string parameter to the user control, from the base ASPX page. Thanks Ben
0
by: ab_j | last post by:
I have a user control that contains a dropdown which I want to use as a menu on multiple .aspx pages. Basically, all I am trying to do is pass the selected value of the dropdown in the user...
12
by: Phil Certain | last post by:
Hi, I'm trying to do something very simple...or at least it should be. I have created a host page (gen.aspx) and a very simple user control (us.ascx). The corresponding code-behind files are...
5
by: Chad | last post by:
Alright, I've been searching all over and it seems I'm just not looking for the right thing, since what I want to do seems extremely simple I just don't know the correct syntax. All I get is how to...
1
by: mehdi_mousavi | last post by:
Hi, I need to pass some variables to a given web user ctrl, say, myctrl.ascx. e.g., I need to include the user control within a web form as follows: ...
1
by: pradeep_TP | last post by:
Hello everybody, I have created a web site which has a simple user control (LogoDisplay.ascx). This is part of a separate project called CommonControls. I have a main Project "MainProj" from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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,...
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...

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.