遷移的時候,bin/webproject1.dll 
這時候無法加載
不知道什麽原因。。鄙人剛從asp轉移過來.net...葉面提示。Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'WebProject1.WebForm1'.Source Error: 
Line 1:  <%@Import NameSpace="System.Web.Security"%>
Line 2:  <%@ Page Language="vb"  codebehind="WebForm1.aspx.vb" Inherits="WebProject1.WebForm1"%>
Line 3:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 4:  <HTML>
 Source File: /WebProject1/WebForm1.aspx    Line: 2 
如果使用 
<%@ Page Language="vb" AutoEventWireup="false" src="WebForm1.aspx.vb" Inherits="WebForm1"%>
<%@Import NameSpace="System.Web.Security"%>就pass...

解决方案 »

  1.   

    WebProject1.WebForm1 该名称空间下是否存在这个WEBFORM1的类呢?如果没有就直接以当前名称空间下来获取文件
      

  2.   

    存在。
    Imports System
    Imports System.Collections
    Imports System.ComponentModel
    Imports System.Data
    Imports System.Drawing
    Imports System.Web
    Imports System.Web.SessionState
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    Imports System.Web.UI.HtmlControls
    Imports System.Web.Security
    Imports System.XML
    Public Class WebForm1
        Inherits System.Web.UI.Page#Region " Web 窗体设计器生成的代码 "    '该调用是 Web 窗体设计器所必需的。
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()    End Sub
        Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
        Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
        Protected WithEvents Button1 As System.Web.UI.WebControls.Button
        Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox
        Protected WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand
        Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
        Protected WithEvents Button2 As System.Web.UI.WebControls.Button
        Protected WithEvents counter As System.Web.UI.WebControls.Label    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
        '不要删除或移动它。
        Private designerPlaceholderDeclaration As System.Object    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
            '不要使用代码编辑器修改它。
            InitializeComponent()    End Sub#End Region    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            '在此处放置初始化页的用户代码
            InitializeComponent()
            Page_Loads()
        End Sub   Private Sub Page_Loads()
            '在此处放置初始化页的用户代码
            If IsPostBack Then
                Dim hasimgs As Integer
                If (LCase(TextBox3.Text).IndexOf("jpg") > -1 Or LCase(TextBox3.Text).IndexOf("gif") > -1) And LCase(TextBox3.Text).IndexOf("http://") > -1 Then
                    hasimgs = 1
                Else
                    hasimgs = 0
                End If
                'Response.Write(LCase(TextBox3.Text).IndexOf("http://"))
                SqlCommand1 = New System.Data.SqlClient.SqlCommand
                SqlConnection1 = New System.Data.SqlClient.SqlConnection
                SqlCommand1.CommandText = "INSERT INTO ecom_friendlink (sitename, siteurl, sitelogo, sitedescp, hasimg) VALUES ('" & CStr(TextBox1.Text) & "', '" & TextBox2.Text & "', '" & TextBox3.Text & "', '2342', " & hasimgs & ")"
                SqlCommand1.Connection = SqlConnection1
                SqlConnection1.ConnectionString = "workstation id=""BsdfasOfOKSIR-WEISON"";packet size=4096;user id=dsadsdfsd;password=1234;data source=""192.168.1.108"";persist security info=False;initial catalog=5kcn_gb"
                SqlConnection1.Open()
                SqlCommand1.ExecuteNonQuery()
                Dim sqls As String = "Select count(id) as sum from ecom_friendlink"
                Dim msSqlCmd As New System.Data.SqlClient.SqlCommand(sqls, SqlConnection1)
                Dim REsu As Object
                REsu = msSqlCmd.ExecuteScalar
                counter.Text &= CStr(REsu) & ""
                SqlConnection1.Close()
            End If
        End Sub
    End Class