View Single Post
Join Date: Jul 2005
Posts: 188
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

Re: ASP server side validation: Retaining form selections after posting

 
0
  #2
Sep 11th, 2008
1. Before posting, store the value (in this case the selectedIndex of the SELECT) you want in a hidden control (INPUT TYPE = "Hidden" etc...)
2. Accept the value in the page accepting the post in a Server side variable.
3.When you return to the original page, obtain the server variable in a client side variable using javascript (var Clientvar = <%=ServerVar%> ; )
4. Set the selectedIndex of the SELECT as the client variable (<<Select_Name>>.selectedIndex = Clientvar)
Last edited by aparnesh; Sep 11th, 2008 at 3:32 pm.
Reply With Quote