Forums » About Techulator.com » Suggestions and Feedback »

ASP.NET Program To Block <iframe>


Posted Date: 26 Jun 2012      Posted By:: Mahavir Nahata     Member Level: Silver    Member Rank: 252     Points: 5   Responses: 0



default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Debug="true" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>







default.aspx.cs
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
string a = TextBox1.Text;
string b = a.Replace("<iframe","& lt;iframe");
TextBox2.Text = Convert.ToString(b);

}
}








Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.

Next : My article moved to pending what should I do?
Previous : Why can't I see my tags?
Return to Discussion Forum
Post New Message
Category:

Related Messages
Subscribe to our upcoming monthly newsletters and learn about the new opportunities in Techulator.com

Sign up for our Newsletter!
Subscribe to RSS Feeds by Email

Online Members

Shafeer V U
More...
Awards & Gifts
Active Members
TodayLast 7 Daysmore...

Talk to Webmaster Tony John