views:

99

answers:

1

I am currently working with an IPhone API which consist of about 40 pages of aspx along with their respective aspx.vb pages. They are all partial classes because the API continues to add other phone platforms to it. Currently I have them residing just in a folder. /API/0.1 and /API/1.0 ...

How would I call the functions from those IPhone API classes without having to put them in the App_code?

example: I have a partial class SetTextBroadcast with a function like this

 Function BroadcastMessage(ByVal Brodcast_recipient() As net.pmgateway.Recipient, ByVal str_Message As String) As net.pmgateway.Reply
    'code here
End Function

How do i use that function in a webform? or do I need to put it in App_Code?

something like this is what i'm looking for.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



    Dim objSetTextBroadCast as new SetTextBroadCast()


End Sub

but i get type "SetTextBroadCast" not defined.

thanks for your help

+1  A: 

You could change your web site project into a web application project (in Visual Studio 2008, there's a convert option in the project's context menu, be sure to make a backup first). In a web application, you are no longer required to have shared code in App_Code.

Beware though, that there are other subtle differences between these two project types. The following links from MSDN might help:

Heinzi
Hi Heinzi, I wouldn't be able to convert the web site project over because the code base is basically thousands of pages and there are just so many errors with it. It's actually a work web site that's been built upon for years. I can't really debug it really. the only way to debug is to upload pages up to a dev server and see reflected changes. can i just add just the function code that i need to call to App_code instead?
stevenjmyu
@megatoast: Ah, ok, I understand. Then I guess you have two choices: Move the API stuff to App_Code, or create a DLL for those API classes (and reference it in your web site project). Unfortunately, you won't be able to put the API's aspx pages into a DLL.
Heinzi