Ok, ho verificato la soluzione, qui è qualcosa che è necessario notare:
Codebehind = "View.ascx.cs" Eredita = "Project.Views .Shared.View "
Nel tuo caso, devi modificare" Project.Views.Shared.View "in base al tuo spazio dei nomi e nome della classe, e per poter accedere al controllo nel code-behind, devi manualmente aggiungere la dichiarazione in co de-behind. Nel mio caso, ho bisogno di inizializzare il controllo Gigasoft proEssential:
public class gigaTest2 : ViewUserControl
{
protected global::Gigasoft.ProEssentials.PegoWeb PegoWeb1;
protected void Page_Load(object sender, EventArgs e)
{
// Set Titles
PegoWeb1.PeString.MainTitle = "Hello ASP.NET";
PegoWeb1.PeString.SubTitle = "";
// One simple way of passing data, data binding also possible. //'
PegoWeb1.PeData.Subsets = 1;
PegoWeb1.PeData.Points = 6;
PegoWeb1.PeData.Y[0, 0] = 10;
PegoWeb1.PeData.Y[0, 1] = 30;
PegoWeb1.PeData.Y[0, 2] = 20;
PegoWeb1.PeData.Y[0, 3] = 40;
PegoWeb1.PeData.Y[0, 4] = 30;
PegoWeb1.PeData.Y[0, 5] = 50;
// Set style of chart and a few other properties //'
PegoWeb1.PePlot.Method = Gigasoft.ProEssentials.Enums.GraphPlottingMethod.Bar;
PegoWeb1.PePlot.Option.GradientBars = 8;
PegoWeb1.PeFont.FontSize = Gigasoft.ProEssentials.Enums.FontSize.Large;
}
fonte
2009-05-08 15:12:12
Come cambiare il titolo da leggere Come aggiungere una pagina code-behind a qualsiasi vista –