Where's applicationbasepage and how do I set up a web project?


Author
Message
Pertti Karjalainen
Pertti Karjalainen
StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)
Group: Forum Members
Posts: 54, Visits: 4K
I have tried to study and follow the SF VB web sample project, but since I am using C# and am kinda new to Strataframe and there seems to be no actual documentation on how to do this stuff step by step, I would like to know how one goes about setting up a web application, or at least the basic "infrastructure" of it (basepage, CSS, etc.)  Step-by-step instructions would be great.

I assume Business Objects and the BO functionality are exactly the same between web and windows apps, no?

Pertti

Pertti Karjalainen
Pertti Karjalainen
StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)
Group: Forum Members
Posts: 54, Visits: 4K
OK, I can't get anywhere with my web application efforts without some help from you guys.  I see no web templates when I try to create a new web site, I have no clue as to how to even begin to go about this.  Could be that I am locked in the MM.NET mindset.  Could be that my installation is not complete.  Could be that some documentation would help.  FYI, I am able to create Windows apps following the videos, but web apps with strataframe are a blank page for me.

So, call me clueless...Doze

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You are going to want to create a new WebSite instead of a new project and you will see the template.
  • Open VS2005
  • Click File -> New -> Website

This will present the following screen

  • Make sure that you choose your desired langauge (C# in this case)
  • Name your website and then click OK
  • This will create the basic structure of a website. 
  • Next, you are going to want to add another project to your solution (if you do not already have one) which is your Business Object Library.  DO NOT CREATE business objects within the web site, this will just cause you some frustrations as ASP.NET projects treat components differently that a class library project.
  • To add a new class library, right click the solution and then click Add -> New Project.
  • Open the C# -> StrataFrame options on the left and then  choose a BO class library project

  • Name the project to your liking and then click OK.
  • Delete the existing BO (Businessobject1) and add your first BO to the library (right-click on the BO project and then click Add -> New Item and then select the SF Business Object.
  • Once you have your class library setup, you will need to add a reference to the website so it can see the business objects.  To do this, right-click the website project and then go to Add Reference.

  • You can now reference BOs in your website.
  • To add a website BO, you will open up a base page (at this point you will only have one).  Under the App_Code folder open the ApplicationBasepage.cs file.  You will see a region here called Business Object Declarations.  This is where you will declare your BO.  Any page that inherits this base page will then be able to see and bind to that BO.  Below is a sample BO declaration, it is slightly different in C# than VB.Net and requires that a property be created.  Once this is done you will be able to bind just as though in a WinForm.  Note: You may need to build your solution before this step.

private SampleBOLibrary.CustomersBO _Customers;
    public SampleBOLibrary.CustomersBO Customers
    {
        get { return _Customers; }
        set { _Customers = value; }
    }

  • Open up the Default.aspx page and drop on a StrataFrame text box.
  • Go to the BusinessObjectName property and set it to your BO (Customers in this case)
  • Next, select the binding field on the BindingField property.

Business Objects
To learn more about the BO Mapper go through the WinForms tutorial, even though the help is for VB, I am confident that you will able to work through the sample in C#.  The BOs are the exact same for web as they are for WinForms.  Additionally, there is a lot of documentation as it relates to the BO Mapper and the business objects.  This should get you going in this department.  Obviously you can post any questions you have in regards to this on the forum.

Note: Attached is the sample I created to write this post.

Attachments
CSharpWebsite.zip (155 views, 716.00 KB)
Pertti Karjalainen
Pertti Karjalainen
StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)
Group: Forum Members
Posts: 54, Visits: 4K
Unfortunately I don't see those templates when I open a new website.  I wonder if my Visual Studio 2005 installation is hosed...  This is what I see:


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, I have never seen the SF Windows templates in that view.  It appears that the Windows Forms templates are in your web folder.  How this happened I have no idea.  Look in the following location:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\Web\CSharp

You should have a zip file in this folder named SF_WebApplication.zip.

If you do, the close all of your Visual Studio instances and type the following command in the "run" window or at the command prompt:

"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /setup

Go back into VS2005 and see if the template then exists.  If not we will have to dig a little deeper.

Pertti Karjalainen
Pertti Karjalainen
StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)
Group: Forum Members
Posts: 54, Visits: 4K
That did the trick!

And thanks for the step-by-step, because of which I now have my first dinky Strataframe -based website up and running (against VFP data, nevertheless).  Where did I put that bottle of Dom Perignon now...   Oh, I forgot, I think I drank it last night about 2 am out of frustration... 

How many times does one have to feel like a grunt and a beginner yet again in one's life?  To me this is time number 130,245...  But, hey, maybe it's just one way to keep the old man Alzheimer at bay   Unsure

Pertti

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
That is certainly one way to look at it Smile  And, yes, in the IT industry, there is something new to learn every day.
Pertti Karjalainen
Pertti Karjalainen
StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)
Group: Forum Members
Posts: 54, Visits: 4K
Well, I managed to brake something on my dinky website, and it is probably something very simple and my mistake.  But I can't figure it out.  I followed the step by step above, but when I tried to set a breakpoint at my default page on_load event where I load data.  However, the debugger it never stops there, it acts as if the page load code never even executes.  As a result the data field on the browser window doesn't get populated.  I can set a breakpoint at page_load in your VB Web sample app just fine, of course...

Below are pictures of my dev. environment at the breakpoint as well as the browser window.  Any help would be appreciated.  By me...

Code:

Solution Explorer:

web page:


StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
With VB, there is a little "Handles" keyword at the end of an event handler that tells the compiler to add the handler to the event.  However, within C#, there is no such thing... it must be done within the designer file.  Your best be would be to open the page and go to the Design view where you can visually build the page.  View the property sheet for the page and you will see a button at the top of the property sheet that will show you the events.  In the Load event, you need to type the name of your method that is handling the load event.

I think you can also add the code within the page directive within the markup file... but I'm not sure.

Pertti Karjalainen
Pertti Karjalainen
StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)StrataFrame Novice (54 reputation)
Group: Forum Members
Posts: 54, Visits: 4K
Ben:

Since this is an ASP app I don't have access to events from the property sheet...  I tried all kinds of things with the base page and my default page, but the debugger just won't cooperate, which means the page load code doesn't run for some god-awful reason...

Would it be possible to see a complete C# web app all the way through databinding etc. and to a ready-to-run project.  The step-by-step instructions above stopped short of that kind of completion, and I suppose I am not the only one struggling with the C# web apps using StrataFrame, since there is no walk-throughs for that.  The VB web sample walkthrough is great, but given the differences between the two languages it isn't all that much help when trying to get a sample app up and running in C#.  I feel like I'm spinning my wheels unnecessarily here because of the lack of C# tutorials/walkthroughs.

Thank you!

Pertti

Ben Chase (12/07/2006)
With VB, there is a little "Handles" keyword at the end of an event handler that tells the compiler to add the handler to the event.  However, within C#, there is no such thing... it must be done within the designer file.  Your best be would be to open the page and go to the Design view where you can visually build the page.  View the property sheet for the page and you will see a button at the top of the property sheet that will show you the events.  In the Load event, you need to type the name of your method that is handling the load event.

I think you can also add the code within the page directive within the markup file... but I'm not sure.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search