당신은 자바 스크립트를 사용하여 앵커 태그에서 포스트 백을 수행하려는 경우, 당신이 할 수있는
document.forms[0].submit(); //This will post your form
또는
__doPostBack();
또는 당신이 발생하는 포스트 백을 제어하는 알고 싶다면
.
자바 스크립트는이 당신을 위해 무엇을 찾고있는
<input type="hidden" name="__EVENTTARGET" />
<input type="hidden" name="__EVENTARGUMENT" />
희망을 작동하도록 ASPX 코드를 다음과 같이
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
alert(theform.__EVENTARGUMENT.value);
theform.submit();
}
.
jQuery는 JavaScript 라이브러리가 아니라 JavaScript 라이브러리입니다. – Quentin
가능한 [클라이언트 측 자바 스크립트 함수에서 서버 메서드 뒤에 코드를 호출하는 방법?] (http://stackoverflow.com/questions/5828803/how-to-call-code-behind-server-method-from-a) -client-side-javascript-function) – Quentin