Thursday, 15 August 2013

c# - Script manager popup doesn't appear -



c# - Script manager popup doesn't appear -

i have asp.net page. want throw pop upon clicking button on page. syntax used this:

scriptmanager.registerstartupscript(this, this.gettype(), "popup", "alert('invalid address!!');", true);

the popup did not appear.

however, when trying same syntax on different page in same project, worked.

any ideas?

try changing below line

scriptmanager.registerstartupscript(this, this.gettype(), "popup", "alert('invalid address!!');", true);

to

scriptmanager.registerstartupscript(this.page, this.gettype(), "popup", "alert('invalid address!!');", true);

if whatever reason above code doesn't work, seek below if works

scriptmanager.registerstartupscript(this.page, this.gettype(), "alert", "javascript:displayalert('invalid address!!');", true);

and js function

function displayalert(msg) { alert(msg); homecoming false; }

c# asp.net popup

No comments:

Post a Comment