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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:04:24+00:00 2026-06-10T14:04:24+00:00

I have a common function(custom control’s function) that is called from various webpages in

  • 0

I have a common function(custom control’s function) that is called from various webpages in the application.
In the common function,I call a javascript like this(Sample Code)-

public void ShowMessage(string strMessage)
{
   string s=String.Empty;
   s="<script type='text/javascript'>\n";
   s = s + "alert('+strMessage+');";
   s = s + "</script>";
   Page.ClientScript.RegisterStartupScript(typeof(Page), this.ClientID, s);
}

When I called this function from a page that is using UpdatePanel,Page.RegisterStartUpScript didn’t work.
So, I have to use
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), this.ClientID, s, false);
Now,I have to pass one more parameter to determine the function was called from UpdatePanel.
Like this-

public void ShowMessage(string strMessage,bool isFromUpdatePanel){..}

My Question is ,In the common function,can I know whether the function is called from UpdatePanel or not(without using parameter)?

  • 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-10T14:04:25+00:00Added an answer on June 10, 2026 at 2:04 pm

    I found an answer and I will use this(got from Here)-

    string args= Page.Request.Params.Get("__EVENTTARGET");
    if (!String.IsNullOrEmpty(args))
    {
        //Called From Update Panel(or) UpdatePanel is posting back
    }
    else
    {
        //Called From a page with no Update Panel
    }
    

    If there is a better solution,please teach me.

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

Sidebar

Related Questions

I am not so strong in javascript. I have a common function that I
Im looking to have a common parent function like so void main (param 1,
I have common functionality that I need to access from all screens of my
I have created a custom control using VB.NET in Visual Studio 2008 that gives
I have several views that have common code I'd like to abstract into a
I have a common validation function function connect_and_update_destination() { var flag = true; //
I have a common comms library that i have written to communicate with our
I have a common problem that I never know how to solve with CSS:
My Problem: I have an MVC3 application where all views use a common master
This seems like a common question but search is not returning anything. I have

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.