i alwayes desplay rong
CS1061: 'Class1' does not contain a definition for 'Update_News' and no extension method 'Update_News' accepting a first argument of type 'Class1' could be found (are you missing a using directive or an assembly reference?)
(From the solution that was posted instead of improving question):
Page Class:
using System;
using System.Collections;
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 Admin_Control_News : System.Web.UI.Page
{
public string Path;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void Button4_Click(object sender, EventArgs e)
{
try
{
if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength > 0)
{
Path = ("~/Picture/" + FileUpload1.FileName);
FileUpload1.SaveAs(Server .MapPath (Path ));
}
Class1 Add = new Class1();
Add.Add_News(TextBox1.Text, TextBox2.Text, TextBox3.Text,
Path, Convert.ToInt16(TextBox4.Text), CheckBox1.Checked, CheckBox2.Checked); Label1.Text = "تم الحفظ ";
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}
catch (Exception ex) {
Label1.Text = ex.Message;
}
}
protected void Button2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
protected void Button5_Click(object sender, EventArgs e)
{
try
{
Label2.Text = "";
Class1 update = new Class1();
if (FileUpload2.HasFile && FileUpload2.PostedFile.ContentLength >
0)
{
Path = ("~/Picture/" + FileUpload2.FileName);
FileUpload2.SaveAs(Server.MapPath(Path));
}
update.Update_News(TextBox5.Text, TextBox6.Text, TextBox7.Text, Path, CheckBox3.Checked, CheckBox4.Checked, DropDownList1.SelectedValue);
DetailsView1.DataBind();
DropDownList1.DataBind();
Label2.Text = "تم التحديث ";
}
catch (Exception ex) {
Label2.Text = ex.Message;
}
}
protected void Button3_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 2;
}
}