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

Is it impossible to declaratively databind to user control's properties?

HP
Hi there

I've asked about it few times, and seen it asked more times, but no
one ever replied.

The question is: is it possible to use a control inside of user
control (eg. dropdownlist) as a control parameter for some other
datasource on a page (outside that user control) with declarative
databinding (ie. using the designer, or aspx tag syntax).

I know that I can expose public properties in user control, but they
are not visible (at least the way I tried) as a control parameters for
declarative databinding.
many thanks
HP

Apr 1 '07 #1
3 5470
See here:
http://www.ben-rush.net/blog/PermaLi...0c1ea82&dotnet

Does that help?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"HP" <ha****@gmail.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
Hi there

I've asked about it few times, and seen it asked more times, but no
one ever replied.

The question is: is it possible to use a control inside of user
control (eg. dropdownlist) as a control parameter for some other
datasource on a page (outside that user control) with declarative
databinding (ie. using the designer, or aspx tag syntax).

I know that I can expose public properties in user control, but they
are not visible (at least the way I tried) as a control parameters for
declarative databinding.
many thanks
HP

Apr 1 '07 #2
HP
On Apr 1, 9:51 pm, "Ben Rush" <kwen...@yahoo.comwrote:
See here:http://www.ben-rush.net/blog/PermaLi...92-1d5d-4b0d-9...

Does that help?

Hi Ben

Your post is very interesting, but what I meant was something
different:

What I need is to the dropdownlists inside my user control as a
control parameters for other datasources, outside the user control.

Just like I can use SelectedValue of a dropdownlists laying on the
page as a parameters of objectDataSource (or any other datasource)
:
<asp:ObjectDataSource ID="odsTets" runat="server"
SelectMethod="TestMethod" TypeName="testType">
<SelectParameters>
<asp:ControlParameter ControlID="normalDdl1"
Name="parameterName1" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="normalDdl2"
Name="parameterName2" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>

I'd like to put those ddl's inside my user controls, define
corresponding properties in the control and use them just like before:

<asp:ObjectDataSource ID="odsTets" runat="server"
SelectMethod="TestMethod" TypeName="testType">
<SelectParameters>
<asp:ControlParameter ControlID="myUserControl"
Name="parameterName1" PropertyName="exposedProperty1" Type="String" />
<asp:ControlParameter ControlID="myUserControl"
Name="parameterName2" PropertyName="exposedProperty2" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>


thanks
HP

Apr 1 '07 #3
HP
What I need is to the dropdownlists inside myusercontrolas acontrolparameters for other datasources, outside theusercontrol.
>
Just like I can use SelectedValue of a dropdownlists laying on the
page as a parameters of objectDataSource (or any other datasource)
:
<asp:ObjectDataSource ID="odsTets" runat="server"
SelectMethod="TestMethod" TypeName="testType">
<SelectParameters>
<asp:ControlParameter ControlID="normalDdl1"
Name="parameterName1" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="normalDdl2"
Name="parameterName2" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>

I'd like to put those ddl's inside myusercontrols, define
corresponding properties in thecontroland use them just like before:

<asp:ObjectDataSource ID="odsTets" runat="server"
SelectMethod="TestMethod" TypeName="testType">
<SelectParameters>
<asp:ControlParameter ControlID="myUserControl"
Name="parameterName1" PropertyName="exposedProperty1" Type="String" />
<asp:ControlParameter ControlID="myUserControl"
Name="parameterName2" PropertyName="exposedProperty2" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>

I've just found that it works EXACTLY as I was supposing it should - I
juts didn't try it because when selecting control for controlparameter
in the designer, user controls are not on the list, so I thought that
it's not possible. Meanwhile, one just has to switch to
controlparameters advanced properties and then it's possible to choose
user control and it's properties as a control parameters.

thanks Ben
HP
Apr 2 '07 #4

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

Similar topics

2
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
4
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
1
by: tal_mcmahon | last post by:
Hello all, I have a user control (ascx) that has a DropDownList on it. The User Control exposes the selectedvalue/text of the ddl. The User Control Has a Click event. I place that User...
1
by: Tomislav Bartolin | last post by:
Hi, I have an aspx page which contains an ascx user control. I am using Page.DataBind in Page_Load event of the page to bind elements to page properties. The problem is the ascx uses its...
4
by: Aidan Marcuss | last post by:
I am seeing significant performance problems with the TreeView (from the Microsoft.Web.UI.WebControls namespace) when trying to data bind it on the server side. I set the TreeNodeSrc property and...
11
by: Rourke Eleven | last post by:
I have looked and searched. What good is the databind property on Radiobuttons? How does one go about actually using it? What is a good resource on this? I understand that I can easily get/set...
2
by: Richard Brown | last post by:
Hi, I have a base class (which inherits from System.Web.UI.Page) for all the pages in my application. I have a property defined on this class that I want to set declaratively in the .aspx...
0
by: cannontrodder | last post by:
Hi, I've created a custom control yet when I add the attribute ListStyle="astyle" to my declaration, I get the error: "The 'ListStyle' property cannot be set declaratively." It shows up in...
1
by: Mark Olbert | last post by:
I have a GridView as a child control in a custom composite control which is stubornly refusing to databind at design time. I'm convinced I must be missing something about how the databinding process...
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?
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
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
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.