Showing posts with label problemi. Show all posts
Showing posts with label problemi. Show all posts

Monday, March 26, 2012

newbie class problem

Hi
Sorry to hassle you all again...

Still stuggling with classes. Heres the problem:

I have an aspx code with the following:


<%@dotnet.itags.org. Page Language="VB" src="http://pics.10026.com/?src=photogranny_connections.vb" inherits="Peter" %>
<script runat="server">
dim SQL as string = "SELECT * FROM [images] Order by ID asc"
dim Referrer as string ="OpenDS"
connectionStr(SQL,Referrer)
</script>
<html>...etc

and then I have the class as below


imports system
imports System.Data
imports System.Data.ODBC
imports System.Web.HttpContext
imports System.Web.UI.Page
imports system.web.UI

Public Class Peter
Inherits Page

Sub connectionStr(SQL as string,referrer as string)
-->logic here
End Sub

End Class

however, When I try and call the sub I get 'declaration expected'. Its referring to connectionStr. Its as if it can't see the sub. Iver tried making it a public sub but no joy. The .vb file is in the same directory as the other page.

Thanks for your help
PeterWhen you create a class, you must initialize an object of that class before using it.

MyClass obj = New MyClass
obj.MethodName1("...")

regards
thanks. is this the same for a codebehind file. If I just change the page directive to codebehind="filename" how then do I call the individual subs?

Thanks
Well its the same thing.

regards

Saturday, March 24, 2012

NEWBIE has a prob

Hello, I have just picked up a book on ASP.NET and installed the .NET
framework 1.1. I run Win XP Pro SP1 and IIS 5.1.

The problem:
I 've tried to run two different .aspx files and the browser displays simple
html (text) but no forms or anything like that. IE keeps giving this error
"Line: 4, Char:6, Error:Expected ';', Code:0", but I've checked the code and
is fine. Everything works ok with good old ASP.
Any idea what this annoyance might be?

Thank you all in advance.You may need to repair your IIS mappings.
To do this, run the following command:
aspnet_regiis.exe -i

Here's further information:
http://support.microsoft.com/defaul...B;EN-US;q306005

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

"Hugo Bohorquez" <hugob@.sympatico.ca> wrote in message
news:JOmYa.6040$pq5.811642@.news20.bellglobal.com.. .
> Hello, I have just picked up a book on ASP.NET and installed the .NET
> framework 1.1. I run Win XP Pro SP1 and IIS 5.1.
> The problem:
> I 've tried to run two different .aspx files and the browser displays
simple
> html (text) but no forms or anything like that. IE keeps giving this error
> "Line: 4, Char:6, Error:Expected ';', Code:0", but I've checked the code
and
> is fine. Everything works ok with good old ASP.
> Any idea what this annoyance might be?
> Thank you all in advance.