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 7794691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:50:54+00:00 2026-06-01T22:50:54+00:00

i have 3 user control in my page . one of this user control

  • 0

i have 3 user control in my page . one of this user control is about fileUploading and second is about fileUploade Keyword . when file uploaded the fileUploading usercontrol return an Id of the recorded that insert . now i want to use this id in fileUploaded keyword but when is insert to label for seeing the id in fileuploading user control show right id forexample 1 or 2 or .. but in keyword usercontrol show only 0 value . i use entity frame work . how can i access this id in keyword user control .
thanks.

  • 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-06-01T22:50:55+00:00Added an answer on June 1, 2026 at 10:50 pm

    You can use a delegate to pass the id back to the parent page. When the id is passed back to the parent page, you run a function on the parent page that invokes a public function on the keyword usercontrol.

    So on your Uploading usercontrol, first create the delegate that the parent page will listen for:

    public delegate void PassIDToParent(string ID);
    public event PassIDToParent PassID;
    

    Next, fire the delegate once you have the id returned:

    protected void Upload() //--- this is your current upload function
    {
        //--- other upload code
        string ReturnedID = "1"; //--- whatever is returned
        PassID(ReturnedID);
    }
    

    Now you need to setup the listener on the parent page. Once the listener executes, it will execute the “PassID” function. In this function, you will be calling the public function “LoadID” of the keyword usercontrol. So on the parent page, do this:

    protected void Page_Load(object sender, EventArgs e)
    {
        //--- setup the listener to receive the uploaded id
        UploadUserControlID.PassID += new UploadUserControlID_ClassName.PassIDToParent(PassID);
    }
    protected void PassID(string id)
    {
        //--- this method is called from the listener above and it passes the id
        KeywordUserControlID.LoadID(id);
    }
    

    And the code for your keyword usercontrol would look like this:

    public void LoadID(string id)
    {
        //--- do whatever you need to with the id
    }
    

    Here is some more info regarding the use of delegates: http://webdeveloperpost.com/Articles/Return-value-from-user-control-in-ASP-NET-and-C-Sharp.aspx

    Hope that helps! Good Luck! Don’t forget to mark as answer!

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

Sidebar

Related Questions

my structure is like this: master page aspx(web form) ascx(user control) I have a
I have a drop-down list hardcoded in an MVC View User Control page and
I have a user control in a master page with two drop down lists.
I have a user control that is being integrated to the page on run
I have a nested user control which appears on every single page. It contains
I have a custom user control called ErrorNotificationBox. To place that on my page
I have a page (A) and a user control and I want to send
I have a page in which I am loading a user control dynamically as
Is there a way to access page controls from user control . I have
We have created a User Control for ASP.Net. At any one time, a user's

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.