Solved

Vb code not finding function

Posted on 2013-01-17
2
352 Views
Last Modified: 2013-01-17
I'm  not sure what function this code is attempting to use.  This is re-writing old code to work with current versions of .net  currently the function Request() is flagged as undeclared. I'm not sure the original intent of this function or where to find it.

Partial Public Class _loginlookup
 

    

function stripQuotes(strWords) 
	stripQuotes = replace(strWords, "'", "''") 
end function 

function killChars(strWords) 
	dim badChars(0 to 6) as string
	dim newChars as string
	dim i 


	badChars(0) = "select"
    badChars(1) = "drop"
    badChars(2) = ";"
    badChars(3) = "--"
    badChars(4) = "insert"
    badChars(5) = "delete"
    badChars(6) = "xp_"
	newChars = strWords 
	
	for i = 0 to uBound(badChars)
		newChars = replace(newChars, badChars(i), "")
	next 
	killChars = newChars 
end function 

function HTMLEncoder(strWords) as string
	
    HTMLEncoder = System.Web.HttpContext.Current.Server.HTMLEncode(strWords)
end function

'Used to secure request objects (Strings ONLY)
function allSecure(fieldName)
	allSecure = stripQuotes(killChars(HTMLEncoder(Request(fieldName))))
end function

'Used to secure variables
function allSecure2(fieldName)
	allSecure2 = stripQuotes(killChars(HTMLEncoder(fieldName)))
end function

end class

Open in new window

0
Comment
Question by:UnderSeven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38788439
It looks like accessing the Request query parameter i.e. the current Request.
Try

System.Web.HttpContext.Current.Request(fieldName)

Open in new window

0
 

Author Closing Comment

by:UnderSeven
ID: 38788462
Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to filter by key press ? 6 55
vb.net convert long time to mm:ss 23 21
Problem to copy file 14 51
make control visible based off other control value 7 18
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question