?
Solved

Maintain viewstate of client controls

Posted on 2006-11-12
2
Medium Priority
?
255 Views
Last Modified: 2012-06-21
Hi!

On my web site I have both client and server controls and a problem I struggle with is that the selcted index of a client side SELECT control is reset to 0 every time a server control posts back to the server.

I've set enableviewstate="true" on the SELECT control but it does not matter.

What to do?

0
Comment
Question by:ekberglinda
2 Comments
 
LVL 3

Accepted Solution

by:
jay_gadhavi earned 1000 total points
ID: 17928702
I think u fill up the "SELECT" CONTROL at the page load time and when ever your page load event fire  the "SELECT" control fill up second time and then.....

So put the code which fill up the "SELECT" IN THE
if not  Page.IsPostBack then

'Your code for filling up the combo or select option

end if

Regards,
jay
0
 

Author Comment

by:ekberglinda
ID: 17928715
I made it a server control instead and then it kept its view state after postbacks.
But since your answer is correct I give you the points.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month16 days, 10 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question