If you need to declare a global object to be accessible everywhere in your page:
<script runat="server">
// ObjectType: Your class name
// Name: Your instance (variable) name.
ObjectType Name = new ObjectType();
</script>
If you just need a local variable:
<%
ObjectType name = new ObjectType();
name.SomeMethod();
%>
By the way, you should have good reasons for using these kind of things in ASP.NET. There are usually better ways to encapsulate user interface elements in user controls and master pages.
Side note: You can't use using
directives in .aspx
files. If you need to import some namespace in your code, you should add <%@ Imports Namespace="SomeNamespace" %>
directives right after your <%@ Page %>
directive.