2010-03-23 84 views
0

我在上傳html & asp頁面時遇到了問題。如何從html頁面調用asp頁面

其實我有一個html頁面名稱爲index.html &另外一個是asp頁面名稱爲ContactUsNew.aspx。在html頁面中有一個「聯繫我們」頁面的鏈接。 &這個鏈接我使用的代碼。

<td style="height: 42px"> 
    <p class="menu01"><a href="ContactUsNew.aspx">CONTACT US</a></p> 
</td> 

當我運行在本地主機該應用中它成功運行,但是當我上載的ftp這些網頁聯繫人指定的路徑那個時候我們的index.html頁不是交換機上鍊接到contactusnew.aspx頁。有路徑出錯 我創建了以下頁面:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ContactUsNew.aspx.vb" Inherits="clients_excel_ContactUsNew" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head> 
    <title>Excel Informatics Pvt. Ltd. :: Careers</title> 
    <link rel="stylesheet" type="text/css" href="images/style.css" /> 
    </head> 
<body > 
    <form id="form1" runat="server"> 
     <table width="759" border="0" cellspacing="0" cellpadding="0" align="center"> 
     <tr> 
      <td width="256"> 
       <img src="images/main01.jpg" width="256" height="41"></td> 
      <td background="images/fon01.gif"> 
       <table width="503" border="0" cellspacing="0" cellpadding="0"> 
        <tr> 
         <td width="270"> 
          <a href="index.html"> 
           <img src="images/but_home.gif" width="74" height="41" border="0"></a><img src="images/separator.gif" 
            width="2" height="41"><a href="ContactUs.aspx"><img src="images/but_contacts.gif" 
             width="96" height="41" border="0"></a><img src="images/separator.gif" width="2" height="41"></td> 
        </tr> 
       </table> 
      </td> 
     </tr> 
     <tr> 
      <td height="157"> 
       <img src="images/main_logo.gif" width="256" height="157"></td> 
      <td width="503"> 
       <img src="images/main03.gif" width="503" height="157"></td> 
     </tr> 
    </table> 
    <table border="0" cellpadding="0" cellspacing="0" width="759" align="center" background="images/fon_menu.gif"> 
     <tr> 
      <td> 
       <img src="images/menu01.gif" width="3" height="42" alt="" border="0"></td> 
      <td> 
       <table border="0" cellpadding="0" cellspacing="0"> 
        <tr> 
         <td> 
          <p class="menu01"> 
           <a href="index.html">HOME</a></p> 
         </td> 
         <td> 
          <img src="images/e_menu.gif" alt="" width="24" height="42" border="0" /></td> 
         <td> 
          <p class="menu01"> 
           <a href="Company.html">COMPANY</a></p> 
         </td> 
         <td> 
          <img src="images/e_menu.gif" alt="" width="24" height="42" border="0" /></td> 
         <td> 
          <p class="menu01"> 
           <a href="Services.html">SERVICES</a></p> 
         </td> 
         <td> 
          <img src="images/e_menu.gif" alt="" width="24" height="42" border="0" /></td> 
         <td> 
          <p class="menu01"> 
           <a href="Customer.html">CUSTOMERS</a></p> 
         </td> 
         <td> 
          <img src="images/e_menu.gif" alt="" width="24" height="42" border="0" /></td> 
         <td> 
          <p class="menu01"> 
           <a href="Careers.html">CAREERS</a></p> 
         </td> 
         <td> 
          <img src="images/e_menu.gif" alt="" width="24" height="42" border="0" /></td> 
         <td> 
          <p class="menu01"> 
           <a href="ContactUs.aspx">CONTACT US</a></p> 
         </td> 
        </tr> 
       </table> 
      </td> 
      <td align="right"> 
       <img src="images/menu02.gif" width="3" height="42" alt="" border="0"></td> 
     </tr> 
    </table> 
    <div align="center"> 
     <img src="images/main01.gif" width="759" height="5" alt="" border="0"></div> 
    <table border="0" cellpadding="0" cellspacing="0" width="759" align="center"> 
     <tr valign="top"> 
      <td background="images/fon_left.gif"> 
       <img src="images/fon_left.gif" width="3" height="13" alt="" border="0"></td> 
      <td width="753" bgcolor="#FFFFFF"> 
       <p class="px5"> 
        <table border="0" cellpadding="12" cellspacing="0" width="100%"> 
         <tr valign="top"> 
          <td> 
           <!-- right --> 
           <table border="0" cellpadding="0" cellspacing="0" style="height: 375px"> 
            <tr> 
             <td colspan="3" height="25" bgcolor="#777777"> 
              <p class="title"> 
               <img src="images/e01.gif" width="8" height="8" alt="" border="0">&nbsp;&nbsp; Contact 
               Us</p> 
             </td> 
            </tr> 
            <tr> 
             <td colspan="3" bgcolor="#CCCCCC"> 
              <img src="images/px1.gif" width="1" height="1" alt="" border="0"></td> 
            </tr> 
            <tr> 
             <td rowspan="3" bgcolor="#CCCCCC"> 
              <img src="images/px1.gif" width="1" height="1" alt="" border="0"></td> 
             <td bgcolor="#EF9400" height="3"> 
              <img src="images/px1.gif" width="1" height="1" alt="" border="0"></td> 
             <td rowspan="3" bgcolor="#CCCCCC"> 
              <img src="images/px1.gif" width="1" height="1" alt="" border="0"></td> 
            </tr> 
            <tr> 
             <td width="725"> 
              <table width="100%"> 
               <tr> 
                <td> 
                 <p> 
                  Let us show you how we can help you with your IT requirements.</p> 
                 <p> 
                  <b>Excel Informatics Pvt. Ltd.</b><br /> 
                  C-2, Suryodaya Complex, Bldg. F.,<br /> 
                  Survey No. 154/4, Kalbhor Nagar,<br /> 
                  Chinchwad, Pune - 411019<br /> 
                  Maharashtra, INDIA<br /> 
                  Phone: 91+20+27476633, 27454132 
                 </p> 
                 <p> 
                  <b>E-mail:</b> <a href="mailto:[email protected]ine.com" style="color: Blue">[email protected]</a><br /> 
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; or <a href="mailto:[email protected]" 
                   style="color: Blue">[email protected]</a></p> 
                 <div style="height: 120px;"> 
                  &nbsp;</div> 
                </td> 
                <td> 
                 <table class="txt" cellpadding="2" width="350" cellspacing="0"> 
                  <% If CType(Context.Items("success"), Boolean) = True Then%> 
                  <tr> 
                   <td height="30" colspan="3"> 
                    <b> 
                     <asp:label id="LblSq" runat="server" text="Thank you for taking the time to give us your enquiry." 
                      cssclass="txtgrn" font-size="9pt"></asp:label> 
                    </b> 
                   </td> 
                  </tr> 
                  <tr> 
                   <td height="10" style="width: 348px"> 
                   </td> 
                  </tr> 
                  <% Else%> 
                  <tr> 
                   <td colspan="2" class="help"> 
                    &nbsp;&nbsp; &nbsp;&nbsp; All fields marked with * are mandatory.</td> 
                  </tr> 
                  <tr> 
                   <td align="center" style="width: 348px"> 
                    <table cellpadding="4" cellspacing="0"> 
                     <tr> 
                      <td align="left" width="120"> 
                       <span class="txterr">*</span> Your Name</td> 
                      <td width="230" align="left"> 
                       <asp:textbox id="TxtName" runat="server" cssclass="txtbox" maxlength="100"></asp:textbox> 
                       <asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" controltovalidate="TxtName" 
                        display="Dynamic" errormessage="Name is Required."></asp:requiredfieldvalidator> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       &nbsp;&nbsp; Address</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtAddress" runat="server" cssclass="txtbox" columns="25" maxlength="150" 
                        rows="3" textmode="MultiLine"></asp:textbox> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       &nbsp;&nbsp; City</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtCity" runat="server" cssclass="txtbox" maxlength="25"></asp:textbox> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       &nbsp; &nbsp;State</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtState" runat="server" cssclass="txtbox" maxlength="25"></asp:textbox> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       &nbsp;&nbsp; Phone No.</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtPhno" runat="server" cssclass="txtbox" maxlength="15"></asp:textbox> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       <span class="txterr">*</span> Email ID</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtEmail" runat="server" cssclass="txtbox" maxlength="100"></asp:textbox> 
                       <asp:label id="LblEmail" runat="server" cssclass="txterr"></asp:label> 
                       <asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" controltovalidate="TxtEmail" 
                        display="Dynamic" errormessage="Email is Required."></asp:requiredfieldvalidator> 
                       <asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" controltovalidate="TxtEmail" 
                        display="Dynamic" errormessage="Enter valid email address." validationexpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:regularexpressionvalidator> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       &nbsp;&nbsp; Subject</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtSubject" runat="server" cssclass="txtbox" maxlength="100"></asp:textbox> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td align="left"> 
                       <span class="txterr">*</span> Your Message</td> 
                      <td align="left"> 
                       <asp:textbox id="TxtMsg" runat="server" columns="25" rows="3" textmode="MultiLine" 
                        cssclass="txtbox" maxlength="200"></asp:textbox> 
                       <asp:requiredfieldvalidator id="RequiredFieldValidator3" runat="server" controltovalidate="TxtMsg" 
                        display="Dynamic" errormessage="Message is Required."></asp:requiredfieldvalidator> 
                      </td> 
                     </tr> 
                     <tr> 
                      <td> 
                      </td> 
                      <td align="left"> 
                       <asp:button id="BtnSubmit" runat="server" cssclass="txtbox" text="Submit" height="22px" 
                        width="60px" /> 
                       &nbsp; 
                       <asp:button id="BtnReset" runat="server" cssclass="txtbox" text="Reset" causesvalidation="False" 
                        height="22px" width="60px" /> 
                      </td> 
                     </tr> 
                    </table> 
                   </td> 
                  </tr> 
                  <% End If%> 
                 </table> 
                </td> 
               </tr> 
              </table> 
             </td> 
            </tr> 
            <tr> 
             <td background="images/t_fon.gif" height="28"> 
              <img src="images/px1.gif" width="1" height="1" alt="" border="0"></td> 
            </tr> 
            <tr> 
             <td colspan="3" align="right"> 
              <img src="images/t_bot.gif" width="229" height="9" alt="" border="0"></td> 
            </tr> 
           </table> 
           <!-- /right --> 
          </td> 
         </tr> 
        </table> 
        <br> 
      </td> 
      <td background="images/fon_right.gif"> 
       <img src="images/fon_right.gif" width="3" height="10" alt="" border="0"></td> 
     </tr> 
    </table> 
    <table border="0" cellpadding="0" cellspacing="0" width="759" align="center"> 
     <tr> 
      <td colspan="2" background="images/fon_bot.gif" height="42" align="right"> 
       <table border="0" cellpadding="0" cellspacing="0" width="510" background=""> 
        <tr> 
         <td> 
          <p class="menu02"> 
           <a href="index.html">Home</a></p> 
         </td> 
         <td> 
          <p class="menu02"> 
           <a href="Company.html">Company</a></p> 
         </td> 
         <td> 
          <p class="menu02"> 
           <a href="Services.html">Services</a></p> 
         </td> 
         <td> 
          <p class="menu02"> 
           <a href="Customer.html">Customers</a></p> 
         </td> 
         <td> 
          <p class="menu02"> 
           <a href="Careers.html">Careers</a></p> 
         </td> 
         <td> 
          <p class="menu02"> 
           <a href="ContactUs.aspx">Contact Us</a></p> 
         </td> 
        </tr> 
       </table> 
      </td> 
     </tr> 
     <tr align="center"> 
      <td width="270" height="65"> 
       <img src="images/logo_bot.gif" alt="" border="0"></td> 
      <td width="490"> 
       <p align="center" style="color: #FFFFFF;"> 
        Copyright &copy; 2009 Excel Informatics Pvt. Ltd. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; Designed & developed by <a style="color: #FFFFFF;" href="http://www.itiersolutions.com" 
         target="iTier">iTier solutions</a></p> 
      </td> 
     </tr> 
    </table> 
    </form> 
</body> 
</html> 
+3

請不要說 「先生」。你侮辱了這裏的所有女人。另外,我們沒有交談。你問一個問題(很糟糕),我們會試着回答。 – 2010-03-23 06:19:53

+1

@durilai:你爲什麼把額外的單詞放回去? – 2010-03-23 06:29:57

+0

這是一個基本的checklsit: 你檢查contactusnew.aspx文件是否成功登陸嗎? 當您嘗試瀏覽contactusnew.aspx時,獲得的錯誤編號是多少? – balalakshmi 2010-03-23 06:34:41

回答

0

請檢查contactusnew.aspx文件也被上傳和您的網絡服務器支持ASP.NET。

+0

編譯器錯誤消息:BC30456:'標題'不是'ASP的成員。 contactusnew_aspx」。 – 2010-03-23 06:41:26

+0

檢查:http://forums.asp.net/t/1348367.aspx或http://www.netnewsgroups.net/group/microsoft.public.dotnet.framework.aspnet/topic28994.aspx 他們面對同樣的問題。似乎你的部分類有問題。 – Rhapsody 2010-03-23 07:10:06

0

@Amol:這是一個可能與您的問題匹配的答案。 這是http://forums.asp.net/t/1148374.aspx

說明:

During development on my computer my project worked fine. When I copied it to the web server it failed with and error "Context is not a member of." I could not find the solution to the problem anywhere. By trial and error I found a solution that worked. I did the following for mypage.aspx with code behind mypage.aspx.vb. 

◦I backed up the project. 
◦The solution explorer contained a file mypage.aspx.designer.vb. I deleted it. Why? I noticed that when I created a new web form on the web server the designer.vb file was not included. 
◦I changed the page directive so that it read CodeFile = "~/MyFolder/MyPage.aspx.vb". The full path within the root directory needs to be in the quotes. 
◦I made sure the directive Inherits ="MyPage". This should be exactly the same name as the partial class in MyPage.aspx.vb. 
◦I built the page. 
◦After I corrected a few pages and ensured that they worked I used "Edit - Replace in files" menu command to change my code and I deleted all the .aspx.designer.vb files.