Log in

View Full Version : doing me ed in. (geeky)


timwilky
03-09-08, 09:32 AM
So I am working on a odd little project. To internationalise a dodgy application written by an amateur in ASP of all things.

I didn't want to change too much as it may well fall apart. The first part to add proper authentication I am well on with. I have written a proper web service that will authenticate user credentials against an LDAP. worked out how to even call web services from asp. but :-

ASP, asp.net what a terrible hash. I am not a fan of scripting language and would prefer to write servlets than jsp. but trying to learn asp.net from a few ebooks is doing my head in.

the original code is disjointed, lacks any form/structure. code is "included" in line. So when functions are then called. it is impossible to work out where they come from. included files then incude others etc.

So can anyone recommend an easy tutorial in using asp.net. I simply need to be able to work with request/response objects, manage state persistance/session variables etc.

first question. I know .net does just in time compilation. first call on my developing app takes an age, subsequent calls are reasonable but not blinding. But why after some time of inactivity does it revert back to an initial first slow transaction.

second question. How do I maintain an app running in order that I can create connection pools for reuse to back end data sources. All simple for my Java servlets but this .net stuff does not seem to be in that league. Or is it me missing something

Mr Speirs
03-09-08, 09:57 AM
Errrrrrrrrr what?

Jester666
03-09-08, 11:43 AM
Help has been asked for. Any replies other than sensible suggestions/ideas will be deleted.

Thank you.

muffles
03-09-08, 11:52 AM
Help has been asked for. Any replies other than sensible suggestions/ideas will be deleted.

Thank you.

Oh no - isn't that a self perpetuating statement? You will have to delete your post too! :D

I guess this will be deleted now...oh well!

the_lone_wolf
03-09-08, 11:53 AM
apparently my idle banter was too idle...


or not idle enough?...


i dunno, it's hard to get the idle right


:confused::p

Nicky S
03-09-08, 02:32 PM
So I am working on a odd little project. To internationalise a dodgy application written by an amateur in ASP of all things.

I didn't want to change too much as it may well fall apart. The first part to add proper authentication I am well on with. I have written a proper web service that will authenticate user credentials against an LDAP. worked out how to even call web services from asp. but :-

ASP, asp.net what a terrible hash. I am not a fan of scripting language and would prefer to write servlets than jsp. but trying to learn asp.net from a few ebooks is doing my head in.

the original code is disjointed, lacks any form/structure. code is "included" in line. So when functions are then called. it is impossible to work out where they come from. included files then incude others etc.

So can anyone recommend an easy tutorial in using asp.net. I simply need to be able to work with request/response objects, manage state persistance/session variables etc.

first question. I know .net does just in time compilation. first call on my developing app takes an age, subsequent calls are reasonable but not blinding. But why after some time of inactivity does it revert back to an initial first slow transaction.

second question. How do I maintain an app running in order that I can create connection pools for reuse to back end data sources. All simple for my Java servlets but this .net stuff does not seem to be in that league. Or is it me missing something

how gd are u at asp.net ?
here are a few websites to help they are easyer then books
http://www.learnvisualstudio.net/content/landing/aspnet01/aspnet_c3b.htm?gclid=CMiemeDqv5UCFQuH1QodmVEyRQ

http://www.asp.net/LEARN/

hope this helps if not soz and good luck :P

Ping
03-09-08, 02:53 PM
Erm.. Not sure if it's just different terminology here, but are you using the debugger (assuming you're using Visual Studio)?

If you have the website locally you can use the debugger to go through step-by-step, when in debug mode you set stop points by clicking on the margin next to the line you want to highlight (a red dot should appear).

It opens up the site in your web browser, at which point you go through the process (if there's any user input) and reflects it in debug mode in VS.

I think f10 takes you through each line and function. Rolling over anything (variables, etc) that should be assigned with data in the code will show you if anything is there and what. You can also hop between functions called within the code.

I'm fairly new to the nitty-gritty of asp.NET but is this any use?

:)

Davies
03-09-08, 03:09 PM
By inline code do you mean that the server code and HTML are in the same aspx page? I find it much easier to use a code-behind page when it comes to debugging, and if you're using Visual Studio then its debugging capabilities are really powerful (hovering over variables for values, quickwatch etc). To set a code behind page right click on the solution title at the top and select "Add new item" and make sure that the option "Place code in a separate file" is checked. This should create a .cs or .vb file depending on which language you are using. Then simple cut and past the server code into the new .cs/vb file and the html code into the aspx page. Of course, if you are already doing this then ignore the above ramble :)

Is your environment .net 1.1 or .net2.0? I've been coding using Visual Studio for the past 4 years so drop me a PM if you need any help.

Cheers,

Paul :D

timwilky
03-09-08, 03:43 PM
Bender, Only reading today about asp.net and the use of code-behind, also the nice idea of using source reference in the .aspx rather than leaving the class in the /bin etc.

What I meant by "in line code" was the use in the original .asp files of the include directive. so for instance the original default.asp would contain such as

<!-- #include virtual="/includes/database.asp" -->
<!-- #include virtual="/includes/utils.asp" -->
<!-- #include virtual="/includes/login.asp" -->

the above would in turn have include directives and the whole thing became a mess, aspx seems to get round this with in that I can use code-behind etc. to use additional class functions etc. using the include directive above would I assume simply add the included content in line for parsing.

I am still not sure about debugging aspx pages when they are running on a remote server etc.

My environment is net 2.0, c#. So far I am getting there with the web service for LDAP authentication I have developed. I have really just started to get my head round the use of the run at server to use any tag contents, how the viewstate and Page-load to add event handlers etc work. but this still leaves me having to think about state persistance and sessions etc.

Perhaps I think too much of a traditional MVC design pattern and am struggling to impliment it in an asp.net environemt whilst actually trying to learn the environment

Baph
03-09-08, 05:07 PM
Tim, IIRC, VS.NET will allow you to click on the functions being called to get to the file defining the function.

That's about it for my memory of ASP.net. :)

Skripthor
04-09-08, 12:01 AM
So can anyone recommend an easy tutorial in using asp.net. I simply need to be able to work with request/response objects, manage state persistance/session variables etc.

Have a look at these tutorials Tim: http://www.blackwasp.co.uk/Tutorials.aspx
The articles section is also very good.

first question. I know .net does just in time compilation. first call on my developing app takes an age, subsequent calls are reasonable but not blinding. But why after some time of inactivity does it revert back to an initial first slow transaction.

Hard to tell :-?, could be a number of things.
Slow database on creation of connections? Heavily used by other applications as well? The connection pool might be empty so .net needs to wait for an available connection in the pool.
Or everytime a session is started, there could be some code that "hangs" things a bit.

second question. How do I maintain an app running in order that I can create connection pools for reuse to back end data sources. All simple for my Java servlets but this .net stuff does not seem to be in that league. Or is it me missing something

Try to read about ADO.NET, the connection pool will be handled automatically for you.

- When using ADO.NET with SQL Server: http://msdn.microsoft.com/en-us/library/aa719770.aspx
- Or if you are using ADO.NET Oracle/OleDb/ODBC Api: http://msdn.microsoft.com/en-us/library/ms254502.aspx

muffles
04-09-08, 08:00 AM
first question. I know .net does just in time compilation. first call on my developing app takes an age, subsequent calls are reasonable but not blinding. But why after some time of inactivity does it revert back to an initial first slow transaction.

Dunno anything about this arena but is it possible that's some sort of caching issue, the period of inactivity allows the cache to be overwritten with other things, etc...