Dear All,
I am using Visual Studio 2005, C# (Web)
i have a page having 2 portion so that i make 2 panel: panel1 and panel2.
By default i made the panel2.Visible =false.
When completing panel1 user click on "submit" button i enable the 2nd panel as:
protected void btnSubmit_Click(object sender, EventArgs e)
{
Panel2.Visible = true;
}
But the problem is when submit button is clicked it reload (postback) the page and make Panel2 visible.
As its a web application each time loading takes time.
So, is there any way to make visible the panel without reload(postback) the page?? if necessary we can use ??Don't use a panel contol, use a div, table etc and javascript to show 2nd section on 1st button click
<script>
function show2nd(){
document.getelementbyid("div2").style.visibility = "visible"
}
<div id=div1>
.......controls
<html button or link ... onclick=show2nd()/>
</div>
<div id=div2 style=visibility:hidden;>
.....controls
<asp:button ....postback and process/>
</div>
hello brin351,
thanks for ur soln.
1 problem .. when i wrote the with dv.. it was asking for object in javascript.
then i brake the lines as follows...
ur suggested line: document.getElementById("div2").style.visibility=true;
i made
var checkdiv2= document.getElementById("div2");
checkdiv2.style.visibility=true;
even then it shows error.. then try to check the object by an alert
alert (checkdiv2);
and seee that checkdiv2 is returning "null".. so its not reffering div2
any idea to refer exactly??
change the javascript
document.getElementById("div2").style.visibility=true
to
document.getElementById("div2").style.visibility=visible
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment