Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Show hidden div

Posted on 2006-11-28
Medium Priority
Last Modified: 2008-03-17
I've placed all my validation summary erros into a hidden div on my ASP.NET pages. How would I go about showing this hidden div when there is an error? I've tried a couple of things but nothing seemed to work...either the div wasn't shown at all or part of the div was shown prior to any error coming up. I'm simply adding the div to the bottom of my main div.

If anyone has a good solution I'd like to see how they did this.
Question by:Steven O'Neill
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 20

Assisted Solution

REA_ANDREW earned 600 total points
ID: 18027253
what ever event you have that may trigger this hide Show have this surrounding the code

//Do your Code
YourDiv.Visible = true;

Accepted Solution

PaulCampbell earned 800 total points
ID: 18027267
make your div runat server and set it's visability to false:

<div id="validationSummary" runat="server" visibility="False">



then in the code behind, if your page does not validate, simply do:

validationSummary.visible = True

hop it helps
LVL 19

Assisted Solution

DreamMaster earned 600 total points
ID: 18027307
Why don't you simply use a panel? That creates a DIV as well and is meant for such things. i.e.

<asp:Panel id="pnlErrors" runat="server" visible="false">
Errors go here

And in the code behind:

If (Page.IsValid = False) Then
    pnlErrors.Visible = True
    pnlErrors.Visible = False
    'Handle the form
End If


Author Comment

by:Steven O'Neill
ID: 18080554
I've actually done this another way but it does involve the use of divs but I merely set the validator to Dynamic and have each validator held in a span which has a class applied to it effectively hidding it meantime.

Thanx anyway guys and I've split the points accordingly

BTW I already use asp:Panel within my code and find them very effective...great improvement over classic ASP.
LVL 19

Expert Comment

ID: 18083265
Glad to have been helpful :)


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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