How to call confirm from C#.Net?
-
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
-
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
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
-
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
write a javascript function function check { return confirm('your msg'); } and in form load add attribute btn.Attributes.Add('onclick','return check();');