Question

I'm trying to add dynamically a control CalendarExtender from ASP.NET Ajax Toolkit to the WebForm page. When I'm accessing the WebPage, where I've coded this control to be added - I've got an error:

MissingManifestResourceException

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Piece of code, where does occur the error:

// set User birthdate
Label labelUserBirthdate = new Label();
labelUserBirthdate.ID = "editableLabelSecondName";
labelUserBirthdate.Text = "Bithday: ";

TextBox editableBirthdate = new TextBox();
editableBirthdate.ID = "editableTextBoxBirthday";
editableBirthdate.CssClass = "round default-width-input";

CalendarExtender birthdateCalendar = new CalendarExtender();
birthdateCalendar.ID = "calendarExtender" + Guid.NewGuid().ToString();
birthdateCalendar.TargetControlID = "editableTextBoxBirthday";

this.contentViewWebdata.Controls.Add(labelUserBirthdate);
this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
this.contentViewWebdata.Controls.Add(editableBirthdate);
this.contentViewWebdata.Controls.Add(birthdateCalendar);
this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));

Full code (problem does occur on SetSceneEditableUserInfo() ):

I have searched in Web such topics and other people do the same things:

  • just include namespace with AjaxControlToolkit
  • Make new instance of the CalendarExtender
  • set ID
  • set Target ID

As you see I'm doing the similar stuff. Why does it argue on Resources? I don't understand:

  • the correct DLL is included
  • the namespace was included in CodeBehind too.

How can I fix my issue?

Was it helpful?

Solution

The problem has been solved by myself.

The problem occured because I forgot to add dynamically the ToolkitScriptManager control to the page. Now it's working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top