Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Index :

@using (Html.BeginForm(new { @style = "backgroundColor: '#f00', color: '#fff'} " }))
{


@{Html.RenderPartial("~/Views/Shared/_TermsAndConditions.cshtml");}


}

Partial View:

HTML
<div>
    <div id="TermsConditionsPopup" class="modal fade"  role="dialog" data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close CancelClass " data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Terms and Conditions</h4>
                </div>
                <div class="modal-body">
                    
                    <iframe src="@Url.Action("GetPDF", "Home")" width="100%" height="100%"></iframe>
                </div>
                <div class="modal-footer btn-sec">
                    <button type="button" class="btn btn-default" id="AgreeButton">I &nbsp; Agree</button>
                    <button type="button" class="btn btn-default" id="ProceedButton">Proceed</button>
                    <button type="button" class="btn btn-default CancelClass" data-dismiss="modal"> Cancel</button>
                </div>
            </div>

        </div>
    </div>

</div>


What I have tried:

I tried giving z-index but the menus load on the index page so when Partial view takes time to load meanwhile user can click on menu and bi-pass accepting terms and conditions . I want to block the menus and links on index page till the time modal is loaded completely
Posted
Updated 27-Sep-16 20:45pm
v2
Comments
Suvendu Shekhar Giri 28-Sep-16 3:10am    
In my opinion, the best way can be to have a separate page for accepting term and condition and upon acceptance move to the index page. However, that's just a view and you can look for further solution to resolve your issue.
Abrar Kazi 28-Sep-16 3:16am    
You are right but i cannot add another page. I have to find some other way to block the page for the time modal is loading.
F-ES Sitecore 28-Sep-16 4:27am    
Even if you get this working I can remove your pop-up using the browser dev tools, or simply disable javascript on my browser. There are so many ways to circumvent your T&C check that I wouldn't really bother spending much time on it. If you want a serious, robust T&C check then javascript is not the way to go.
Abrar Kazi 28-Sep-16 7:07am    
So how do i achieve it ?
F-ES Sitecore 28-Sep-16 7:13am    
You'll need to add a different page for the T&C check, or alternatively disable the elements on the page you don't want people to access until they agree with the T&Cs, then re-load the page once they have.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900