I have problem with my code-behind for page. I create aspx page and code behind for her, in my code-behind file I add breakpoint on OnLoad method. When I run my solution and go to created page Visual Studio stopped on my breakpoint and all good but in design time I cant use control dropped on my page. My page code:
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Title="Title" Language="C#" AutoEventWireup="true" MasterPageFile="Tabs.master" Inherits="El.Elf.Meganavigaotor._TasksPage,El.Elf.Meganavigaotor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ad23d1e340f92e5d" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2013.2.611.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="TabsPlaceHolder">
<telerik:RadGrid runat="server" ID="gridTask">
</telerik:RadGrid>
</asp:Content>
Code-behind :
namespace El.Elf.Meganavigaotor
{
public partial class _TasksPage:Page
{
private DataSet dynamicData;
private SPWeb currentWeb { get { return SPContext.Current.Web; } }
private SPWeb rootWeb { get { return SPContext.Current.Site.RootWeb; } }
protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);
IEnumerable<SPList> lists = rootWeb.Lists.Cast<SPList>().Where(list => list.Title.Contains("List Name"));
dynamicData=new DataSet();
var _gridTask = FindControl("gridTask"); //return NULL
//RadGrid _gridTask=this.gridTask not compile
}
}
}