473,387 Members | 1,529 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.

Get SelectedValue of DropDownList in User Control in WebForm

Hello All,

How can I get the SelectedValue of a User Control's DropDownList in the
code-behind of the WebForm hosting the User Control?

(Without having to use Request.Form["UserControlName:DropDownListName"])

Thanks
Nov 18 '05 #1
2 2309
Expose a public function on your user control that will return this value.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"gu4y" <gu**@hotmail.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
Hello All,

How can I get the SelectedValue of a User Control's DropDownList in the
code-behind of the WebForm hosting the User Control?

(Without having to use Request.Form["UserControlName:DropDownListName"])

Thanks

Nov 18 '05 #2
Thanks Chris,

I exposed a public property and it works great.

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
Expose a public function on your user control that will return this value.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"gu4y" <gu**@hotmail.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
Hello All,

How can I get the SelectedValue of a User Control's DropDownList in the
code-behind of the WebForm hosting the User Control?

(Without having to use Request.Form["UserControlName:DropDownListName"])

Thanks


Nov 18 '05 #3

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

Similar topics

3
by: MrMike | last post by:
Hello. I have the following code on an ASP webform that formats a dropdownlist named ddlCustomer... 'Populate ddlCustomer Dim CustAdapter As New SqlDataAdapter("SELECT * FROM lkup_Customers",...
3
by: Ben Dewey | last post by:
Hey everyone, I have a wierd issue i can't seem to find out whats going on. I have a Control for a Shopping Cart Merchant Page called OrderStatus.ascx Inside that control there is a Repeater...
15
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3"...
1
by: clickon | last post by:
Forget about the controlParameter for the moment, for testing purposes i have created the following Markup: <asp:Table ID="tblSelectRoute" runat="server" CssClass="asp-table"> <asp:TableRow>...
1
by: John | last post by:
If you set DropDownList.SelectedValue to an item not in the list, shouldn't an exception be thrown? ie: <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem Text="1"...
3
by: Nathan Sokalski | last post by:
I have a webform that contains a DropDownList. When the user selects a new value and I click the submit button, the previously selected SelectedValue property is used in my code. This is obviously...
2
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
18
by: Redhairs | last post by:
Is it possible to get DropDownList.SelectedValue in Page_PreInit() event during the postback?
1
by: Brett | last post by:
I have a DropDownList in an ASP.NET web form that is populated with items from a lookup table by binding that DropDownList to a SqlDataSource. However, the items in the lookup table can change over...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.