Microsoft JScript runtime error: Member not found
Asked Answered
L

2

8

i am using asp.net mvc3 and jquery dialogue to open partial view in main view

here is my structure..

partialview 1

<input type="button" onclick="function1();">

partial view 2

<form method="post"> 
    //some elements

    @Html.RenderPartial("partialview1");
</form> 

view 1

<script src="myscript.js" />
<script src="jquery.js"/> 
//some element

<div>
    load partialview 2 as jquery dialogue 
</div>

myscript.js

  function function1()
  {
     //some code
  }

this is just only overview of my application

now in above structure if i click on button in the partialview1 i am getting this error : Microsoft JScript runtime error: Member not found.

Lemos answered 30/11, 2012 at 14:58 Comment(2)
Problem is probably inside function1, could you post what "some code" actually is?Catanddog
actually function1 is not called.. as i have put debugger at first line.Lemos
L
23

I found the solution in my case.

<input id="function1" type="button" onclick="function1();">

I have used id of the input type button (ie: function1) as the same name of function (ie: function1).

As I don't know much about it. But by changing id of the button or function name solves my problem.

Lemos answered 1/12, 2012 at 5:35 Comment(2)
That makes sense. Internet Explorer has the bad habit of creating global variables for elements' IDs, overwriting existing variables and functions.Catanddog
I had a javascript function with the same name as a hidden field. Changing that stopped this error.Uzzia
M
1

Actually, 'Member Not Found' occurs on all browsers and other non-browser programs. In browsers, placing a button or radial with the same name as the function it calls within a form induces this error. Either rename the button or move it outside of the form.

Mudslinging answered 5/6, 2017 at 15:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.