2012-02-03 5 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ファイルを変更しようとしているときに、例えば、コード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 "、false); to this.Response.Redirect( "messagesent234343.aspx?s = n"、false); ?? S = N 短期でフォームがmessagesent234343.aspxする同じ古い場所すなわちmessagesent.aspx S = Nとしないように起こっているフォーム送信後に変更されていない:私は変化をしていますが、そのaspxファイルで変更されていません –

答えて

0

これは、昨日私に起こったようなものです。私は最終的に、コードを再構築して実行していたように見えても、しばらくして再起動していなかった私のビジュアルスタジオが実際にファイルを保存していないことに気付きました。コンピュータとビジュアルスタジオの再起動は、私のために働いていた。

関連する問題