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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:23:50+00:00 2026-05-31T10:23:50+00:00

In my application I’m using a usercontrol for two pages: AddInfo.aspx and EditInfo.aspx. The

  • 0

In my application I’m using a usercontrol for two pages: AddInfo.aspx and EditInfo.aspx.

The thing is that I want different thing to happen when saving the info, depending on which page the user is at (ie. what he’s actually doing).

So what i’m wondering is if there’s any way to use an if statement to find out which page that right now is using the user control? In that case my problem could be solved.

protected void SaveButton_Click(object sender, EventArgs e) {

    if (//The page using the usercontrol = Edit.aspx) {
        // do this...   
    }
    else {
        // do that...   
    }
}

Thanks in advance

  • 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-31T10:23:51+00:00Added an answer on May 31, 2026 at 10:23 am
    protected void SaveButton_Click(object sender, EventArgs e) {
    
        if (this.Page is EditInfo) {
           // do this...   
        }
        else {
            // do that...   
        }
    }
    

    Where EditInfo is your page’s class.

    You could also define a Behavior property on your user control and set it in your Xaml code according to what you want in which page. This would be a nice way to avoid the need to know where you are.

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

Sidebar

Related Questions

Application is asp.net MVC. I want to put a textbox for date using mask.
Application db connection in web service. i haveto connect the db using that web
Application : HTA (therefore IE) This is an application that uses SendKeys to populate
Application-Stack: Rails3, CanCan, Devise, Shoulda I've got some nested Resources and want to test
The application I'm currently writing is using MVVM with the ViewModel-first pattern. I have
my application use 10 threads that to read a lot of html file.similar the
Application running in django, apache, python and mysql: I want to create global variable
My application (the bootstrap application for an installer that I'm working on needs to
My application is mostly organised in layers so I found that something like the
My application ( main.exe ) is executing a Child process ( child.exe ) using

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.