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
I have this in my LoginControl.ascx code behind: protected void Logout_Click(object sender, EventArgs e)
i have placed a SqlDataSource component on my aspx page but while configuring the
I have one web page with an iframe. The iframe is on a different
I have written a sample web service, which consist of certain .aspx pages. I
I'm currently analyzing the code behind for a web application. The Default page contains
I have created a blank asp.net website consisting of a blank default.aspx page, its
Is there a test suite for PDFs, preferably in Perl? What I want is
Where can I test HTML 5 functionality today - is there any test build
I'm completely new at C# and NUnit. In Boost.Test there is a family of

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.