Here is my Code View

@using (Html.BeginForm("userrights", "Users", FormMethod.Post, new { @class = "form-horizontal", role = "form"}))
    {
        <div class="form-group">
            <div class="col-md-7" style="padding-right:10px">
                @Html.TextBoxFor(m => m.companyname, new { @class = "form-control", @placeholder = "Serach By Sponser Name" })
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="form-group">
            <div class="col-sm-2">
                <button type="submit" id="btn_search" value="Search" name="btn_search" class="btn btn-default">Search</button>
            </div>
            <div class="clearfix"></div>
        </div>        
        </div>
        @Html.Partial("_userRightPartial", Model._UserRightPartialView)
        <div class="clear"></div>
    }

Controller Method

public ActionResult userrights()
        {
            IEnumerable<MenuListModel> _MenuListModel = _ftwCommonMethods.GetMenuItems();
            IEnumerable<SubMenuListModel> _SubMenuListModel = _ftwCommonMethods.GetSubMenuItems("1");
            UserRightViewSearch _UserRightViewSearch = new UserRightViewSearch();
            UserRightPartialView _UserRightPartialView = new UserRightPartialView();
            _UserRightPartialView._SubMenuListModel = _SubMenuListModel;
            _UserRightViewSearch._UserRightPartialView = _UserRightPartialView;
            _UserRightViewSearch._menu = _MenuListModel;
            _UserRightViewSearch.selectedMenu = 0;
            return View(_UserRightViewSearch);

        }

I want when page first time loads, _userRightPartial partial view should be hidden. After Submitting By Search Button it should appear.

I know it can be possible by Hide and Show DIV. But i want is there other way to do it with MVC Code?

Related posts

Recent Viewed