Ajax Form Begin is not going to http GET method

Dinesh

I am trying to send the text box values in ajax form begin and show the corresponding partial view But the problem is it always going to the post method but i mension the httpmethod also in ajax form

My Code is

    @using (Ajax.BeginForm("UserMenuPermission", new AjaxOptions { HttpMethod = "Get", InsertionMode = InsertionMode.Replace, UpdateTargetId = "GridData" }))
    {
         <div>
                    @Html.Label("User Name")
                    <input type="text"  placeholder="User Name" style="color: black;height:30px;" name="Username"/>                            
                    <input type="submit" value="Search" />
         </div>
    }

This code can pass the information to UserMenuPermissionController POST method but i need to pass in GET Method Please Help Me Friends

Thanks In Advance.

M.Azad

I Suggest that use jquery.ajax get method

//Change your search button like this
<input type="button" value="Search" onclick="ajaxCall()" />
//in javascript
function ajaxCall()
{
 $.ajax({
  url: "ActionURL",
  type:"get", //send it through get method
  data:{} 
  success: function(response) {
    //response is your partialview html
  },
  error: function(xhr) {
    //Do Something to handle error
  }
});

}

in controller

public ActionResult GetHtml( )
{
    return PartialView( "UserDetails");
}

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

jquery ajax form validation not working with GET method codeigniter

분류에서Dev

MVC Ajax Begin Form onSuccess 데이터 객체

분류에서Dev

laravel ajax method : 'post'하지만 get으로 http 요청을 보냅니다.

분류에서Dev

get redirect_to and flash notices to work after ajax form submission

분류에서Dev

how is the output going to get displayed?

분류에서Dev

The correct use of method post-get in flask in select form

분류에서Dev

Codeigniter & Jquery Ajax, Post data not going through

분류에서Dev

HTTP request via AJAX or form-submit. Which one should I choose and why?

분류에서Dev

get model value on f:ajax or a4j:ajax listener method

분류에서Dev

ajax upload file form

분류에서Dev

HTML에서 ajax를 사용하여 HTTP Get 응답 처리

분류에서Dev

AJAX load method and toggle

분류에서Dev

Api Post error:The requested resource does not support http method 'GET'.88

분류에서Dev

유형이 'GET'인 $ http.get과 $ .ajax의 차이점은 무엇입니까?

분류에서Dev

Ajax form submission on a form created using jquery

분류에서Dev

Posting a form with ajax and unknown form fields

분류에서Dev

Get the list of test that are going to be executed with a PHPUNIT configuration file

분류에서Dev

AJAX not submitting the form after validation

분류에서Dev

Incomplete Form Data in ajax request

분류에서Dev

serialize form data with ajax in jsp

분류에서Dev

Post a form using ajax in Laravel

분류에서Dev

AngularJS form with multiple http requests

분류에서Dev

HTTP POST 대 HTTP GET

분류에서Dev

get name of hidden form

분류에서Dev

주기에서 HTTP REQUEST 시간의 GET METHOD를 가져 오는 스크립트

분류에서Dev

Jquery Ajax Get Div

분류에서Dev

Ajax GET request confusion

분류에서Dev

WCF HTTP GET API

분류에서Dev

Method Post and Get In CodeIgniter

Related 관련 기사

뜨겁다태그

보관