I have an asp button that looks like this:
Default.aspx
<asp:button id="button1" runat="server" Text="clickme" onclick="function" />
Default.aspx.cs
protected void function(object sender EventArgs e) { // Do some calculation }
However, whenever I click the button, the whole page is updated. I looked at this site and found many solutions, but none of them work for my project. Here are some suggested solutions:
Does anyone have a solution, or is it really impossible?
"". script , - :
<asp:ScriptManager runat="server" ID="sm"> </asp:ScriptManager> <asp:updatepanel runat="server"> <ContentTemplate> <asp:button id="button1" runat="server" Text="clickme" onclick="function" /> </ContentTemplate> </asp:updatepanel>
, . , MSDN.
, , ASP.Net.
, . ASP.Net , html. html- . , . : , , .Net. , .
, , , HTTP- . , HTTP- -, , , , , ASP.Net( -) .
, , , . - Page_Load if (!IsPostBack) { }. - [WebMethod] ajax . - javascript ASP.Net UpdatePanel.
if (!IsPostBack) { }
[WebMethod]
, , , .
asp.net, postback , .
postback
, , - - -, jquery -. , viewstate.
, asp.net ajax: http://www.asp.net/ajax
jquery wcf: http://www.codeproject.com/Articles/132809/Calling-WCF-Services-using-jQuery