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
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to call confirm from C#.Net?

How to call confirm from C#.Net?

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptdatabasetutorialquestion
3 Posts 3 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.
  • Y Offline
    Y Offline
    YazhiniP
    wrote on last edited by
    #1

    Hi, In my application,the user have to upload   a particular document. I have to check the database and if the document has been already uploaded by the user.If so,then i have to get the consent of the user to overwrite. If he says ok,then the updation should happen. This should be done in the middle of btnUpload_click() event. Since confirm(msg) is a javascript function,how to call it from aspx.cs page?. It seems that a javascript function can be called only at some events(Buttonclick etc.) and <body onload().... :( How to call the confirm(msg) without any event firing?.Any ideas?. Thanks in advance

    Yazhini

    C L 2 Replies Last reply
    0
    • Y YazhiniP

      Hi, In my application,the user have to upload   a particular document. I have to check the database and if the document has been already uploaded by the user.If so,then i have to get the consent of the user to overwrite. If he says ok,then the updation should happen. This should be done in the middle of btnUpload_click() event. Since confirm(msg) is a javascript function,how to call it from aspx.cs page?. It seems that a javascript function can be called only at some events(Buttonclick etc.) and <body onload().... :( How to call the confirm(msg) without any event firing?.Any ideas?. Thanks in advance

      Yazhini

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Have you thought of changing your workflow? Upload the file to a temporary area. Then makes the check for overwrite and inform the user if that is the case. If there is no overwrite needed or the user permits the overwrite then move the data from the temporary area to the permanent area. If the user declines the overwrite then delete the data in the temporary area. NOTE: By Temporary area I do NOT mean TempDB

      1 Reply Last reply
      0
      • Y YazhiniP

        Hi, In my application,the user have to upload   a particular document. I have to check the database and if the document has been already uploaded by the user.If so,then i have to get the consent of the user to overwrite. If he says ok,then the updation should happen. This should be done in the middle of btnUpload_click() event. Since confirm(msg) is a javascript function,how to call it from aspx.cs page?. It seems that a javascript function can be called only at some events(Buttonclick etc.) and <body onload().... :( How to call the confirm(msg) without any event firing?.Any ideas?. Thanks in advance

        Yazhini

        L Offline
        L Offline
        l laxmikant
        wrote on last edited by
        #3

        write a javascript function function check { return confirm('your msg'); } and in form load add attribute btn.Attributes.Add('onclick','return check();');

        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