.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Mostly used and essential jQuery code snippets

Posted By: Virendra Dugar     Posted Date: August 23, 2011    Points: 2   Category :JQuery
 
These snippets are small but yet powerful and essential. These are mostly used jQuery code snippets/example which can be used in any project


View Complete Post


More Related Resource Links

Free Code Snippets - ASP.NET

  
You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

  
Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Toolbox: Microsoft Chart Controls, Visual Studio Automatic Code Snippets, And More

  

In this installment we look at the Microsoft Chart Controls; Snippet Designer, a free, add-in for Visual Studio 2008 for creating and editing Code Snippets; refactoring SQL applications; and this month's favorite blog.

Scott Mitchell

MSDN Magazine April 2009


Advanced Basics: IntelliSense Code Snippets

  

IntelliSense code snippets are one of the coolest new features in Visual Studio® 2005. Code snippets are highly customizable code fragments intended to accomplish simple to intermediate tasks quickly; they can be inserted into your code with just a few keystrokes.

Lorenzo Minore

MSDN Magazine April 2006


Use DB query result to generate Jquery required lines of code

  

Hello

I 'm gonna query database for photo records. each record include "photo path" where imagesURL  stored in string format

 I Choses my favorite Juqery plugin to show images. Plugin needs some lines of code like below.

How could I  generate these lines

<script>
$(function() {
$('#slideshow').crossSlide({
sleep: 2,
fade: 1
}, [
{ src: 'picture1.jpg' },
{ src: 'picture2.jpg' },
......
.....
{ src: 'picture4.jpg' }
])
});
</script>

Ajax/Jquery code on UserControls

  
Hello,I have some user controls where I would like to add some javascript that uses Ajax and Jquery technology. Also these scripts should use Sys.WebForms.PageRequestManager.getInstance().add_endRequestand other functions of the Ajax framework.In the past I have added the related code to the hosting aspx page but it becomes a problem when re-using the same control in multiple aspx.Which are the best practice to follow in this case?Regards

Working with Code Snippets in VS.NET

  
INTRODUCTION Creating code snippets using VS.NET is very useful tip because it may help you when you need to write code repeatedly within your applications. For instance, we may use try catch finally block very often. Rather than writing the complete code-block manually, we may save it as a Code Snippet, then use it anywhere we want. In this blog post, I will show you how to create, save and use Code Snippets, where you will see why Code Snippets are extremely useful, especially if you know that you may have various cases where you will apply such or similar code-blocks. WORKING WITH EXISTING VS.NET CODE SNIPPETS Microsoft has provided us with code snippets that developers use in most of the cases. In order to see the already existing code-snippets, in code-behind of your .net application, use the following shortcut keys: CTRL+K+X Insert Snippet will appear you can select one of the given folders, and some predefined code snippets will appear The line above the snippets shows the path to the snippet (1) where you can write the shortcut key of the snippet you want to insert (for faster approach). In our case, we select the try (2) snippet, which will insert the following code:         void MyMethod()         {            &nbs

JQuery Plugin: calling jConfirm from asp.net (code behind)

  
i am using jquery plugin and i got stuck in how to display the confirmation window from code behind and if the user choose "ok" than go ahead delete otherwise ignore. jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) { jAlert('Confirmed: ' + r, 'Confirmation Results'); }); anybody have done similar?  

Get asp.net radiobuttonlist selected value in code behind when using jQuery buttonset

  

I am using the jQueryUI buttonset on an ASP.NET radiobuttonlist. I need to get the selected value in server-side code when the page posts back. If I don't apply the jQuery buttonset, this is of course easy enough - just grab "SelectedValue". However, when I do apply jQuery buttonset, the selected value does not appear to be available on postback any longer. Is there any way around this, or do I need to get the selected value on clientside, and then pass it back myself?

<asp:RadioButtonList ID="RadioButtonList0" CssClass="ratingButtons" runat="server">
    <asp:ListItem Text="Option1" Value="1"/>
    <asp:ListItem Text="Option2" Value="2" />
    <asp:ListItem Text="Option" Value="3" />
    <asp:ListItem Text="Option4" Value="4" />
</asp:RadioButtonList>

  $(function () {
      $(".ratingButtons").buttonset();
      $(".ratingButtons").click(function () { return false; });
  });


 


JQuery: is there a way to show status message - from code behind?

  

i am trying to figure out how to display message box after it done executing the server side code

 here is the code which works from the client side but still looking for a way to make it work from code-behind

.aspx

<div id="status"></div>

script:

$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(7000, 0); })


how to hide jquery code or encode that no body read this code

  

how to hide jquery code or encode that no body read this code


Very Simple JQuery code does not work

  

Hi everyone,

How come the following code does not work ?  If you can, please make the following code to work for me.

Thanks,

Cecilia

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CookiePage1.aspx.cs" Inherits="CookiePage1" %>

<!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">
    <title></title>

    <script type="text/javascript">

        function SetCookie(T) {

            //Create (or update) the value of a cookie to expire in 2 days:
            $.cookie('ShoppingCartId', T, { expires: 2 });

        }

        function ReadCookie() {
            
            var SCId = $.cookie('ShoppingCartId');

            return SCId;

        }

        $(document).ready(function () {
            var T = "Testing Cookie";
            SetCookie(T);

            $('.MyShoppingCartId').append(ReadCookie());

        });       

</script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="MyShoppingCartId">       
    <

Any Example DotNetAge Jquery Library with source Code

  

Any Example DotNetAge Jquery Library  with source Code


Any better than jquery dynamically write html code?

  

I am creating a page which contains one grid showing the content from a very slow data source. There are other faster contents to be displayed too.

I know I can use jquery to dynamically generate the html code from a dedicated controller for the slow data source. 

However, it's not intuitive to read the jquery code for the grid. is there any better way?


Reducing Code by Using jQuery Templates

  

imageNearly every language out there uses templates in some shape or form to minimize the amount of code that has to be written in an application. By using templates you can define a template structure once and use it to generate code, HTML or other formats. If you've created ASP.NET applications then you're aware of how powerful and productive templates are when it comes to generating HTML output. However, what if you want to use templates on the client-side to generate HTML rather than writing a lot of JavaScript to manipulate the DOM?

Although templates have been available in jQuery for quite awhile through various plug-ins, the latest template framework worked on jointly by Microsoft and the jQuery team provides a great solution that doesn't use CSS in strange ways or require a lot of knowledge about a template language. By using it you can define HTML templates in web pages and use them to render HTML output dynamically at runtime. I'll cover the basics of using

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend