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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:05:08+00:00 2026-05-19T13:05:08+00:00

I am saving a form in ASP.Net and C#. Every thing works fine except

  • 0

I am saving a form in ASP.Net and C#. Every thing works fine except the message after save is not displayed. It is getting lost somewhere in between i am not able to figure why?

 protected void btnSave_Click(object sender, EventArgs e)
    {
        int fisherId;
        try
        {
            if (ValidateControls())
            {
                _traceLog.AppendLine("Fisheries Registration Form saving : btnSave_Click() ");
                FillDemographicsObjects();

                if(_manager.CreateFisherDemographics(_demographics, _address, "Test User",out fisherId))
                {
                   /*ShowMessage(IntertribalFishriesResource.msgSaveSuccess);*/

                    if (_shared.SendMailToFisher(fisherId))
                    {
                        _traceLog.AppendLine("Fisheries Registration Form ending : btnSave_Click() ");
                        Response.Redirect("~/Fisher/FisherRegistration.aspx?Id=" + fisherId, false);

                    }
                }

            }
        }
        catch (Exception ex)
        {
            _userException.CreateExceptionLog(ex);
        }
        finally
        {
            _userException.CreateTraceLog(_traceLog.ToString());

        }

    }

Message displayed in greyed text is not executed. ShowMessage is given below:

  protected bool ShowMessage(string message)
    {
        if (message.Length > 0)
        {
            hidErrMsg.Value = message;
           ScriptManager.RegisterStartupScript(upFisherRegistration, this.GetType(), "myScript", "ShowMessage();",true);
            return false;
        }
        return true;
    }

What I want to achieve is that , after successful save operation , i want to display message and redirect the page. Thats all.

  • 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-19T13:05:09+00:00Added an answer on May 19, 2026 at 1:05 pm

    HI,

    when you add RegsiterStartupScript this will be executed for current Request session and it will be written to response, if you redirect after it than your message wont be shown because script doesn’t exists in response.

    What you need to do is add another parameter in redirect url like &showSaveMessage=true
    and on redirected page check if showSavemessage is true add Register startup script method.

    I hope this helps

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

Sidebar

Related Questions

I have an ASP.NET FormView within an updatepanel. I'm auto-saving the form by setting
I've got an asp.net web form, there is an update panel that contains a
(Was: ASP.Net codebehind not finding controls on the web page) I'm using VS 2008.
I'm working on ASP.NET 4.0 and I'm having problems for saving the selected value
I am creating the user ,using asp.net + C#.there is the form (UI) who
My question is about a high performance way to implement auto-saving in an ASP.NET
I have an ASP.NET MVC3 app that features a form with a nested-table input
I am having some trouble getting a button clicked after submitting a form using
My Java application is saving stuff in 'user.home' but on windows this does not
I am currently saving a .net ( c# ) usercontrol to the disk as

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.