I have something like this in Site.Master in an asp.net mvc3 (not razor) project:
<telerik:RadRibbonBar ID="RadRibbonBar1" runat="server">
The code behind is defined as such:
<%@ Master Language="C#" Inherits="myproject.Site_Master" CodeFile="Site.Master.cs" %>
So Site.Master.cs is:
using System.Web.Mvc;
using System;
namespace myproject
{
public partial class Site_Master : ViewMasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
How can I access radribbonbar1 from Page_loaded (which does get called once the page loads).
I was under the impression by giving it an ID it would be autogenerated to be accessible via C# code but that isn’t happening (there is no variable radribbonbar1 available to Site_master).
Any ideas for how to make this work?
Server controls will not work properly because they require event handling, which you do not have in ASP.NET MVC. See the jQuery ribbon plugin