In VS 2010 I have created a test method in partial class stored in Default.Partial.aspx.cs within the same directory as Default.aspx.cs but it isn't recognized by the Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for Default
/// </summary>
public partial class _Default : System.Web.UI.Page
{
private void test() {
}
}
Code of default.partial.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
test();
}
}
Update: if I add same namespace to both I get even weird message error I really don't understand partial class in asp.net whereas with winform I never encountered such problem !