|
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
public partial class JavaScriptFunctionInjection : System.Web.UI.Page
{
public string sValue = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(Object sender, CommandEventArgs e)
{
string formValue = Request.Form["Text1"] as string;
string formValue2 = Request.Form["Text2"] as string;
if (e.CommandArgument == "single")
{
if (!string.IsNullOrEmpty(formValue))
{
sValue = Server.HtmlEncode(formValue.Replace("'", "''"));
}
}
else
{
if (!string.IsNullOrEmpty(formValue2))
{
sValue = formValue2; //quote
}
}
}
}
|
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.
I have over 10 years of experience working with Microsoft technologies. I have earned my Microsoft Certified Technology Specialist (MCTS) certification. I'm a highly motivated self-starter with an aptitude for learning new skills quickly.