Results 1 to 2 of 2

Thread: working with an aspx file and with its code behind

  1. #1
    Join Date
    Jan 2003

    working with an aspx file and with its code behind

    i want in the aspxvb to do :
    PHP Code:
    Dim myConnection As New SqlConnection("Provider=SQLOLEDB.1;UID=user;PWD=34234234;Initial Catalog=registration;Data Source=localhost;"
    when i first put this code in the aspx page and did there the import to :
    PHP Code:
    <%@ Import Namespace="System.Data" %>
    Import Namespace="System.Data.SqlClient" %> 
    nut when i moved it to the VB page it seems not to work!
    even when i removed the tags still isnt working!
    why is that?
    what i wanted to do is to seperate the code from the tags
    but it isnt working why?
    thnaks in advance

  2. #2
    Join Date
    Oct 2005
    if you want to seperate the code in a codebehind.

    you do not do this,

    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.SqlClient" %>

    you put all those import namespace thing within your code, in your aspx.vb file.

    and then at the top of the .aspx file, you do this,

    <%@ Page language="vb" Codebehind="WebForm1.aspx.vb" Src="WebForm1.aspx.vb" %>

    and put all your coding in webform1.aspx.vb


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles