I have a Web form with both HTML and ASP controls. While giving auto-postback, the values in ASP controls are getting persists, but the one in HTML control is not! Can you suggest a way to get it back?
HTML controls, by default, do not run on the server. That means they simply wrap HTML traditional functionality. Therefore, postback and viewstate are not available. To get them, you need to make those controls run on the server, which can be achieved by right-clicking the control and selecting Run as Server Control. After this action, you get a variable of the appropriate type declared in the code behind file, which means you can now even modify the control properties from server-side code, just like the Web Forms controls.
Dig Deeper on .NET Framework application performance management
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ... Continue Reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers. Continue Reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.