Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6220893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:02:20+00:00 2026-05-24T08:02:20+00:00

There are test.aspx page and test.ascx web user control. I have a button in

  • 0

There are test.aspx page and test.ascx web user control.

I have a button in test.aspx = btn_test and above code in my button is :

 Dim ct As Control = Page.LoadControl("test.ascx")
 Panel1.Controls.Add(ct)

There is a dropdownlist with value 1 to 10 in test.aspx and there is label_test in test.ascx

I need some code when test.ascx loading, get dropdownlist.selectedvalue and show it in label_test.

Please help me !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:02:21+00:00Added an answer on May 24, 2026 at 8:02 am

    There are a number of ways to implement this. One you could try would be to cast the test.ascx web control being loaded like so (replace TestControl with the class name for the control):

    Dim ct As TestControl = CType(Page.LoadControl("test.ascx"), TestControl)
    

    And then create a public property in the control which you would use to set the value from the DropDownList.

    Dim ct As TestControl = CType(Page.LoadControl("test.ascx"), TestControl)
    ct.DropDownListValue = DropDownList.SelectedItem.Value
    Panel1.Controls.Add(ct)
    

    This property would then be used to set the labels value (either directly using the set accessor or via a method within the test.ascx control).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some existing code there is a test to see if the user is
In my ASPX page I have an Ajax Control toolkit provided 'Auto Complete extended
Let's say I have a page Test.aspx along with test.aspx.vb. Test.aspx.vb contains a class
Is there a proper way yet to unit test views with the aspx view
I've got main folder: c:\test And there I have 2 folders: Movies and Photos.
I have a page located at x.com. On this page is a button that,
I have this code to send variables to a datagrid on another page protected
There's is something I don't get with ASP objects. I have a button in
Mark Up <%@ Page Language=C# AutoEventWireup=true CodeBehind=test.aspx.cs Inherits=Zuhaib.test %> <!-- Put IE into quirks
In my default.aspx page, I have some ESRI tools (and some commands) in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.