BLOG SITE
Welcome Back! Sign In Register
  • Home (current)
  • About
  • Categories
    Technology
    Hacks
    offers
    promotion
    devices
    entertainment
    Computer Language
    Current Affairs
    GK
    Health
  • Contact
  1. Home
  2. Blog
image not available
  • 2019-02-07
  • admin
  • Jquery
  • 75

JQuery Hide/Show DIV Elements Content Example

Introduction:

Here I will explain how to show / hide div using jQuery or jQuery Show & hide div content elements using JQuery in asp.net.


Description: 
   
In previous post I explained many articles relating to 
JQuery. Now in this article I will explain how to show or hide div or table elements on website using JQuery in asp.net. In many websites we will be able to see functionality like whenever we click on some link automatically that div or table will hide and again if we click on same link that will be visible for us we can implement that functionality by using JQuery
Previously I wrote one post Ajax Collapsible panel sample in asp.net to show panel when click on down arrow and when we click on up arrow that panel will collapse automatically. Now I am using JQuery to show or hide div or panel or table elements in asp.net.

First open Visual Studio and create new website after that write following code in your aspx page 

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JQuery Show / Hide Div panels in asp.nettitle>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js">script>
<script type="text/javascript">
$(document).ready(function() {
$("#lnkbtn").click(function() {
if ($('#divreg').is(":hidden")) {
$('#divreg').show(500);
document.getElementById('lnkbtn')[removed] = "Hide";
} else {
$("#divreg").hide(500);
document.getElementById('lnkbtn')[removed]="Show";
}
});
});
script>
head>
<body>
<form id="form1" runat="server">
<table>
<tr>
<td><asp:LinkButton ID="lnkbtn" runat="server"><b>Hideb>asp:LinkButton> td>
tr>
<tr>
<td>
<div id="divreg">
<table style="border:1px solid #000">
<tr>
<td colspan="2"><b>Registration Detailsb>td>
tr>
<tr>
<td>UserName:td>
<td><asp:TextBox ID="txtUser" runat="server"/>td>
tr>
<tr>
<td>Password:td>
<td><asp:TextBox ID="TextBox1" runat="server"/>td>
tr>
<tr>
<td><asp:RadioButtonList ID="rdbtnGender" runat="server">
<asp:ListItem>Maleasp:ListItem>
<asp:ListItem>Femaleasp:ListItem>
asp:RadioButtonList>td>
tr>
table>
div>
td>
tr>
table>
form>
body>
html>
If you observe above code in header section I added one script file by using that file we can show or hide div or table content elements using JQuery.

Categories

  • Technology 0
  • Hacks 0
  • offers 1
  • promotion 1
  • devices 0
  • entertainment 0
  • Computer Language 2
  • Current Affairs 1
  • GK 1
  • Health 2

Stay Connected

  • Twitter
  • Facebook
  • Dribble
  • Pinterest

Editor's Choice

fantastic cms
up police computer operator exam problems
2019-01-25

About US

This is a blog and content management system,You can easily setup your blog and customize it according to your needs.This is a short description of your blog.You can change this

Read More

Popular Posts

fantastic cms
Current gk in hindi
2019-01-30
fantastic cms
up police computer operator exam problems
2019-01-25
fantastic cms
constitution of India || These questions are found in all government examinations
2019-02-01

Signup to our newsletter

We respect your privacy.No spam ever!

  • Facebook
  • Twitter
  • Google+
  • Pinterest

Responsive Blog Site 2019 | Brought To You by Sumit kumar