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


Post New Web Links

Please help me with client template jquery!!!

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
 
I use webservces to response Json data (xml -> json by using Json.NET)My xml file:<?xml version="1.0" encoding="utf-8" ?><navigation>    <item title="Home" url="/"></item>    <item title="Home" url="/"></item></navigation>I received through $ ajax call and have json object like this:{"?xml":{"version":"1.0","encoding":"utf-8"},"navigation":{"item":[{"title":"Home","url":"/"},{"title":"Home","url":"/"}]}}Still now, i don't know how to write client template sytax to generate menu like this<li><a href="...">name here</a></li>I see some example write so simple but my json has more node so i don't the way to access child node.<script id="clientTemplate" type="text/html">        <li><a href="${url}">${title}</a></li></script>Anybody help me. I want to create menu from xml + client template!!!P/S:When i see in Firebug (Firefox add-in), i see json object like this: {"d":"{\"?xml\":{\"@version\":\"1.0\",\"@encoding\&q


View Complete Post


More Related Resource Links

Use jQuery and ASP.NET AJAX to build a client side Repeater

  
By sending only data to the client, you can profoundly reduce the size of what you send and see a substantial increase in performance. You also allow yourself the ability to easily add features like light-weight sorting and paging on the client. This can not only improve your users' experience, but reduce server load and bandwidth requirements.

Client Side Gridview Pagination using JQuery

  
I would like to show how to use Client Side Gridview Pagination using Jquery Table Pagination Plugin by using Ryan Zielke.

Use jQuery and ASP.NET AJAX to build a client side Repeater

  
By sending only data to the client, you can profoundly reduce the size of what you send and see a substantial increase in performance. You also allow yourself the ability to easily add features like light-weight sorting and paging on the client. This can not only improve your users' experience, but reduce server load and bandwidth requirements.

To that end, I'm going to walk you through these four steps to effectively implementing a client side Repeater, using ASP.NET AJAX and jQuery:

Use jQuery and ASP.NET AJAX to build a client side Repeater

  
By sending only data to the client, you can profoundly reduce the size of what you send and see a substantial increase in performance. You also allow yourself the ability to easily add features like light-weight sorting and paging on the client. This can not only improve your users' experience, but reduce server load and bandwidth requirements.

Cutting Edge: Explore Rich Client Scripting With jQuery, Part 2

  

Achieving cross-browser compatibility for events is no easy task. The jQuery event handling API addresses the differences in event handling across browsers, allowing you to write more predictable JavaScript.

Dino Esposito

MSDN Magazine April 2009


Cutting Edge: Explore Rich Client Scripting With jQuery, Part 1

  

Thanks to selectors and function chaining, jQuery allows you to write compact, cross-browser code.

Dino Esposito

MSDN Magazine March 2009


JQuery vs MS client validation

  

I have been trying both MicrosoftMvcJQueryValidation.js and MicrosoftMvcValidation.js.

The former does not support validation summarie, while the latter does.

Neither one of them seems to be able to deal with System.ComponentModel.DataAnnotations.DataType markings on the client side. It somewhat defeats the purpose of having the attributes on the server side. I know the validation on the server side works, but I need it to work on the client too.

Is there an easy way to make the client side validation for that work?

Are there any updates to these javascript libraries that I am may not be aware of?



jquery datepicker not popping up in Gridview Edit Template textbox

  

I have a gridview that I can't for the life of me get the datepicker calender to pop up for.  I've been using the datepicker for months very successfully for a variety of textboxes on the page and inside of formviews but this is the first time I've tried using with gridview.  I didn't expect any issues however can't seem to find anything to work.  I have searched the forums for 2 days and attempted any suggestions found within the solutions to no avail.  I've tried using the CSS to link the datepicker but everything stopped working when I changed the code and my page which uses a css style already got all distorted looking.  Please help!

Here is my gridview (only included a part b/c it is large and am only having problem with the datepicker for the date completed text box)

<asp:GridView ID="GridViewCompleted" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid"
        BorderWidth="3px" CellPadding="4" DataKeyNames="job_id" DataSourceID="SourceJobProjectCompleted"
        ForeColor="Black" CellSpacing="2">
<Columns>

how to get client id in jquery selector

  

Hi I am trying to get the clientid of button in my jquery selector like this

$('#ProjectSum_btnassignuserstoproject').click(function() {
});


Here i have hard coded the button id looking at the rendered html source but I want it dynamic using buttonid.clientid.

how to do that?



Help!!! How can I get item index in jquery template?

  
How can I get item index in jquery template?Something likes: ${itemIndex}http://github.com/jquery/jquery-tmplHelp me!!!

Help!!! How to call javascript method in client template???

  

<script id="menuTemplate" type="text/html">
        <option value="${MenuId}" level="${Level}">
 ${Name} //call some js method here? </option> </script>

How to call javascript method in client template (http://github.com/jquery/jquery-tmpl)


Client Side Validation with jQuery

  

I have used client side validation with Ajax before.  Now I need to do client side validation with jQuery.

I am referencing jQuery 1.4.2 and jQuery.validation version 1.7.

I have added <% Html.EnableClientValidation(); %> to the view.

I have added Html.TextBoxFor and Html.ValidationMessageFor to the view.

Client side validation still does not work.


If I understand correctly, I also need to include MicrosoftMvcJQueryValidation.js.  This file was not installed with VS 2010 ultimate.  I have heard that it is available on the Futures project, but the links to the site are broken.


Do I need MicrosoftMvcJQueryValidation.js to make client side validation work?

If so, where do I find the current version of MicrosoftMvcJQueryValidation?  Why isn't it readily available for download or included with VS 2010?

If not, what do I do next to get client side validation to work?


I know that I could manually add calls to jQuery validation, but that is far from ideal - especially since the Ajax v

MVC2 client validation with jquery dialog

  

i am trying to get mvc2 client validation working with a jquery dialog, i have pretty much been using the mvc music store example at http://www.asp.net/mvc. if i go to http://localhost/Build/Edit/11, client validation works, but it will not work in the jquery dialog. any ideas?


ViewActive.aspx - main page with a link to popup a form

...

function showModalEdit(id) {

            var $loading = $('<img src="<%= Url.Content("~/Content/Images/ui-anim_basic_16x16.gif") %>" alt="loading"/>');

            var $dialogEdit = $('<div id="dialogEdit"></div>').append($loading.clone());

            $dialogEdit.find(':submit').hide();

            $dialogEdit.dialog({

                height: 768,

                width: 1024,

                autoOpen: false,

                title: "Modify Build",

               &nb

Client Side Filtering Using Jquery

  

Hi. I would like to filter a DVWP using client side filtering.  Here is what I have done so far:  I wrapped the entire DVWP inside a div tag.

<div id='filters'>

 This code will hide the DVWP:

var $fil = $('#filters'); $fil.hide(); 

Using a jquery filter function, I tried to effect certain items that met the criteria.  This does not work: 

 $(fil).filter(function(index) { return $('@ID', this).val == 2; }).css('background-color', 'red');

Is there another element I can reference to see if the ID is equal to 2. Once I find a match, I'll want to hide that item. Thanks.

Richard


jquery - assign a text to a textbox when checkbox is checked by client

  

hi guys.

I have a checkbox on my project and I have textboxes as well. I tried some jquery code as you can see below for this function;

I would like to get the ctl00$MainContent$firstnametxt.text value to ctl00$MainContent$firstnamedrivertxt.text value when the checkbox is clicked and I want the ctl00$MainContent$firstnamedrivertxt.text to be null if the checkbox is unchecked. how can I do that? the below one doesn't work for me.



<script type="text/javascript">
    //var myspan = $('#MyCheckBoxHere');

    $('#ctl00_MainContent_CheckBox1').click(function () {

        if ($(this).is(':checked')) {
            $('ctl00$MainContent$firstnamedrivertxt').text($('ctl00$MainContent$firstnametxt').text);
        }
        else {
            $('ctl00$MainContent$firstnamedrivertxt').text(null);
        }
    });
</script>





How pass js array from client to server using jQuery?

  

Hi,

i have an array on client side

var ResultArray = new Array();

 ...

for (i = 0; i < count; i++)

 {

 ...

 var RowValue = { id: current_Id, value: current_Value };

ResultArray.push(RowValue);

}


 

than i send it to server

$.post( "Home/GetResult", { result: ResultArray }, null, "json" );



Before sending to server i can see all values in each item of my array 

But when i receive this one on server side, the answer is  "[object Object],[object Object],[object Object]"

[AcceptVerbs(HttpVerbs.Post)]

public ActionResult GetResult(object[] result) // first way

{

object new_result = Request.Form["result"]; // second way

Can you explain me how should i send an array of objects from client side, and how should i receive this and detect each object in array on server side? Thanks.


Looking for client side only jquery framework

  

Anyone have any suggestions for 3rd party controls that work entirely client side?

By this I mean the following using the example of an invoice:

An invoice is a master, with children.

I have to be able to select properties on the invoice and add lines to the invoice via a grid to obviously have the customer like my invoice editing window because they don't want to have to enter the basics and then save and then add the line items.

In a classic asp.net/mvc.net model the server does the processing. This requires that you either store your data objects in the view state (in this case EF) or you store it in the session.

Neither scales worth crap.

What I'm looking to do is be able to create an entire form that interacts in javascript using jquery and never posts back to the server to be persistant. It may pull data from the server to update lists and do lookups etc. but it will never have to have the server hold information to be persistant while it's being built (and thus only when the user clicks save will it actually post the data back.

In a perfect world what would happen is that the EF object would be converted to javascript and then used and bound, and updated. Once I'm done I'd post back the javascript object and it would be automatically converted to the EF equivalent class which I could then attach and save to

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