I have a web application I’m trying to create a class based on the ftp plugin that Andrew Lambert wrote. However when I duplicate the class and point it to the superclass the project works compiles and runs, but when i save the project and reopen it I get the following error
VehicleDetailsPage.Client1.Name Layout (property name) Cannot assign a value to this property Name
Ah. Okay, the problem is that classes dragged onto a WebPage, WebDialog or WebContainer must be a subclass of WebControl. If they’re not, you get the error you describe.
here are two ways you might handle this:
Add the ftp class to the page as a property and direct it’s events using AddHandler.
Wrap the ftp class in a subclass of WebControlWrapper. You’ll need to do a little reading about the WebSDK, but you’ll be able to get away with just a basic tray only control.
Let’s say your ftp class has an event called FileSent:
Create a method on the webPage called FTPFileSent (the name doesn’t matter)
Set the parameters the same as the event and then insert a parameter at the start to represent the instance that is firing the event. If the original signature was:
FileSent(f as FolderItem)
Then the method’s signature would be
FTPFileSent(myFTP as FTP.Client, f as FolderItem)
right after the code where you create the instance, you’ll need to add lines that look like this:
[quote=144097:@Greg O’Lone]Let’s say your ftp class has an event called FileSent:
Create a method on the webPage called FTPFileSent (the name doesn’t matter)
Set the parameters the same as the event and then insert a parameter at the start to represent the instance that is firing the event. If the original signature was:
FileSent(f as FolderItem)
Then the method’s signature would be
FTPFileSent(myFTP as FTP.Client, f as FolderItem)
right after the code where you create the instance, you’ll need to add lines that look like this:
You do this for events that you want to implement. Methods are the things you call, and no, you can not use AddHandler with those. Just call them directly on your class.
I’d put a breakpoint on the Client1.Connect method and step your way through the code at that point. Maybe there’s some other properties that are not set up properly?