Javascript confirmation in asp.net
-
Hi, To show confirmation dialog on button click we use button1.Attributes.Add("OnClick", "var ans =Check_Duplication();") But in my case I need to check some value if that value is zero then I want to display confirmation box. ex. button_click() { if customerId=0 then //// show confirmation box end if } Thanks, Nagarj.
-
Hi, To show confirmation dialog on button click we use button1.Attributes.Add("OnClick", "var ans =Check_Duplication();") But in my case I need to check some value if that value is zero then I want to display confirmation box. ex. button_click() { if customerId=0 then //// show confirmation box end if } Thanks, Nagarj.
check dis condition in the javascript function and accordingly display the confirmation box else return back eg.button1.Attributes.Add("onclick","javascript:return test(cutomerId);") function test(val) { if(val ==0) { //call confirm() } } modify the code accordingly ..
-
check dis condition in the javascript function and accordingly display the confirmation box else return back eg.button1.Attributes.Add("onclick","javascript:return test(cutomerId);") function test(val) { if(val ==0) { //call confirm() } } modify the code accordingly ..
Hi Kapil, Actually on button click I check duplication of record which I want to insert and set variable cnt to 1 for dulication and display confirmation msg. now parameter I need to send in javascript function is get assigned on button click...so how could I...... button_click() { Dim cnt As Integer = CheckProjectDuplication(ProjectName) If (cnt > 0) Then /// show confirmation end if } I hope u understand my problem.... Thanks, Nagraj
-
Hi Kapil, Actually on button click I check duplication of record which I want to insert and set variable cnt to 1 for dulication and display confirmation msg. now parameter I need to send in javascript function is get assigned on button click...so how could I...... button_click() { Dim cnt As Integer = CheckProjectDuplication(ProjectName) If (cnt > 0) Then /// show confirmation end if } I hope u understand my problem.... Thanks, Nagraj
Nagraj Naik wrote:
button_click() { Dim cnt As Integer = CheckProjectDuplication(ProjectName) If (cnt > 0) Then /// show confirmation end if }
Dim cnt As Integer = CheckProjectDuplication(ProjectName)
If (cnt > 0) Then
Response.Write("alert('Done');");
end ifBest regard pAthan
please don't forget to vote on the post that helped you.
-
Nagraj Naik wrote:
button_click() { Dim cnt As Integer = CheckProjectDuplication(ProjectName) If (cnt > 0) Then /// show confirmation end if }
Dim cnt As Integer = CheckProjectDuplication(ProjectName)
If (cnt > 0) Then
Response.Write("alert('Done');");
end ifBest regard pAthan
please don't forget to vote on the post that helped you.
Hi Imran, I want to show confirmation dialog box and not a dialog box. Thanks, Nagraj
-
Hi Imran, I want to show confirmation dialog box and not a dialog box. Thanks, Nagraj
write confirm instead of alert
please don't forget to vote on the post that helped you.
-
write confirm instead of alert
please don't forget to vote on the post that helped you.
Hi, It will not work. u can try any sample application. thanks, nagraj
-
Hi, To show confirmation dialog on button click we use button1.Attributes.Add("OnClick", "var ans =Check_Duplication();") But in my case I need to check some value if that value is zero then I want to display confirmation box. ex. button_click() { if customerId=0 then //// show confirmation box end if } Thanks, Nagarj.
You can use
confirm()
for that.. If you are interested to create a custom javascript confirm dialog, you can check this.Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
-
Hi, It will not work. u can try any sample application. thanks, nagraj
try following code
if(confirmid==0)
{
Response.Write("window.confirm('?');");
}Best regard pAthan
please don't forget to vote on the post that helped you.
-
Hi, It will not work. u can try any sample application. thanks, nagraj
Nagraj Naik wrote:
u can try any sample application.
Do you want to execute some other code when user clicks "ok" on confirm box ? If yes Pathan's suggestion won't work.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Nagraj Naik wrote:
u can try any sample application.
Do you want to execute some other code when user clicks "ok" on confirm box ? If yes Pathan's suggestion won't work.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Hi, Absolutely...I want to write some code on "OK" select. Thanks, Nagraj.