3 ways to add code to an asp.net page?

April 13, 2005

One of the review questions in my Microsoft revision book for exam 70-305 is:
“Describe three ways to add code to an aspx page.”
Ok, I got two:
1) Double click on a control in the design window
2) Add code directly to the code behind of the page
3) ???
If you can think of the 3rd method, please let me know by adding a comment to this blog. (Sorry, no prizes for this one!)
Ok, I was thinking about this the wrong way! The ways of adding code are:
1) Inline (Code actually within the ASPX file itself e.g. index.aspx)
2) In the code behind page (e.g. index.aspx.vb)
3) ‘Mixed’ – Both inline and in the code behind
Quite how this makes 3 methods, I really dont know. I guess it demonstrates that its possible to add code in both the page and the code behind.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: