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

  • Home
  • SEARCH
  • 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 502697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:19:04+00:00 2026-05-13T06:19:04+00:00

I have a User control (because I use the same in other page, so

  • 0

I have a User control (because I use the same in other page, so I thought I should reuse code and not double my work), but in this page I show a list of companies and each one has a company number, I need to pass this company number to that User Control and it has to reload using that passed company number.

How can I accomplish this?

what I have so far:

alt text http://www.balexandre.com/temp/2009-09-17_0917.png

the Show company structure link is made of

<a href="javascript:showStruct('112:201334607','5564967221');" 
   class="showStructLink">Show company structure</a>

the showStruct method is written like

  function showStruct(pid, cnr) {
     if (_showStrut == 0)
        return;

     // fancy stuff to be more apealing visually
     $("#tdSearch").removeClass("tabTitleUp01").addClass("tabTitleDownUp01");
     $("#tdStruct").removeClass("tabTitleDownUp02").addClass("tabTitleUp02");

     $("#srtr1").hide();
     $("#srtr2").hide();
     $("#sttr1").show();

     // enable Search Results tab to be clicked in order to get back
     $("#tdSearch")
        .addClass("pointer")
        .bind("click", function() { hideStructure(); });

     // pass the company number and reload wcCompanyStruture web user control
     // __doPostBack('RefreshWebUserControl', cnr);
  }

I can make a simple aspx page with the control inside and from jQuery invoke $.get() to run and populate the control correctly, but I really want to learn how to do this properly, using the ASP.NET AJAX Method to send a number and call RefreshData on it

using code-behind it is easy to refresh the user control, just invoking

wcCompanyStruture.RefreshData("companyNumberHere");

what do I need to do in my User Control side and well in the showStruct method to create this behavior?

All help is appreciated, Thank you.

  • 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-13T06:19:05+00:00Added an answer on May 13, 2026 at 6:19 am

    I know this is not the answer to you question but I think you may be asking the wrong question.

    It looks to me as if you have a search result+details view scenario that you are going about the wrong way.

    When you click “Show Company structure” you want to see the details on the second tab right? If this is the case then the tab approach would be confusing to the user, it would be better with a modal popup that shows the details. No postback just AJAX load a page with the details into a modal popup window.

    This is very easy with JQuery using the dialog widget in JQueryUI and the AJAX load function $('#SomeDiv').load('details.aspx?id='+companyid);

    http://docs.jquery.com/Ajax/load#urldatacallback

    It would give a much better user experience and it is surprisingly simple to code.

    I hope this helps.

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

Sidebar

Related Questions

I have a user control ( gallery.ascx ) and I want to use the
I have a property of type IEnumerable<SomeClassIWrote> in a user control. When I use
I have made a user control in asp.net c#. Becuase of some data I
I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox
I have user control in my MVC2 app placed in the Content folder (it's
i have user control, which i render on several views. i want to show
I have a user control in a repeater that I need to pass data
I have a user control that is pretty basic. It contains several TextBox controls,
I have a user control where the XAML of the control can bind to
I have a user control that I'm building. It's purpose is to display the

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.