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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:56:50+00:00 2026-05-26T22:56:50+00:00

On the click of the button my Onclick event gets fired. Inside the onclick

  • 0

On the click of the button my Onclick event gets fired.
Inside the onclick event I generate somefile at runtime and render it to the browser in the following way. But before rendering it to the browser I am making particular Label visible. But still the Label never become visible. Any idea what is the problem

    lblInfoMessage.Visible=true;
    Response.ContentType = "text/plain";
    Response.AppendHeader("Content-Disposition", "attachment; filename=test.gxml");
    doc.Save(Response.OutputStream);
    Response.End();
  • 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-26T22:56:51+00:00Added an answer on May 26, 2026 at 10:56 pm

    You can either refresh the page (and thus change visibility or contents of controls) or send an attachment. Not both. So you will have to find some other way, maybe client side javascript?

    EDIT
    In the button you need a OnClientClick in the server side code, this will translate into a client-side “onclick”. Here you can call a javascript function where you can (for instance) display some text. Note that this function is executed before the submit action that will generate the file.

    Something like this in the html/aspx:

    <span id="infoMessage"><!-- empty --></span>
    ...
    <asp:Button OnClientClick="showInfo()" ... />
    ...
    <script type="text/javascript">
      function showInfo() {
        document.getElementById("infoMessage").innerText = 
            "This is the info message.";
    
      }
    </script>
    

    You can’t just show that Label that you have now, as that doesn’t exist in the client-side html when it is invisible.

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

Sidebar

Related Questions

I am trying to fire a javascript by onclick event of submit button but
How do I fade in an element after using jquery's .before? jQuery $('.button').on(click, function(event){
I insert dynamically some images used as buttons and add an onClick event. $(img.image_edit_customer).live(click,
I have a button which on Click loads another activity, but before it loads
I have a form on ASP .NET page, with button onclick event attached to
I have number of drop down menu's which gets called with a onClick event
On click of a button a Combo Box gets displayed and on select of
I need to disable anchor tag using button click event. I handled both server-side
I have a UINavigationController. On the right top i have a button on click
I have a delete button on a table and a jquery on click eventlistener

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.