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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:27:38+00:00 2026-06-07T02:27:38+00:00

I have an aspx page which holds 2 user controls UC1: Edit page –

  • 0

I have an aspx page which holds 2 user controls

UC1: Edit page – this has the fields for editing or data entry.

UC2: Notification page – this has a simple message box with jquery function

in my aspx i have this function:

public void ShowMessage(string status, string message)
    {
        Notification1.Message = message; //this is my user control UC2
        Notification1.Status = status;
        Notification1.DataBind();
    }

now when my aspx page needs to show a message this works fine, but when i want the user control 1 to show a message like (invalid field, or wrong amount) it doesn’t do anything. Now it gets called but jquery just doesn’t react to it.

in UC2 -notification user control this is what I have:

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js"></script>
<script type="text/javascript">
function showMsg(classname) {
    $("#MsgBox").attr('class', classname);
    $("#MsgBox").show().delay(5000).fadeOut();
}
</script>
<div id="MsgBox" class="info"><asp:Label ID="lblMessage" runat="server" /></div>

codebehind

 public string Status{ get; set; }
    public string Message { get; set; }
    public override void DataBind()
    {
        if (Message != string.Empty)
        {

            lblMessage.Text = Message;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "showMsg('" + Status + "');", true);
        }

    }

and this is how i call the function from user control to aspx page:

((myaspxpage)this.Page).ShowMessage("error", "This is my error message.");

any help will be much appreciated! and if further details is needed just let me know.. Thanks in advance.

**EDIT: I tried putting the jquery and message box inside my Edit page to see if it would work that way and it doesn’t So it seems that jquery is not working well within a usercontrol??

  • 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-07T02:27:39+00:00Added an answer on June 7, 2026 at 2:27 am

    I found the error is what that my button that was calling the function in aspx page was inside an update panel and i needed to add a trigger event to make it work.. Thanks everybody for the help it was that update panel causing the error 🙁

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

Sidebar

Related Questions

I have a aspx page which contains 6 user controls which will be displayed
I have an ASPX page which has an iFrame in it the source of
I have an aspx page that has a @Page directive which points to a
I have a GridView on a .aspx page with a hidden column which has
I have a child page LoginContent.aspx which contains a login form. If the user
I have a WebParts.aspx page which looks like this - <%@ Page Language=C# AutoEventWireup=true
I have a < div > in my aspx page which has some notification
I have an aspx page, which is a User Log-In area. I want to
in my job (intranet)- I have an aspx page which has many Iframes (
I have an aspx page which allows a user to submit modified entries into

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.