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

Values between usercontrols

I have a problem communicating between two usercontrols.

I have a template.aspx file with two usercontrols:

<uc1:FAQList id="FAQList" runat="server"></uc1:FAQList>
<uc1:FAQCreateQuestion id="FAQCreateQuestion"
runat="server"></uc1:FAQCreateQuestion>
After a postback I want the FAQList usercontrol to make a query,
depending on a selection in a dropdownlist control in the
FAQCreateQuestion usercontrol.
How do I get the selected value from the FAQCreateQuestion usercontrol
to the FAQList usercontrol?
Nov 18 '05 #1
2 1013
SSW
Hi,

1) Define a public Property in FAQCreateQuestion user control to get the
value eg. Prop1
2) to get FAQCreateQuestion user control we use as below
FAQCreateQuestion FAQCreateQuestion1
=(FAQCreateQuestion )this.FindControl("FAQCreateQuestion")
3) Call FAQCreateQuestion1.Prop1 to get values of Prop1 of
FAQCreateQuestion1 List box in FAQList.

HTH

Thanks,

sswalia
MCSD, MCAD, OCA

"Jacob" <je*@dlg.dk> wrote in message
news:5b**************************@posting.google.c om...
I have a problem communicating between two usercontrols.

I have a template.aspx file with two usercontrols:

<uc1:FAQList id="FAQList" runat="server"></uc1:FAQList>
<uc1:FAQCreateQuestion id="FAQCreateQuestion"
runat="server"></uc1:FAQCreateQuestion>
After a postback I want the FAQList usercontrol to make a query,
depending on a selection in a dropdownlist control in the
FAQCreateQuestion usercontrol.
How do I get the selected value from the FAQCreateQuestion usercontrol
to the FAQList usercontrol?

Nov 18 '05 #2
Hi

Thanx for the quick reply.

I have made the public prop. as below

protected System.Web.UI.WebControls.DropDownList DropDownListControl;

private string prop1;
public string Prop1
{
get
{
prop1 = DropDownListControl.SelectedValue;
return prop1;
}
set
{
prop1 = value;
}
}

But I get a "Object not set to an instance" - error in this line:
prop1 = DropDownListControl.SelectedValue;

I you have any idea what I do wrong it would be great, otherwise thanx
for your help. I am closer to be finish than before your reply:o)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

1
by: Kate | last post by:
Hi: I have a picturebox control, and at runtime various usercontrols are added to it to make a diagram. As dynamically added usercontrols, they are of type VBExtender. Is there a way to save...
2
by: Emma | last post by:
Hi, I'm developing a GUI with almost all Usercontrols. It's been working wonderfull up till a few weeks ago, and really crashed yesterday. Suddenly I can no longer add some of my usercontrols...
4
by: Anders K. Jacobsen [DK] | last post by:
Hi I have some common UserControls i want to share between to sites (on the same mashine but on diffrent virtual paths). right now i have on solution file with aprox 10 projects. 2 of these is...
3
by: YYZ | last post by:
I swear I've done my research, and now I was just hoping someone could explain this to me. I've got a base class (usercontrol) that I am using just as an interface. Meaning, I've defined...
3
by: b747_440 | last post by:
Dear Newsgroup, I'm an old VB6.0 developper who switched some time ago to VB.NET 2005. I really like that new Visual Studio. However, something is going wrong now and I can't figure out, what it...
0
by: seigo | last post by:
Hello, I faced with the following problem. I have a PlaceHolder on a page and a few UserControls which have custom events, for instance: public delegate void SelectHandler(object sender,...
4
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an error when compiling. The reason for this is because...
7
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows...
6
by: alun65 | last post by:
I'm having trouble programmatically adding a user control and then setting some of it's server controls. I add the user control to the code behind and add it to a placeholder: protected void...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.