选中复选框时避免页面刷新,并在ASP.Net中单击提交按钮c# [英] avoid page refresh when checkbox selected and submit button clicked in ASP.Net c#
本文介绍了选中复选框时避免页面刷新,并在ASP.Net中单击提交按钮c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
如果在asp.net网页上选中复选框时如何避免页面刷新。
我的项目基于asp .net c#,数据库为sqlserver
当我选择复选框时,页面刷新...我想避免页面刷新。
并且页面在提交按钮点击时刷新。
我需要帮助以避免页面刷新。
谢谢。
Hello friendssss,
how to avoid page refresh when checkbox selected in asp.net webpage.
my project is based on asp.net c#, and database as sqlserver
when i select checkbox, page is refreshing...I want to avoid page refreshing.
and also page is refreshing on submit button click.
please I required help to avoid page refreshing.
Thanks.
推荐答案
使用更新面板控件
详细信息......
嗨Ranjit
1]从复选框中删除Autopostback =true属性当你将检查复选框时,它将不会刷新页面。
2]使用更新面板。将Checkbox,按钮放入内容模板并放入以下行以制作
页面部分回发。
< asp:scriptmanager id = ScriptManager1runat =serverxmlns:asp =#unknown>
< asp:updatepanel id =UpdatePanel1runat =serverxmlns: asp =#unknown>
< contenttemplate>
< asp:checkbox id =CheckBox1runat =server>
< asp:button id =Button1runat =servertext =Button>
< triggers> < asp:asyncpostbacktrigger controlid =Button1>
Hi Ranjit
1] Remove Autopostback="true" property from Check Box it won't refresh Page when you will
checked the Checkbox.
2] Use Update Panel. put Checkbox,Button in Content Template and Put Below Line for making
page partially post back.
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:checkbox id="CheckBox1" runat="server">
<asp:button id="Button1" runat="server" text="Button">
<triggers> <asp:asyncpostbacktrigger controlid="Button1">
嗨Ranjit
1]删除Autopostback =来自Check Box的真实属性,当你将检查复选框时,它将不会刷新页面。
2]使用更新面板。将Checkbox,按钮放入内容模板并放入以下行以制作
页面部分回发。
< asp:scriptmanager id = ScriptManager1runat =serverxmlns:asp =#unknown>
< asp:updatepanel id =UpdatePanel1runat =serverxmlns: asp =#unknown>
< contenttemplate>
< asp:checkbox id =CheckBox1runat =server>
< asp:button id =Button1runat =servertext =Button>
< triggers> < asp:asyncpostbacktrigger controlid =Button1>
Hi Ranjit
1] Remove Autopostback="true" property from Check Box it won't refresh Page when you will
checked the Checkbox.
2] Use Update Panel. put Checkbox,Button in Content Template and Put Below Line for making
page partially post back.
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:checkbox id="CheckBox1" runat="server">
<asp:button id="Button1" runat="server" text="Button">
<triggers> <asp:asyncpostbacktrigger controlid="Button1">
这篇关于选中复选框时避免页面刷新,并在ASP.Net中单击提交按钮c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文