StrataFrame Forum

Missing Global.asax?

http://forum.strataframe.net/Topic16294.aspx

By Howard Bennett - 5/9/2008

I'm getting an error about the DataSourceKey is not defined...

I did some checking on here and in the sample app and found that there is a global.asax in the sample app that I don't have in my app.  Additionally, looks like that's where I am supposed to setup the data connection.

So, here are my questions...

Do I need a global.asax and what is it for? 

If it is necessary, should it have been added when I created the project? 

Lastly, if I add one, will that take care of my DataSourceKey error?

Thanks again for any help!

HB

By Trent L. Taylor - 5/9/2008

Do I need a global.asax and what is it for? 

Unless you plan to have nothing but static pages, then yes.  You will need a global.asax.  This file is launched when the application starts up in IS as well as when a new session is started.  There are associated events that can be handled in this class as well.  So when you application starts, you will want to define your connection string information there..this way it is only created once versus for each session (each visitor) that gets started.

If it is necessary, should it have been added when I created the project? 

There was a bug in the template until 1.6.5 that did not include the global.asax file...this has been fixed.

Lastly, if I add one, will that take care of my DataSourceKey error?

Yes...you have to define your connection and this is the only place that you should really do this on a web application.

By Howard Bennett - 5/9/2008

I was using 1.6.5 - but - downloaded it again (must have been an update I missed.)  Now, the global.asax is there.

Thanks - on to the next issue.

HB