Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Experience PHP programmer cannot get a grip on ASP

Status
Not open for further replies.

dzr

Programmer
Nov 20, 2001
109
US
I'm totally new at asp so pardon the obtuse questions... I need some hand holding. I tried the asp.net forum but they are kind of slow and unfriendly. I always had great luck in the tektips Flash forum so I'm hoping I can get someone here to take me under their wing.

I have chosen C# code behind method using SQL server 2000 and .net 2.0. I have been doing PHP/MySQL for 5 years and am comfortable with the C# syntax, I am rusty but still have experience with coldfustion/SQL so I'm relatively ok with the DB.

*My first question- can anyone explain what the differences are in syntax between inline and codebehind (codefile) styles of C#?? Most of the online help that actually is for C# seems to be inline examples...

thanks!




 
I am not sure what you mean by inline code and examples. The code for a .NET app is placed in a code behind file. In and asp.net app you can also modify the HTML portion of the page. You can change databinding there and add javascript..etc.

Jim
 
I had just seen online people refer to it as "inline" - but yes, I mean the code that is in the actual aspx page. The syntax is different and when I find help on a subject that codes right in the page - I'm having a hard time translating it over to the CodeBehind file.
 
There shouldn't be any code in the aspx page.. That would be classic asp programming. Maybe you are confusing some of the binding instructins as code. Maybe if you put an example here I can take a look.

 
I'm sure I'm confusing a lot of things!!!

I just seem to be googling things like c# asp.net forum submit and getting code that is right in the file and doesn't look anything like the c#. I haven't saved any of them since they didn't help... If I run into it again I will post here.

Meanwhile - thanks for the tip on "binding instructions" -hadn't heard of that so I'm going to read up on it...

ho hum...
 
Glad to help..

In the mean time you can find lots of useful examples on line. Also you may want to look into a beginners book on asp using c#. There are plenty around. I think going through a book like that will clear up a lot of confusion, especially with the terminology.

Jim
 
Yes, I agree - a book is in order... !

As far as examples -- it's almost like there are too many online - in too many styles... I almost pulled my hair out yesterday just trying to find a snippet that included connect to the db and running 1 query...
 
yes I agree.. there are many different ways to do the same thing... which is good and bad... definatly bad when you are first learning....
 
One book that I am finding to be helpful to get up to speed on 2.0 is the Murach's Upgrader's Guide to ASP.NET 2.0 with C#.

It's free of a lot of the fluff you see in most other software books.

The wisest people are those who are smart enough to realize they don't know it all.
 
i'm pretty damn wise then...!
 
The inline code blocks are messy and a little pointless. I generally just use then for adding in things I can't be bothered scripting for (such as adding the Description meta-tag on the fly with

<% Response.Write(SiteMap.CurrentNode.Description) %>

I havn't really found all that much use for them. I work with a front-end specialist and sometimes I use inline calls to allow him to customise a control without me having to edit the code-behind file. That's just lazy.

Most of your code should go in the code-behind file - it's what it's there for.




Yet another unchecked rambling brought to you by:
Oddball
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top