<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button class="trigger" ID="ButtonSubmit" Text="Click" runat="server" OnClick="ButtonSubmit_Click" />
</div>
<div id="divWait" style="display:none;">
Please wait...
</div>
<script type="text/javascript">
// hook into the ready event of the document, ie when everything has loaded
$(document).ready(function () {
// add a click handler for everything with the class of trigger
$('.trigger').click(function () {
// show the element with id of divWait
$('#divWait').show();
});
});
</script>
</form>
</body>
</html>
Code behind
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ButtonSubmit_Click(object sender, EventArgs e)
{
// Wait for 3 seconds
System.Threading.Thread.Sleep(3000);
}
}
Code might not transfer exactly to .net 2.0 but the important bits at the javascript bits on the aspx page which will work regardless.
The .NET Framework version required assembly ‘AjaxControlToolkit.dll’ or one of its dependencies is higher than the project target .NET Framework version.
Do you want to add this reference to your project anyway?
If I click Yes, VS2010 express will put a bunch of folders into my Bin folder making my site not loading correctly.
cms9651
Member
176 Points
580 Posts
Net 2.0 vs ajax
Jan 04, 2013 12:55 PM|LINK
Hello.
Net 2.0 has no ajax yet and my hosting not support net 3.5.
Any suggestion for replace ajax function in Net 2.0 ?
I need insert in my form "Please Wait" message ...
Thank you
AidyF
Star
9204 Points
1570 Posts
Re: Net 2.0 vs ajax
Jan 04, 2013 01:05 PM|LINK
If all you want is a "please wait" message then use "normal" ajax via jQuery or basic javascript rather than the .net ajax toolkit.
Careed
All-Star
18774 Points
3637 Posts
Re: Net 2.0 vs ajax
Jan 04, 2013 01:07 PM|LINK
You should be able to use jQuery regardless of the ASP.NET version, using its AJAX functionality.
http://api.jquery.com/jQuery.ajax/
"The oxen are slow, but the earth is patient."
cms9651
Member
176 Points
580 Posts
Re: Net 2.0 vs ajax
Jan 04, 2013 01:11 PM|LINK
thank you.
Any example for use jQuery in my case ?
AidyF
Star
9204 Points
1570 Posts
Re: Net 2.0 vs ajax
Jan 04, 2013 01:24 PM|LINK
aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> </head> <body> <form id="form1" runat="server"> <div> <asp:Button class="trigger" ID="ButtonSubmit" Text="Click" runat="server" OnClick="ButtonSubmit_Click" /> </div> <div id="divWait" style="display:none;"> Please wait... </div> <script type="text/javascript"> // hook into the ready event of the document, ie when everything has loaded $(document).ready(function () { // add a click handler for everything with the class of trigger $('.trigger').click(function () { // show the element with id of divWait $('#divWait').show(); }); }); </script> </form> </body> </html>Code behind
public partial class Test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ButtonSubmit_Click(object sender, EventArgs e) { // Wait for 3 seconds System.Threading.Thread.Sleep(3000); } }Code might not transfer exactly to .net 2.0 but the important bits at the javascript bits on the aspx page which will work regardless.
oned_gk
All-Star
31818 Points
6509 Posts
Re: Net 2.0 vs ajax
Jan 04, 2013 01:52 PM|LINK
XIII
All-Star
182708 Points
23464 Posts
ASPInsiders
Moderator
MVP
Re: Net 2.0 vs ajax
Jan 04, 2013 01:56 PM|LINK
Hi,
ASP.NET Ajax was released after .NET 2.0 was made available but can be installed as an addon: http://www.microsoft.com/en-us/download/details.aspx?id=883.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
cms9651
Member
176 Points
580 Posts
Re: Net 2.0 vs ajax
Jan 04, 2013 08:11 PM|LINK
thank you for helps.
But the example not working and I have installed the ASPAJAXExtSetup.msi but when I add the dll reference in my project:
The .NET Framework version required assembly ‘AjaxControlToolkit.dll’ or one of its dependencies is higher than the project target .NET Framework version.
Do you want to add this reference to your project anyway?
If I click Yes, VS2010 express will put a bunch of folders into my Bin folder making my site not loading correctly.
what to do?
oned_gk
All-Star
31818 Points
6509 Posts
Re: Net 2.0 vs ajax
Jan 05, 2013 12:31 AM|LINK
cms9651
Member
176 Points
580 Posts
Re: Net 2.0 vs ajax
Jan 05, 2013 08:31 AM|LINK
thank you.
I download and extracted this file http://ajaxcontroltoolkit.codeplex.com/downloads/get/41941 AjaxControlToolkit-ScriptFilesOnly.zip but I don't have DLL library... only files with js extension... how to use it?
the other versions are for framework 3.5...
AjaxControlToolkit-Framework3.5SP1-DllOnly.zip
AjaxControlToolkit-Framework3.5SP1.zip