Click here to Skip to main content
Sign Up to vote bad
good
See more: JavascriptC#4.0
I have connected a div tag in javascript to show validation error messages.If there is an error the error msg will appear. If the user clicks the button the user should not be allowed to move to next page so i am checking the visibility of div in codebehind. How to do that.
Posted 24 Feb '13 - 22:07

Comments
Raje_ - 25 Feb '13 - 4:14
add runat="server" in your div tag.

1 solution

As Raje has pointed out, you can access a DIV tag from your code behind by adding the runat="server attribute to the DIV tag on your page:
<div id="myDivTag"  runat="server" class="someCSS">
     my div
</div>
Then you can access the tag from your code behind to test it's visibility like so:
if (myDivTag.Style["Display"] != "none")
{
     // DIV is visible, so do some stuff
}
  Permalink  
Comments
vasanth90 - 26 Feb '13 - 4:03
thanks fro reply....ya i have given runat = "server" already. but still i couldn't get.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 508
1 Arun Vasu 315
2 Maciej Los 218
3 OriginalGriff 205
4 Aarti Meswania 170
0 Sergey Alexandrovich Kryukov 9,670
1 OriginalGriff 7,409
2 CPallini 3,968
3 Rohan Leuva 3,352
4 Maciej Los 2,861


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid