Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem in script

Problem in script

Scheduled Pinned Locked Moved ASP.NET
helpjavadatabasetools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    janani13
    wrote on last edited by
    #1

    Hi all, Im using java script for alert message. Im saving a record into Db. A flag will be set for existance of the record. If it returns "already exist" the script would be invoked. But the compiler moves into the script but it wont raise any event.But i checked a script on page load its works fine. I dont know why the script is not raise. Please help me..

    flag = adminDAL.InsertAdminEvnt(adminBO);

            if (flag == "Inserted")
            {
                //  Page.RegisterStartupScript("Error", "<script>success();</script>");
                Response.Redirect("Events.aspx");
            }
            else
            {
               
                Page.RegisterStartupScript("Error", "<script>alert('a')</script>");
             
            }
    
    A 1 Reply Last reply
    0
    • J janani13

      Hi all, Im using java script for alert message. Im saving a record into Db. A flag will be set for existance of the record. If it returns "already exist" the script would be invoked. But the compiler moves into the script but it wont raise any event.But i checked a script on page load its works fine. I dont know why the script is not raise. Please help me..

      flag = adminDAL.InsertAdminEvnt(adminBO);

              if (flag == "Inserted")
              {
                  //  Page.RegisterStartupScript("Error", "<script>success();</script>");
                  Response.Redirect("Events.aspx");
              }
              else
              {
                 
                  Page.RegisterStartupScript("Error", "<script>alert('a')</script>");
               
              }
      
      A Offline
      A Offline
      amitabha123
      wrote on last edited by
      #2

      Just put the javascript code in a div with visibility false. Now depending on the condition make the visibility of that particular div true. Please mark it as answer if it helps.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups