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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:21:56+00:00 2026-06-09T10:21:56+00:00

I want to create a Javascript alert in an asp.net web application. But i

  • 0

I want to create a Javascript alert in an asp.net web application. But i can’t able to create this. I post my partial code is here the script manager javascript alert not displayed. Please help me to show the javascript alert..

if (noofday > totalday)
{   

    // I want to display the confirm message box in this section   

    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "return confirm('Are you sure you want to delete');", true);
    if(true)
    {
        DataSet5TableAdapters.sp_inleaverequestTableAdapter TA = new DataSet5TableAdapters.sp_inleaverequestTableAdapter();
        TA.GetData(lbl_empcode.Text, lbl_empname.Text, lbl_dept.Text, txtfromdate.Text, txttodate.Text, Convert.ToString(noofday), ddlleavetype.SelectedItem.Text, Convert.ToString(totalday), txtreason.Text, ddlforward.SelectedItem.Text, " ", " ", " ", " ", lbl_date.Text);

        Send_Email(lbl_empcode.Text, lbl_empname.Text, txtfromdate.Text, txttodate.Text, noofday, ddlleavetype.SelectedItem.Text, txtreason.Text);
        clear();
        ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Request sent successfully. Go and watch your status..');</script>", false);
    }
    else
    {   
        //DO Something
    }
}
else
{
    DataSet5TableAdapters.sp_inleaverequestTableAdapter TA = new DataSet5TableAdapters.sp_inleaverequestTableAdapter();
    TA.GetData(lbl_empcode.Text, lbl_empname.Text, lbl_dept.Text, txtfromdate.Text, txttodate.Text, Convert.ToString(noofday), ddlleavetype.SelectedItem.Text, Convert.ToString(totalday), txtreason.Text, ddlforward.SelectedItem.Text, " ", " ", " ", " ", lbl_date.Text);

    Send_Email(lbl_empcode.Text, lbl_empname.Text, txtfromdate.Text, txttodate.Text, noofday, ddlleavetype.SelectedItem.Text, txtreason.Text);

    ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Request sent successfully. Go and watch your status..');</script>", false);
    clear();
}
  • 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-09T10:21:57+00:00Added an answer on June 9, 2026 at 10:21 am

    I would suggest that you first try to figure out if the code you expect is being returned to the page.

    There are few ways to do this, with the easiest being “View Source” on the page after your above code runs. If you can find that content in the page, you will know that the content is being returned to the page but not executed.

    If you do not see the content when viewing source, then you have a different problem. Either control is being passed to another page, or its not actually going to the if condition you expect.

    Once you understand where the problem originates from these two pieces, you can start to find what may be causing it.

    It is also somewhat apparent that you may not completely understand how the web works. Given this set of code….

           ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "return confirm('Are you sure you want to delete');", true);
                if(true)
                {
                    DataSet5TableAdapters.sp_inleaverequestTableAdapter TA = new DataSet5TableAdapters.sp_inleaverequestTableAdapter();
                    TA.GetData(lbl_empcode.Text, lbl_empname.Text, lbl_dept.Text, txtfromdate.Text, txttodate.Text, Convert.ToString(noofday), ddlleavetype.SelectedItem.Text, Convert.ToString(totalday), txtreason.Text, ddlforward.SelectedItem.Text, " ", " ", " ", " ", lbl_date.Text);
    
                    Send_Email(lbl_empcode.Text, lbl_empname.Text, txtfromdate.Text, txttodate.Text, noofday, ddlleavetype.SelectedItem.Text, txtreason.Text);
                    clear();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Request sent successfully. Go and watch your status..');</script>", false);
                }
    

    … it appears that you are expecting the page execution on the server to stop and then wait for the client to respond. This is not how the web page life cycle works. The server code is going to execute completely and send content back to the client. Its not an interactive process (even with AJAX) like a windows forms or console application.

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

Sidebar

Related Questions

I'm building a web-application in JavaScript using the dojo framework. I want to create
I am trying to create an asp.net web application, in which when user logins
I use embedded SVG in XHTML and want to create animations from Javascript, but
Possible Duplicate: Custom alert using Javascript I want to create a confirmation message-Do you
this is the code where i create tree in telerik mvc. Now i want
I want to create with Javascript some controls inside a form and then I
I want to create a Javascript class/object that allow me to have various method:
I want to create a simple Javascript program with a HTML interface. The program
I want to create a string in JavaScript that contains all ascii characters. How
Basically I want to create one large object of many object in JavaScript. Something

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.