Hi, im am a classic asp developer and started to learn asp.net but got stuck
with a simple problem even before i step in to further.
to learn i have started from a simple project (a login system with forms)
due to projects platform (a mobile web site) i cant use cookies (cookies
arent supported on all phones), anyway because of that i do un/pw check on
very page and i have to put
Dim MyUn As String = MyFunctions.Alp haNumOnly(Reque st.QueryString( "un"))
Dim MyPw As String = MyFunctions.Alp haNumOnly(Reque st.QueryString( "pw"))
to every page. In classic asp i could create an include and put smilar code
to get un/pw but in asp.net (VB) i couldnt figureout how to. I ahve got my
functions.vb where i store shared functions and variables but could put
above in to it.
could anyone point me to right direction?
thanks 4 1861
to make it clear, here is my class
--------------
Public Class MyFunctions
Public Shared Function CheckLogin(ByVa l MyUnInput As String, ByVal
MyPwInput As String) As String
Dim MyResult As Integer
Dim MySql As String
MySql = "Select count(*) from users where un='" & MyUnInput & "' and
pw='" & MD5Encrypt(MyPw Input) & "'"
Dim Conn As New OleDbConnection (MyDbPath)
Dim Cmd As New OleDbCommand(My Sql, Conn)
Conn.Open()
MyResult = Cmd.ExecuteScal ar
Conn.Close()
Return MyResult
End Function
End Class
----------------------
how can i write so, instead of MyUnInput,MyPwI nput i can call
request.queryst ring("un"),requ est.querystring ("pw")
".nLL" <no***@here.com wrote in message
news:UT******** *********@newsf e01.ams2...
Hi, im am a classic asp developer and started to learn asp.net but got
stuck with a simple problem even before i step in to further.
to learn i have started from a simple project (a login system with forms)
due to projects platform (a mobile web site) i cant use cookies (cookies
arent supported on all phones), anyway because of that i do un/pw check on
very page and i have to put
Dim MyUn As String =
MyFunctions.Alp haNumOnly(Reque st.QueryString( "un"))
Dim MyPw As String =
MyFunctions.Alp haNumOnly(Reque st.QueryString( "pw"))
to every page. In classic asp i could create an include and put smilar
code to get un/pw but in asp.net (VB) i couldnt figureout how to. I ahve
got my functions.vb where i store shared functions and variables but could
put above in to it.
could anyone point me to right direction?
thanks
create a global.asa and add:
void Application_Aut horizeRequest(o bject sender, EventArgs e)
{
// call by validation code here
}
note: while shared functions are ok, shared variables (or public module
variables) are shared across all requests.
-- bruce (sqlwork.com)
..nLL wrote:
to make it clear, here is my class
--------------
Public Class MyFunctions
Public Shared Function CheckLogin(ByVa l MyUnInput As String, ByVal
MyPwInput As String) As String
Dim MyResult As Integer
Dim MySql As String
MySql = "Select count(*) from users where un='" & MyUnInput & "'
and pw='" & MD5Encrypt(MyPw Input) & "'"
Dim Conn As New OleDbConnection (MyDbPath)
Dim Cmd As New OleDbCommand(My Sql, Conn)
Conn.Open()
MyResult = Cmd.ExecuteScal ar
Conn.Close()
Return MyResult
End Function
End Class
----------------------
how can i write so, instead of MyUnInput,MyPwI nput i can call
request.queryst ring("un"),requ est.querystring ("pw")
".nLL" <no***@here.com wrote in message
news:UT******** *********@newsf e01.ams2...
>Hi, im am a classic asp developer and started to learn asp.net but got stuck with a simple problem even before i step in to further.
to learn i have started from a simple project (a login system with forms) due to projects platform (a mobile web site) i cant use cookies (cookies arent supported on all phones), anyway because of that i do un/pw check on very page and i have to put
Dim MyUn As String = MyFunctions.Al phaNumOnly(Requ est.QueryString ("un")) Dim MyPw As String = MyFunctions.Al phaNumOnly(Requ est.QueryString ("pw"))
to every page. In classic asp i could create an include and put smilar code to get un/pw but in asp.net (VB) i couldnt figureout how to. I ahve got my functions.vb where i store shared functions and variables but could put above in to it. could anyone point me to right direction? thanks
old habits die hard, isn't there any other option to do it? i dont want to
use global.asa or web.config. reason is that i want to be able to put
project in any folder on my server without having setup an appliaciton on
iis for it. that way it is portable and can be moved without any setup on
web server
"bruce barker" <no****@nospam. comwrote in message
news:up******** ******@TK2MSFTN GP02.phx.gbl...
create a global.asa and add:
void Application_Aut horizeRequest(o bject sender, EventArgs e)
{
// call by validation code here
}
note: while shared functions are ok, shared variables (or public module
variables) are shared across all requests.
-- bruce (sqlwork.com)
.nLL wrote:
>to make it clear, here is my class
-------------- Public Class MyFunctions Public Shared Function CheckLogin(ByVa l MyUnInput As String, ByVal MyPwInput As String) As String Dim MyResult As Integer Dim MySql As String MySql = "Select count(*) from users where un='" & MyUnInput & "' and pw='" & MD5Encrypt(MyPw Input) & "'" Dim Conn As New OleDbConnection (MyDbPath) Dim Cmd As New OleDbCommand(My Sql, Conn) Conn.Open() MyResult = Cmd.ExecuteScal ar Conn.Close() Return MyResult End Function End Class ----------------------
how can i write so, instead of MyUnInput,MyPwI nput i can call request.querys tring("un"),req uest.querystrin g("pw") ".nLL" <no***@here.com wrote in message news:UT******* **********@news fe01.ams2...
>>Hi, im am a classic asp developer and started to learn asp.net but got stuck with a simple problem even before i step in to further.
to learn i have started from a simple project (a login system with forms) due to projects platform (a mobile web site) i cant use cookies (cookies arent supported on all phones), anyway because of that i do un/pw check on very page and i have to put
Dim MyUn As String = MyFunctions.A lphaNumOnly(Req uest.QueryStrin g("un")) Dim MyPw As String = MyFunctions.A lphaNumOnly(Req uest.QueryStrin g("pw"))
to every page. In classic asp i could create an include and put smilar code to get un/pw but in asp.net (VB) i couldnt figureout how to. I ahve got my functions.vb where i store shared functions and variables but could put above in to it. could anyone point me to right direction? thanks
one thing:
this is not the right way:
MySql = "Select count(*) from users where un='" & MyUnInput & "' and
pw='" & MD5Encrypt(MyPw Input) & "'"
use parameters! this way up here you will have trouble with
sqlinjection.
>that way it is portable and can be moved without any setup on web server
I am curious the way you are developing...
in my idea: just put global.asax and web.config in the root folder of
the website using the asp.net page, and is done, what else?
I mean web.config is required.
Simone Foschi
MCTS Sql Server 2005 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Samantha Smit |
last post by:
Hi,
I am trying to create a simple asp page that has one command button that
updates a database. The URL of the page is like this:
http://MyServer.com/Update.asp?UserName=Tom
My asp code is like this:
%@ Language=VBScript %>
<!--#include file="includes/openconnection.asp"-->
|
by: SASRS |
last post by:
Here is my code. I am trying to see if I can put a
%@ LANGUAGE="VBSCRIPT" %>
<%
FieldA = Request.QueryString("A")
FieldB = Request.QueryString("B")
FieldC = Request.QueryString("C")
response.write("<TABLE ALIGN=CENTER>")
|
by: Paul |
last post by:
HI! I get an error with this code.
<SCRIPT language="JavaScript">
If (ifp==""){
ifp="default.htm"}
//--></SCRIPT>
Basicly I want my iframe to have a default page if the user enters in
directly. so I need a way doing this. so I check to see if the ifp value is
null and if so then assign it a value. is this correct?
|
by: Doug |
last post by:
I need to do the following...
FOR myitem IN Request.Querystring
'get the key
'get the value
NEXT
What do I DIM myitem as? DictionaryEntry doesn't work...or do I have to
loop through it by index and get the key then the item out of the query
string...
|
by: Stan Sainte-Rose |
last post by:
Hi,
I use this bit of code to generate dynamic tables in the page load section
....
Dim ntable as New Table
For i = 1993 To 2008
ntable = New Table
ntable.ID = "Q" + i.ToString
....
....
| |
by: Steve B. |
last post by:
Hello everybody
In a webpage, I use JS display data from an xml file and a xsl file:
var data = new ActiveXObject("Microsoft.XMLDOM");
data.async = false;
var dataUrl = "data.aspx";
data.load(dataUrl) ;
var transform = new ActiveXObject("Microsoft.XMLDOM");
transform.async = false ;
|
by: Bruno Alexandre |
last post by:
Hi guys,
Sorry about the off topic, but I can't find the ASP group just the ASP
dot NET
If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the form
collection (using post or get (form/querystring) I can't retrieve that
|
by: Goober |
last post by:
I have a page that receives a session variable from the default.aspx.
On Page load, the code in Page load gets executed twice. So far, no
problem. It sets the session variable each time, correctly.
However, when I click on a menu item in that page, it then executes the
same page load twice, before transferring control (via a
response.redirect) to the new page. On the first pass through the page
load of the menu page, the session...
|
by: janetb |
last post by:
Brand new to xml and I'm trying to get Scott Mitchell's rss aggregator example working locally. Basically, involves a frameset with the channels(feeds) in the left frame, a list of items in the channel in the lower right, and the single item in the top right based on a selection in the lower right. When the channel within the left frame is clicked, bottom right frame changes with the items for the channel (feed). Taking it step-by-step. Have...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |