Hallo,
ich habe nun das problem, dass ich dreifehlermeldungen vom kompiler bekomm, mit denen ich nichts anfangen kann!
kann mit jemand sagen was sie zu bedueten haben und wo der Fehler in meinem Code liegt?
ASPX-File
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GreetingCardMaker.aspx.cs" Inherits="GreetingCardMaker" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Greeting Card Maker</title> </head> <body> <form id="Form1" runat="server"> <div> Choose a background color: <asp:DropDownList ID="lstBackColor" runat="server" Width="194px" Height="22px"/> Choose a font: <asp:DropDownList ID="lstFontName" runat="server" Width="194px" Height="22px" /> Specify a numeric font size: <asp:TextBox ID="txtFontSize" runat="server" /> Choose a border style: <asp:RadioButtonList ID="lstBorder" runat="server" Width="177px" Height="59px" /> <asp:CheckBox ID="chkPicture" runat="server" Text="Add the Default Picture"></asp:CheckBox> Enter the greeting text below: <asp:TextBox ID="txtGreeting" runat="server" Width="240px" Height="85px" TextMode="MultiLine" /> <asp:Button ID="cmdUpdate" OnClick="cmdUpdate_Click" runat="server" Width="71px" Height="24px" Text="Update" /> </div>
<asp:Panel ID="pnlCard" runat="server" Width="339px" Height="481px" HorizontalAlign="Center"> <asp:Label ID="lblGreeting" runat="server" Width="256px" Height="150px" /> <asp:Image ID="imgDefault" runat="server" Width="212px" Height="160px" /> </asp:Panel> </form> </body> </html> |
Vom CS-File
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78:
| using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lstBackColor.Items.Add("White"); lstBackColor.Items.Add("Red"); lstBackColor.Items.Add("Green"); lstBackColor.Items.Add("Blue"); lstBackColor.Items.Add("Yellow"); lstFontName.Items.Add("Times New Roman"); lstFontName.Items.Add("Arial"); lstFontName.Items.Add("Verdana"); lstFontName.Items.Add("Tahoma");
ListItem item = new ListItem(); item.Text = BorderStyle.None.ToString(); item.Value = ((int)BorderStyle.None).ToString(); lstBorder.Items.Add(item);
item = new ListItem(); item.Text = BorderStyle.Double.ToString(); item.Value = ((int)BorderStyle.Double).ToString(); lstBorder.Items.Add(item);
item = new ListItem(); item.Text = BorderStyle.Solid.ToString(); item.Value = ((int)BorderStyle.Solid).ToString(); lstBorder.Items.Add(item); lstBorder.SelectedIndex = 0; imgDefault.ImageUrl = "defaultpic.png"; }
protected void cmdUpdate_Click(object sender, EventArgs e) {
pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text);
lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); }
int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); pnlCard.BorderStyle = (BorderStyle)borderValue;
if (chkPicture.Checked) { imgDefault.Visible = true; } else { imgDefault.Visible = false; }
lblGreeting.Text = txtGreeting.Text; }
} |
Die fehlermeldungen sind folgende:
1.
Quelltext
1:
| Error 1 'ASP.greetingcardmaker_aspx.GetTypeHashCode()': no suitable method found to override d:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website4\4fa37173\8dce1f9a\App_Web_rom_gkum.0.cs 902 |
2.
Quelltext
1:
| Error 2 'ASP.greetingcardmaker_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override d:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website4\4fa37173\8dce1f9a\App_Web_rom_gkum.0.cs 907 |
3.
Quelltext
1:
| Error 3 'ASP.greetingcardmaker_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' d:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website4\4fa37173\8dce1f9a\App_Web_rom_gkum.0.cs 206 |
Wäre nett wenn mir da jemand weiter helfen kann! Und mir sagen kann, was ic wie falsch gemacht habe und wie ich die Fehler beheben kann.
Daenk schonmal im vorraus.
Moderiert von Christian S.: Xml- und C#-Tags gesetzt