Showing posts with label Jquery Basics. Show all posts
Showing posts with label Jquery Basics. Show all posts

Monday, May 13, 2013

jquery redirect to another page in asp.net

Title:How to redirect the from one page to other page in asp.net using Jquery

Description:
Basically the scripting language are used to perform dynamic data processing on client side.It will be improve the performance of application
Example:
In previous examples i have given Validate dropdownlist using Jquery,JqueryUI Autocomplete textbox,Jquery Modal popup for mail in asp.net,Jquery Get next/previous month of year.Here i would like explain how to redirect to other page when click on the button in Asp.net using jquery. We can use location method in two ways as you can see in the script
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btnRedirect').click(function () {
window.location.href = 'About.aspx';
// or you can use
// location.href = 'About.aspx';
return false;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="btnRedirect" runat="server" Text="Redirect" />
</form>
</body>
</html>

Wednesday, November 28, 2012

Jquery Alert Box

As you can see in the below script, i just have added a jquery plug-in to my application for jquery classes.The jquery /Javascript provides alert box to display the desired data on dialog box.
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script>
<script type="text/javascript">
    $(document).ready(function () {
        alert('Jquery Alert Box');
    });
</script>
<html>
<head><title>Jquery Alert</title></head>
<body>
</body>
</html>
you can excute the script by the time of page using Doument.ready function

Bel