2012-02-03 1 views
0

.cs 파일에서 코드를 변경하려고하지만 프론트 엔드에서 변경되지 않습니다.이 .net 프로젝트는 Telerik Framework의 도움으로 작성됩니다. 이것이 소스입니다 코드 측 스크립트, 내가 변경하려고하지만 프론트 엔드에서 나를 위해 변하지 않습니다..cs 파일 코드를 변경했지만 실제로 변경되지 않습니다.

Contact.aspx

<%@ Page language="c#" Codebehind="Contact.aspx.cs" AutoEventWireup="True" MasterPageFile="~/DP.Master" Inherits="divorce.Contact" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentLeft" runat="server"> <h3>Contact Us</h3> 
     <table cellSpacing="8" cellPadding="0" width="730" border="0"> 
      <tr> 
       <td vAlign="top" align="left"> 
        <blockquote> 
         <div class="body">Feel 
           free to browse around this site. If you have comments or questions about our 
           services, or simply need more information and want to contact us, click on the 
           contact button on any page within this site.<br> 
           <br> 
           We promptly respond to all inquiries.</div> 
          <DIV id="lblError" style="DISPLAY: inline; WIDTH: 363px; COLOR: red; FONT-STYLE: italic; FONT-FAMILY: Arial; HEIGHT: 17px" 
           ms_positioning="FlowLayout" runat="server">Label</DIV> 
          <p></p> 
           <table cellSpacing="0" cellPadding="5" width="79%" border="0"> 
            <tr> 
             <td vAlign="top" width="25%"> 
              <div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Your 
                Name:</font></div> 
             </td> 
             <td width="64%"> 
              <div align="left"><input id="contactName" type="text" size="50" name="ContactName" runat="server"></div> 
             </td> 
            </tr> 
            <tr> 
             <td vAlign="top" width="25%"> 
              <div class="style8" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Your 
                Email Address:</font></div> 
             </td> 
             <td width="64%"> 
              <div align="left"><input id="email" type="text" size="50" name="Email" runat="server"></div> 
             </td> 
            </tr> 
            <tr> 
             <td vAlign="top" width="25%"> 
              <div class="style8" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Comments:</font></div> 
              <p class="style8" align="left" valign="texttop">&nbsp;</p> 
              <p>&nbsp;</p> 
             </td> 
             <td width="64%"> 
              <div align="left"><textarea id="comments" name="Comments" rows="15" cols="38" runat="server"></textarea></div> 
             </td> 
            </tr> 
            <tr> 
             <td vAlign="top" colSpan="2"> 
              <div align="center"><input id="contactSubmit" type="submit" value="Submit" name="contactSubmit"></div> 
             </td> 
            </tr> 
           </table> 
        </blockquote> 
       </td> 
      </tr> 
     </table> </asp:Content> 

Contact.aspx.cs는

using Pobk.OpenMail.Message; 
using System; 
using System.Collections; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Web; 
using System.Web.Mail; 
using System.Web.SessionState; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.HtmlControls; 

namespace divorce 
{ 
    public partial class Contact : System.Web.UI.Page 
    { 

     protected void Page_Load(object sender, System.EventArgs e) 
     { 
      this.lblError.Visible = false; 

      if (this.IsPostBack == true) 
      { 

       if (this.contactName.Value.Trim().Length == 0 || 
        this.email.Value.Trim().Length == 0 || 
        this.comments.Value.Trim().Length == 0) 
       { 
        lblError.InnerText = "Please fill out all three fields - your name, email address, and message."; 
        lblError.Visible = true; 
       } 
       else if (IsValidEmail(this.email.Value) == false) 
       { 
        lblError.InnerText = "Please enter a valid email address. Example: [email protected]"; 
        lblError.Visible = true; 
       } 
       else 
       { 
        MailMessage msg = new MailMessage(); 
        msg.From = "[email protected]"; 
        msg.To = "[email protected]"; 
        msg.Subject = "DivorcePacket Contract Form"; 
        msg.Body = this.email.Value + " " + this.comments.Value; 
        msg.BodyFormat = MailFormat.Text; 

        try 
        { 
         SmtpMail.SmtpServer = @"relay-hosting.secureserver.net"; 
         SmtpMail.Send(msg); 
         this.Response.Redirect("messagesent.aspx?s=y", false); 
        } 
        catch (Exception ex) 
        { 
         this.Response.Redirect("messagesent.aspx?s=n", false); 
        } 

       } 

      } 

     } 

     private bool IsValidEmail(string strEmail) 
     { 

      try 
      { 
       return (new EmailAddress(strEmail)).IsValid; 
      } 
      catch (Exception ex) 
      { 
       return true; 
      } 

     } 

     #region Web Form Designer generated code 
     override protected void OnInit(EventArgs e) 
     { 
      // 
      // CODEGEN: This call is required by the ASP.NET Web Form Designer. 
      // 
      InitializeComponent(); 
      base.OnInit(e); 
     } 

     /// <summary> 
     /// Required method for Designer support - do not modify 
     /// the contents of this method with the code editor. 
     /// </summary> 
     private void InitializeComponent() 
     { 

     } 
     #endregion 
    } 

} 

사람이 나를 도와 드릴까요?

.cs 파일을 변경하려고 할 때 내 aspx 파일에 변경 사항이 없습니다. 예를 들어, 코드 this.Response.Redirect ("messagesent. aspx? s = n ", false); 응답. 리디렉션 ("messagesent234343.aspx? s = n", false); 양식 제출 후 폼이 동일한 이전 장소 즉, messagesent.aspx? s = n이 아닌 messagesent234343.aspx? s = n으로 간다. 변경 사항은 수행 중이지만 aspx에서는 변경되지 않는다. 파일 -

+0

예상되는 결과는 무엇입니까? – Shyju

+0

더 많은 정보가 필요합니다. "프론트 엔드"란 무엇을 의미합니까? 특수 패키지를 사용하여 코드 작성을 돕는 경우 코드가 실제로 파일로 변경됩니다. 변경 사항이 코드에 저장되지 않았는지 또는 코드가 원하는 것을 렌더링하지 않는지 여부를 알아야합니다. –

+0

무슨 문제가오고, .cs 파일을 변경하려고 할 때, 내 aspx 파일에서 일을 변경하지 않습니다. 예를 들어, 코드를 변경하려고 시도하는 중입니다. this.Response.Redirect ("messagesent.aspx? s = n ", 거짓); this.Response.Redirect ("messagesent234343.aspx? s = n", false); 양식 제출 후 양식이 동일한 이전 장소 (예 : messagesent.aspx? s = n)가 아니라 messageent234343.aspx? s = n으로 바뀌지 않습니다. 간단히 말해서 : 변경을 수행 중이지만 aspx 파일에서 변경되지 않음 –

답변

0

이것은 어제 나에게 일어난 일과 비슷합니다. 나는 잠시 후에 다시 시작하지 않은 내 비주얼 스튜디오가 코드를 다시 빌드하고 실행하는 것처럼 보였지만 실제로 파일을 저장하지 않는다는 것을 알게되었습니다. 컴퓨터 및 비주얼 스튜디오가 다시 시작되어 나를 위해 일하게되었습니다.

관련 문제