Click here to Skip to main content
15,907,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i want to show a div id="first" before button click and when user clicks search button, want to show other div ="second" with other info and hide first div for time being till redirect to other page

how to do this using asp.net code behind and jquery

same like in makemytrip, when u search hotel , it shows searching and then redirects to hotel list page

I want exactly that way

how to do this

regards
maulik shah
Posted

You may try something is as below.

$("#yourButton").click(function(){
  $("#first").hide();
  $("#second").show();
});



For more info : jQuery Effects - Hide and Show
 
Share this answer
 
Comments
maulikshah1990 5-Dec-13 3:56am    
sorry for not updating that i have asp.net button with runat server in which onclick ,i want to hide and show
Sampath Lokuge 5-Dec-13 3:58am    
Sorry I couldn't get what you told ?
Sampath Lokuge 5-Dec-13 4:07am    
Can you post your button's code snippet ?
maulikshah1990 5-Dec-13 4:06am    
I have a asp.net button , with run="server" and onclick = "HotSearch_Click"

when i click on button, i want to hide div id="first" , and show div="second" and then redirect to other page after array filled..(my logic for data filling)
have you seen in makemytrip or yatra...they show searching when what user has entered for searching and then redirect to other page


i hope this makes you clear doubts
maulikshah1990 5-Dec-13 4:09am    
button in aspx is

<asp:Button ID="psearch" runat="server" onclick="hotsearch_Click" Text="Search" />

<div id="first" runat=="server">
Hello first
</div>
<div id="second" runat=="server">
Hello second
</div>


and in aspx.cs file

protected void hotsearch_Click(object sender, EventArgs e)
{
first.Visible = false;
second.Visible = true;
}
To hide the div use this:
C#
<div id="first" runat="server">
    this is first section
</div>

first.Style.Add("display","none");//This will go into your code

And to show the div:
first.Style.Add("display", "Block");
 
Share this answer
 
Comments
maulikshah1990 5-Dec-13 5:05am    
HI
can i mail you what i want to show
pls give ur email id
Thanks7872 5-Dec-13 5:07am    
Use Improve question at bottom of your question and mention what the problem is.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900