T
tshad
I am trying to get a regular expression to work and I keep getting the
following error:
Compiler Error Message: BC30469: Reference to a non-shared member requires
an object reference.
The page is:
**********************************************************************************
<%@ Page Language="VB" trace="true" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script runat="server">
sub page_load(s as object,e as eventargs)
'dim testString as String = "a test"
testLabel.text = "a test"
testLabel.text = Regex.Replace(testLabel.text,"( and not | and )")
response.write(testLabel.text)
end sub
</script>
<body>
<asp:label id = "testLabel" runat="server"/>
</body>
</html>
***********************************************************************************
I tried it with both testLabel.text (which is an asp:label) and also
testString (string) and got the error with both.
I do exactly the same thing in my other asp pages to make a currency value
into a decimal value.
objCmd.parameters.add("@WagesMin",SqlDbType.Money).value =
Regex.Replace(WagesMin.Text,"\$|\,","")
This works fine.
What is the difference?
Thanks,
Tom
following error:
Compiler Error Message: BC30469: Reference to a non-shared member requires
an object reference.
The page is:
**********************************************************************************
<%@ Page Language="VB" trace="true" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script runat="server">
sub page_load(s as object,e as eventargs)
'dim testString as String = "a test"
testLabel.text = "a test"
testLabel.text = Regex.Replace(testLabel.text,"( and not | and )")
response.write(testLabel.text)
end sub
</script>
<body>
<asp:label id = "testLabel" runat="server"/>
</body>
</html>
***********************************************************************************
I tried it with both testLabel.text (which is an asp:label) and also
testString (string) and got the error with both.
I do exactly the same thing in my other asp pages to make a currency value
into a decimal value.
objCmd.parameters.add("@WagesMin",SqlDbType.Money).value =
Regex.Replace(WagesMin.Text,"\$|\,","")
This works fine.
What is the difference?
Thanks,
Tom