会asp.net ajax的请进。
<div id= "div1 " runat= "server ">
<updateprogress> ......
</div>
<div id= "div2 " runat= "server ">
<updatepanel>
<asp:textbox runat= "server " id= "textbox1 ">
<asp:button onclick= "button_click " onclick= "clentclikc(); ">
</updatepanel>
<div>
function clentclikc()
{
document.getElementById( "div1 ").style.disyplay= "block ";
document.getElementById( "div2 ").style.disyplay= "none ";
}
public void button_click()
{
if(textbox1.text== "abc ")
{
....
}
else
{
.....
}
}
问题1:当textbox1.text= "abc "时,如何让div1显示信息。
问题2:当textbox1.text <> "abc "时,如何先提示用户出错,再显示让div2从新显示出来。
------解决方案-------------------- <div id= "div1 " runat= "server ">
<updateprogress> ......
</div>
<div id= "div2 " runat= "server ">
<updatepanel>
<asp:textbox runat= "server " id= "textbox1 ">
<asp:button onclick= "button_click ">
</updatepanel>
<div>
public void button_click()
{
if(textbox1.text== "abc ")
{
div1.Visible = true;
div2.Visible = false;
}
else
{
div1.Visible = false;
div2.Visible = true;
}
}
------解决方案--------------------这个貌似用不着AJAX
<div id= "div1 " runat= "server ">
<updateprogress> ......
</div>
<div id= "div2 " runat= "server ">
<updatepanel>
<asp:textbox runat= "server " id= "textbox1 ">
<asp:button onclick= "button_click " onclick= "clentclikc(); ">
</updatepanel>
<div>
public void button_click()
{
if(textbox1.text== "abc ")
{
Div1.Disabled = true;
Div2.Disabled = false;
}
else
{
Div1.Disabled = true;
Div2.Disabled = false;
}
}
------解决方案--------------------javascript就能搞定了吧
------解决方案--------------------恩,js搞定的