0
votes

I am using javascript in my asp.net project dynamically. But this error occurred: " Microsoft JScript runtime error: Object expected". Here is my code :

dropdownlist1.Attributes.Add("onchange", "return" + "confirm('Kaydetmek istediğinize emin misiniz')");

pop up is not opening. Any Idea ?

1

1 Answers

2
votes

Change your code to this, adding a space between return and confirm. The concatenation isn't really required

dropdownlist1.Attributes.Add("onchange", "return confirm('Kaydetmek istediğinize emin misiniz')");