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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:14:54+00:00 2026-05-11T09:14:54+00:00

I’m having a problem setting up an event on a form. Here’s the setup:

  • 0

I’m having a problem setting up an event on a form. Here’s the setup:

I was given a page with two controls, two different versions of a form for the end-user to fill out- standard and advanced. The two forms have different code and javascript, so the original dev put them in separate web user controls. Aside from the controls is a LinkButton that switches to Advanced mode.

<uc1:Standard runat='server' ID='StandardForm' /> <uc1:Advanced runat='server' ID='AdvancedForm' /> <asp:LinkButton runat='server' ID='lnkAdvanced' Text='Go To Advanced' OnClick='lnkAdvanced_Click' /> 

lnkAdvanced_Click just takes all the info currently entered to the advanced and flips the Visible.

My problem is that one of the bosses wants the ‘Go to Advanced’ button inside the standard form, but the .Visible code is on the page. So I thought it could be done using an event, but it doesn’t seem to be working.

I tried to set up the event like this:

public event EventHandler AdvanceClick;  protected void lnkAdvanced_Click(object sender, EventArgs e) {     AdvanceClick(sender, e); } 

And when that didn’t work, I tried to set up a delegate:

public delegate void AdvancedEventHandler(object sender, EventArgs e); public event AdvancedEventHandler AdvanceClick; 

When I moved the button to the standard form, I expected to be able to type something like:

StandardForm.AdvanceClick += new AdvancedEventHandler(GoToAdvanced); 

But it doesn’t seem to recognize any events within the control! I get an error: ‘Standard does not contain a definition for ‘AdvanceClick’ and no extension method ‘AdvanceClick accepting a first argument of type ‘Standard’ could be found’ It finds the other properties just fine, am I going about this the wrong way?

  • 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. 2026-05-11T09:14:54+00:00Added an answer on May 11, 2026 at 9:14 am

    If the standard form has the ‘Switch to advanced’ button. Then, clearly, it has to know about the Advanced form and thus they seem to be pretty tightly coupled. If this is the case, it seems to me that you might as well just have the advanced form as a child of the standard form then… or better yet, merge them into one control.

    If you don’t like these options you might want to create a third controls which hosts the button and the two forms, along with the logic to move data between them and toggle their visibility.

    I personally recommend the single control option. Having tighly coupled controls usually just leads to confusion down the road. You could loosen up the dependency in various ways, but think hard about it before you do so.

    In the legacy project I currently work on we have a bunch of examples such as serach forms and search results being split up into multiple controls, but then in the end needing each others instances to function properly. As I said earlier, I wont reccomend this path.

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

Sidebar

Ask A Question

Stats

  • Questions 80k
  • Answers 80k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can specify any CSS selector to get at your… May 11, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer This is ultimately handled in Web.config. Look for the httpRuntime… May 11, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer The problem is that you're mutating your array directly. Implement… May 11, 2026 at 4:21 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.