Sayfayı Yazdır | Pencereyi Kapat

MS Ajax template: DataView Kontrolü

Nereden Yazdırıldığı: Datakent
Kategori: Diğer bölümler
Forum Adı: C# & ASP.NET
Forum Tanımlaması: C# ve ASP.NET ile ilgili soru / sorun ve paylaşım bölümü
URL: http://forum.datakent.com/forum_posts.asp?TID=1900
Tarih: 19.Nisan.2024 Saat 04:24


Konu: MS Ajax template: DataView Kontrolü
Mesajı Yazan: murat turan
Konu: MS Ajax template: DataView Kontrolü
Mesaj Tarihi: 23.Nisan.2010 Saat 11:13
//web formun'un arka planı
//MicrosoftAjax.js ve template.js  dosyalarını internetten temin edebilirsiniz.
//bu örnekte html nesneleri ile bir şablon oluşturup bu şablonlara veri bağlama
//işlemini göreceğiz.
//dikkat edilecek husus {{}}  ibareleri bu ibareler içerisinde
//bağlanacak tablodaki alan ibareleri veya ajax 'a has fonksiyonları kullanımını sağlayan blok aralığı.
//jquery de bu yapı   {= değişken/fonksiyon}   şeklinde.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tmpl_3.aspx.cs" Inherits="tmpl_3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd - http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html xmlns=" http://www.w3.org/1999/xhtml - http://www.w3.org/1999/xhtml ">
<head runat="server">
    <title></title>

    <style type="text/css">
        .sys-template { display: none; }
    </style>

    <script src="Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="Scripts/MicrosoftAjaxTemplates.js" type="text/javascript"></script>

    <script type="text/javascript">

        function pageLoad() {
            var _resimler = [
            { url: 'img/aslan.png', valx: 'aslan' },
            { url: 'img/esek.png', valx: 'esek' },
            { url: 'img/fil.png', valx: 'fil' }
            ];

            $create(Sys.UI.DataView, { data: _resimler },
            null, null, $get('resimler'));      
        }

       
    </script>

</head>
<body>

<table id="resimler" class="sys-template">
    <tr>
        <td><img sys:src="{{url}}" /></td>
        <td>{{valx}}</td>
    </tr>
</table>

</body>
</html>
 
ve çıktı sonucu:



-------------
http://www.kasatakip.com - Kasa Takip  |  http://www.caritakip.com - Cari Takip  |  http://www.evraktakip.com - Evrak Takip  |  http://www.etasqlmobil.com - ETA SQL Mobil



Cevaplar:
Mesajı Yazan: murat turan
Mesaj Tarihi: 23.Nisan.2010 Saat 11:19

ve daha fazla örnek:

http://weblogs.asp.net/infinitiesloop/archive/2009/09/10/microsoft-ajax-4-preview-5-the-dataview-control.aspx - http://weblogs.asp.net/infinitiesloop/archive/2009/09/10/microsoft-ajax-4-preview-5-the-dataview-control.aspx


-------------
http://www.kasatakip.com - Kasa Takip  |  http://www.caritakip.com - Cari Takip  |  http://www.evraktakip.com - Evrak Takip  |  http://www.etasqlmobil.com - ETA SQL Mobil



Sayfayı Yazdır | Pencereyi Kapat