Click here to Skip to main content
15,880,427 members
Articles / Web Development / ASP.NET

Preventive Method for URL Request Forgery- An Example with ASP.NET MVC

Rate me:
Please Sign up or sign in to vote.
4.75/5 (13 votes)
29 Nov 2010CPOL7 min read 75.6K   1.7K   33  
It is novel method to prevent the manipulation of parameter pass through the URL string
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SecureUrl.Question>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th></th>
            <th>
                QuestionId
            </th>
            <th>
                Question Details
            </th>
            <th>
                Exam
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: item.QuestionId %>
            </td>
            <td>
                <%: item.QuestionDetails %>
            </td>
            <td>
                <%: item.Exam.Name %>
            </td>
        </tr>
    
    <% } %>

    </table>



</asp:Content>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer
India India
I am developer in .Net and GIS. albin_gis@yahoo.com

Comments and Discussions