none
关于<%@ Page Language="C#" %>使用 RRS feed

  • 问题

  • 程序升级到VS2012,.net为4.5版本后,页面中语句:<%@ Import Namespace="RickAIS.Web"%>被提示:ASP.NET 运行时错误: 不支持给定路径的格式。请问这是什么问题,是否是.net4.5不支持这种方式,哪里可以找到问题的原因?谢谢!
    2013年10月23日 4:13

全部回复

  • 确认命名空间存在吗?文件没有错误吗?可以上传代码到网盘(比如SkyDrive)我们看看嘛?

    Click For donating:Free Rice For the poor
    For spamming-sender issues, you can either report it at Microsoft Spamming Issue, or just find "Report Spam Here+Number" at Forum Issue;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.
    For more things to talk about? StackOverFlow is your choice.

    2013年10月23日 5:25
  • 文件没有错误,命名空间存在。这是一个警告信息,程序是可以运行的。如何上传代码?
    2013年10月23日 5:30
  • 文件没有错误,命名空间存在。这是一个警告信息,程序是可以运行的。如何上传代码?
    你用一个网盘先上传,然后公开公布该文件下载地址,我们可以下载运行看看那。

    Click For donating:Free Rice For the poor
    For spamming-sender issues, you can either report it at Microsoft Spamming Issue, or just find "Report Spam Here+Number" at Forum Issue;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.
    For more things to talk about? StackOverFlow is your choice.

    2013年10月23日 5:53
  • 就是这样一个程序,第一句提示:ASP.NET 运行时错误: 不支持给定路径的格式。

    <%@ Import Namespace="RickAIS.Web" %>
    <%@ Page ClientTarget="Downlevel" Language="c#" Codebehind="Logon.aspx.cs" AutoEventWireup="True" Inherits="RickAIS.Web.Logon" EnableSessionState="true" EnableViewState="true" %>
    <%@ Register TagPrefix="Module" TagName="ViewSource" Src="../modules/viewsourcemodule.ascx" %>
    <%@ Register TagPrefix="Module" TagName="Header"     Src="../modules/bannermodule.ascx" %>
    <%@ Register TagPrefix="Module" TagName="Account"    Src="../modules/accountmodule.ascx" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
     <head>
      <title id="TitleHtmlGenericControl">RickAIS 1.2 Account Logon</title>
      <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"/>
      <meta http-equiv="content-type" content="text/html"/>
      <meta content="小" name="GENERATOR"/>
      <meta content="C#" name="CODE_LANGUAGE"/>
      <link href="../css/RickAISv1.css" type="text/css" rel="Stylesheet"/>
     </head>
     <body>
      <form id="frmAccount" method="post" runat="server">
       <!-- PAGE HEADER MODULE -->
                <Module:header id="ModuleBanner" runat="server" pathprefix=".."></Module:header>
       <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr>
         <td class="navtable" valign="top" width="1%">
          <table cellspacing="10" cellpadding="0" width="100%" border="0">
           <!-- BEGIN DYNAMIC LEFT MODULE LIST -->
           <tr>
            <td style="PADDING-TOP: 5px" align="left">
                                        <Module:viewsource id="ModuleViewSource" runat="server" pathprefix=".." sourceurl="viewsource.aspx?path=secure/logon.src"></Module:viewsource></td>
           </tr>
           <!-- END DYNAMIC LEFT MODULE LIST --></table>
         </td>
         <td valign="top" width="99%">
          <table cellspacing="10" cellpadding="0" width="100%" border="0">
           <tr>
            <td style="PADDING-TOP: 5px" align="left">
             <!-- BEGIN DYNAMIC RIGHT MODULE LIST --><asp:panel id="LogonPanel" runat="server"><!--BEGIN LOGON PANEL-->
              <table cellspacing="0" cellpadding="5" width="100%">
               <tr class="rheader">
                <td class="rheadercol" height="25" align="left">员工登录</td>
               </tr> <!-- SPACER ROW -->
               <tr class="rbody">
                <td class="rbodycol" height="25" align="left">
                 <p>请使用登录号登录 需要开户
                 </p>
                </td>
               </tr>
               <TR class="rbody">
                <TD class="rbodycol" height="25" align="center">
                 <table width="100%">
                  <TR>
                   <TD width="20%">登录代号:</TD>
                   <TD width="40%">
                    <asp:TextBox id="LogonEmailTextBox" runat="server" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator id="LogonEmailRequiredFieldValidator" runat="server" display="dynamic" errormessage="Email Address "
                     controlToValidate="LogonEmailTextBox">*</asp:RequiredFieldValidator></TD>
                   <TD>&nbsp;
                   </TD>
                  </TR>
                  <TR>
                   <TD width="20%">密码:</TD>
                   <TD width="40%">
                    <asp:TextBox id="LogonPasswordTextBox" runat="server" MaxLength="15" textmode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator id="LogonPasswordRequiredFieldValidator" runat="server" display="dynamic" errormessage="Password "
                     controlToValidate="LogonPasswordTextBox">*</asp:RequiredFieldValidator></TD>
                   <TD>&nbsp;
                   </TD>
                  </TR>
                 </table>
                </TD>
               </TR>
               <tr>
                <td align="left">
                 <p>
                  &nbsp;<asp:ValidationSummary id="LogonValidationSummary" runat="server" HeaderText="Please enter a value in the required field(s)."></asp:ValidationSummary>
                  <asp:Label id="MismatchLabel" runat="server" Visible="False" forecolor="RED">
                                      登录代号或密码不正确,请重新输入.<br>
                                    </asp:Label>
                                                        </p>
                </td>
               </tr>
               <TR>
                <TD>
                 <table width="100%">
                  <TR>
                   <TD width="20%">&nbsp;
                   </TD>
                   <TD width="40%">
                    <asp:Button id="LogonButton" runat="server" text="Logon" onclick="LogonButton_Click"></asp:Button></TD>
                   <TD>
                    <asp:Button id="CreateButton" runat="server" text="Initial System" onclick="CreateButton_Click"></asp:Button></TD>
                  </TR>
                 </table>
                </TD>
               </TR>
               <TR>
                <TD valign="top" align="left">
                 <asp:label id="LB_Page00ErrorMsg" runat="server" Visible="False" Width="100%" ForeColor="Red"></asp:label></TD>
               </TR>
              </table> <!--END LOGON MODULE--></asp:panel><asp:panel id="LoggedOnPanel" runat="server"><!--BEGIN LOGGEDON MODULE-->
              <table cellspacing="0" cellpadding="5" width="100%">
               <tr class="rheader">
                <td class="rheadercol" height="25" align="left">员工已登录
                </td>
               </tr> <!-- SPACER ROW -->
               <tr class="rbody">
                <td class="rbodycol" height="25" align="center">&nbsp;
                </td>
               </tr>
               <tr class="rbody">
                <TD class="rbodycol" height="25" align="center">
                 <P>员工已经登录. If you wish proceed to logon with a different account or create a new
                  account, please click on the Continue button below. If you wish to remain
                  logged in as the current account, click on the Cancel button to return to the
                  checkout area.
                 </P>
                 <P>
                  <asp:Button id="ContinueButton" runat="server" text="Continue" onclick="ContinueButton_Click"></asp:Button>
                  <asp:Button id="CancelButton" runat="server" text="Cancel" onclick="CancelButton_Click"></asp:Button></P>
                </TD>
               </tr>
              </table> <!--END LOGGEDON MODULE--></asp:panel><asp:panel id="DetailsPanel" runat="server"><!--BEGIN DETAILS MODULE-->
              <asp:Label id="CreateTitleLabel" runat="server" Visible="False" text="RickAIS 1.5 Create Account"
               Width="50" Height="19" enableViewState="false"></asp:Label>
              <Module:Account id="ModuleAccount" runat="server" EditMode="False"></Module:Account>
              <asp:Button id="SubmitButton" runat="server" text="Create Account" onclick="SubmitButton_Click"></asp:Button> <!--END DETAILS MODULE--></asp:panel><asp:panel id="CreatedPanel" runat="server"><!--BEGIN CREATED MODULE-->
              <table cellspacing="0" cellpadding="5" width="100%">
               <tr class="rheader">
                <td class="rheadercol" height="25" align="left">Account Created
                </td>
               </tr> <!-- SPACER ROW -->
               <tr class="rbody">
                <td class="rbodycol" height="25" align="center">&nbsp;
                </td>
               </tr>
               <tr class="rbody">
                <td class="rbodycol" height="25" align="center">
                 <p>Your account has been created. Please click on the Continue button below to
                  continue shopping.
                 </p>
                 <p>
                  <asp:Button id="CreateContinueButton" runat="server" text="Continue" onclick="CreateContinueButton_Click"></asp:Button></p>
                </td>
               </tr>
              </table> <!--END CREATED MODULE--></asp:panel></td>
           </tr>
           <!-- END DYNAMIC RIGHT MODULE LIST --></table>
         </td>
        </tr>
       </table>
      </form>
     </body>
    </html>

    2013年10月23日 7:39
  • 既然是警告,要不尝试删除如何?我用2013创建了一个默认Page,默认代码:

    [aspx]

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="CSharp.WebForm1" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        </form>
    </body>
    </html>

    [后台代码]

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace CSharp
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        }
    }

    Click For donating:Free Rice For the poor
    For spamming-sender issues, you can either report it at Microsoft Spamming Issue, or just find "Report Spam Here+Number" at Forum Issue;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.
    For more things to talk about? StackOverFlow is your choice.

    2013年10月23日 9:54