而不是使用<a href=""> can I use a submit button for call a method in my cotroller?

时间:2015-08-27 14:20:08

标签: javascript html asp.net-mvc-4 razor

When I click on a bellow link fancybox will open by calling EnquireCourseIndex method. ImageGallery class is used to call below script.

  <a class="imageGallery btn btn-defaultPink" data-fancybox-type="iframe"
                           href="@Url.Action("EnquireCourseIndex", "DiplayCourse")">Enquire Now</a>

This is the script

<script type="text/javascript">
$(document).ready(function () {
    $('.imageGallery').fancybox({
        fitToView: false,
        width: '600px',
        height: '400px',
        autoSize: false,
        closeClick: false,
        openEffect: 'none',
        closeEffect: 'none',
        padding: 0,
        closeBtn: false,
        'afterClose': function () {
            window.location.reload();
        },
    });
});

Without using a < a href > tag Can I use the button?? I tried it out. but it isn't working. Does anybody have a idea??

This is the way how tried.

 @using (Html.BeginForm("EnquireCourseIndex", "DiplayCourse"))
 {
      <input type="submit" value="Enquire Now" class="btn btn-defaultPink ssarch"/>
 }

0 个答案:

没有答案