If you cannot access the "code view" of the files how do you expect to be able to add in whatever it is you want to have added in? (I'm not sure what you mean by "code view", do you mean you don't have the component source code?)
If what you intend to do is to add the ASP style code into the ASPX file, you can put almost exactly what you have written write where you want to. The only thing you'll need to do is add an imports statement to the top of the ASPX file so that the visual basic functions you are using are in scope:
<%@ Imports Microsoft.VisualBasic %>
I think that's what you'll need. I use the codebehind model so I'm not used to putting imports statements in my aspx files.
Give that a try.