<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7958256517041351593</id><updated>2024-10-04T21:58:55.416-07:00</updated><category term="ASP.NET"/><category term="javascript"/><category term="MVC"/><category term="SEO"/><category term="webdev"/><category term="Cache"/><category term="IIS"/><category term="ScriptManager"/><category term="Session"/><category term="ViewState"/><category term="WebServer"/><category term="combinig"/><category term="css"/><category term="error"/><category term="jQuery"/><category term="logging"/><category term="minifying"/><category term="optimization"/><title type='text'>WebDevNet</title><subtitle type='html'>Программирование ASP.NET/MVC, веб-дизайн и веб-кодинг</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-8056504631400105191</id><published>2011-04-19T01:19:00.001-07:00</published><updated>2011-04-19T06:10:17.096-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Cache"/><category scheme="http://www.blogger.com/atom/ns#" term="IIS"/><category scheme="http://www.blogger.com/atom/ns#" term="Session"/><category scheme="http://www.blogger.com/atom/ns#" term="ViewState"/><category scheme="http://www.blogger.com/atom/ns#" term="WebServer"/><title type='text'>WebFarm/WebGarden сценарии – управление состоянием, сессией, кешем</title><content type='html'>&lt;h2&gt;Введение&lt;/h2&gt; &lt;p&gt;Как известно, стандартная веб страница не хранит состояния. Точнее – каждый раз при отправке запроса назад на сервер на клиент возвращается новая сгенерированная страница. В традиционном веб-программировании каждая последующая оптравка страницы на сервер влечет за собой постоянное сохранение данных формы и восстановление этих значений на клиенте. Для решения этой проблемы в ASP.NET предоставляются множесвтво приемов: ControlState, ViewState, Coockie, Session и т.д. Посмотрим на следующую диаграмму:&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/Ta1Ewv-Px-I/AAAAAAAAAXA/G8A-CEQSz8c/s1600-h/States%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;States&quot; alt=&quot;States&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/Ta1EyYCIBOI/AAAAAAAAAXE/9glkfOx9lIM/States_thumb%5B2%5D.jpg?imgmax=800&quot; border=&quot;0&quot; height=&quot;229&quot; width=&quot;560&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;В данной статье разберем управление состоянием на сервере. Для начала немного погрузимся в глубины IIS.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Что такое AppDomain&lt;/h2&gt; &lt;p&gt;AppDomain – это прежде всего термин .NET, а не IIS. Это упрощенный процесс на сервере, использующий для изоляции работающего приложения и играет большую роль в хранении состояний приложения внутри рабочего процесса IIS. Он содержит все InProc содержимое сессии приложения и при завершении данного процесса обнуляется сессия приложения, к которой он прикреплен. На практике, чтобы уловить эту связь с нашим приложением, сделайте следующее:  в работающем приложении откройте конфигурационный файла, добавьте пробел вконце и сохраните файл. Все – наш AppDomain сразу же перегружается и очищает все содержимое сессии приложения. Теперь, я думаю,  проще представить примерный уровень работы этого процесса.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Роль AppDomain в ASP.NET&lt;/h2&gt; &lt;p&gt;Конечно же – эта роль ключевая. Когда сервер IIS получает первый запрос к приложению, создается отдельный Application Domain. Его ключевая задача – обеспечить полную изоляцию от других приложений, работающих на данном сервере, а значит: работать только в рамках выделенных ресурсов, не иметь возможность переходить рамки политики безопасности, абсолютно независимое от других AppDomain загрузк-выгрузки из памяти выделенных ресуросов.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/Ta1Ezu1ZLVI/AAAAAAAAAXI/tzUsTCJWRiY/s1600-h/ALC1%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;ALC1&quot; alt=&quot;ALC1&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/Ta1E1XmREzI/AAAAAAAAAXM/ooeG6r-4YfY/ALC1_thumb%5B2%5D.jpg?imgmax=800&quot; border=&quot;0&quot; height=&quot;312&quot; width=&quot;539&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;В рамках созданного AppDomain для приложения доступны перечисленные способы хранения состояния: InProc Session, Cache, App variables, Static variables. Когда AppDomain завершает свою работу либо перегружается – все эти данные очищаются.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/Ta1E2v_ss-I/AAAAAAAAAWI/mVeJnaTimnk/s1600-h/AppDomaincontains%5B4%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;AppDomaincontains&quot; alt=&quot;AppDomaincontains&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/Ta1E4FvNDrI/AAAAAAAAAWM/tbMAcQrmdSo/AppDomaincontains_thumb%5B2%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;209&quot; width=&quot;257&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Что такое WebFarm  (веб-ферма)&lt;/h2&gt; &lt;p&gt;Данная концепция используется в сценариях, когда приложение имеет довольно внушительный поток пользователей и для поддержания качества и приемлемой скорости обработки и передачи данных необходимо использовать множество серверов. Но просто увеличение количества серверов не решает проблему – необходимо также реализовывать механизмы проверки нагруженности определенного сервера для последующей перенаправки запроса на простаивающий сервер. Посему веб-фермы работает в паре с NLB (Network Load Balancer). При каждом запросе сначала определяется наименее загруженный сервер и данный запрос направляется на этот сервер.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/Ta1E7qud9VI/AAAAAAAAAXQ/YIZbsnBu7gM/s1600-h/webfarm%5B5%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;webfarm&quot; alt=&quot;webfarm&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/Ta1E_GcEnEI/AAAAAAAAAXU/j5ConzR96qA/webfarm_thumb%5B3%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;459&quot; width=&quot;452&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;В данном случае возникает проблема хранения сессийного состояния в AppDomain, так как NLB не гарантирует, что каждый последующий запрос попадет на этот же сервер. В этом случае необходимо использовать OutProc session mode. Более детально дальше.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;В некоторых случаях, если невозможно реализовать OutProc session mode NLB можно настроить так, чтобы все запросы с одного IP-адресса всегда приходили на один и тот же сервер. Тем самым мы гарантировано может использовать InProc session mode. Но тут есть и свои неудобства – NLB работает не на полную силу и даже при перегрузке сервера какими-то другими процессами мы все равно вынуждены перенаправлять все запросы с указаного IP на него.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Что такое Web Garden&lt;/h2&gt; &lt;p&gt;После того, как новый запрос приходит на сервер, как уже говорилось, для приложения создается AppDomain, в рамках которого работает приложение и в рамках которого доступны все переменные приложения. Каждый AppDomain создается в рамках нового или рабочего ASP.NET процесса w3wp.exe. Согласно настройкам приложения, каждое приложение прикреплено к определенному пулу приложений и создается также в рамках данного пула. Application Pool также налаживает свои ограничения на все процессы внутри него на использование ресурсов, на безопасность и т.д.  Так вот, если Application Pool включает в себя несколько рабочих процессов ASP.NET, то такой пул приложеий можно рассматривать как WebGarden. Зачастую преимущества его видны на многопроцессорных серверах, где именно созданием дополнительных процессов загружаем простаивающие процессоры сервера. На рисунку ниже именно первый и второй пул представляют из себя WebGarden.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/Ta1FA84OQkI/AAAAAAAAAWY/0Ultec6bXJk/s1600-h/appDomainsnew%5B3%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;appDomainsnew&quot; alt=&quot;appDomainsnew&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/Ta1FDzl2q4I/AAAAAAAAAWc/CzlTbmeEUTM/appDomainsnew_thumb%5B1%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;372&quot; width=&quot;344&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Управление сессиями&lt;/h2&gt; &lt;p&gt;Существует два режима хранения сессийный переменныйх:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;InProc&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;OutProc&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;InProc&lt;/strong&gt; – в данном режиме все сессийные переменные хранятся в памяти сервера приложения в рамках выделенного AppDomain. Тем самых согласно указанным правилам безопасности эти данные доступны исключительно приложению, работающего в рамках AppDomain. Хранение данных в памяти – наиболее эффективный способ и наиболее быстрый для доступа. Недостатком может быть – если рабочий процес заканчивает работу либо требует перезагрузки, все данные пропадают.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;OutProc&lt;/strong&gt; – в данном режиме данные не хранятся в AppDomain, а значит требуют дополнительных приемов по сериализации\десериализации для доступа к ним. Существуют следующие способы хранения сессийных данных вне рабочего процесса:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;StateServer&lt;/strong&gt; – для хранения данных настраивается дополнительно StateServer. На Windows Server 2003, например, он устанавливается автоматически после установки операционной системы. Необходимо лишь включить (запустить) сервис в настройках.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;SqlServer&lt;/strong&gt; – в данном случае выбирается отдельный SqlServer для хранения сессийный переменных. Для правильной конфигурации необходимо выполнить ряд скриптов, которые можно найти на сайте Microsoft. В результате можно восстанавливаеть состояние сессии для пользователя, пришедшего через несколько дней после последнего посещенения ресурса.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Собственное решение&lt;/strong&gt; – имеется возможность создания собственного провайдера управления сессийными перменными, если перечисленные способы не могут быть использованы в вашем варианте, например, если необходимо хранить данные в файлах на сервере.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Управление кешированием при использовании WebFarm\WebGarden&lt;/h2&gt; &lt;p&gt;Данная проблема не имеет однозначного решения для всех ситуаций, посему можно рассмотреть несколько вариантов, реализиующий основные задачи:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Приложение использует практически статичный набор данных или очень редко изменяющийся, но довольно часто используемый.&lt;br /&gt;&lt;/strong&gt;В этом случае можно сделать файл данных и разместить этот файл в публичном доступе на сервере, к которому имеют доступ все сервера. Теперь каждый сервер может создать локальный кеш для содержимого данного файла и установить при добавлении данных в кеш взаимосвязь через dependency. Тем самым, какждый раз при изменении содержимого этого файла кеш будет обновлятся.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/Ta1FH1nUmEI/AAAAAAAAAWg/xm_iympWPvI/s1600-h/filesystemnew%5B5%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;filesystemnew&quot; alt=&quot;filesystemnew&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/Ta1FKx5aVZI/AAAAAAAAAWk/xE47q70cGyI/filesystemnew_thumb%5B3%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;360&quot; width=&quot;524&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Приложение использует данные довольно часто из удаленного сервера, создавая постоянную нагрузку на этот сервер.&lt;br /&gt;&lt;/strong&gt;В этом случае вычитанные наборы данных можно также хранить в локальном кеше и использовать дополнительные приемы через админ-сайт для контроля валидностью кешированных данных.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/Ta1FODJ2ZTI/AAAAAAAAAWo/4522rX-r_5U/s1600-h/dbdependency%5B7%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;dbdependency&quot; alt=&quot;dbdependency&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/Ta1FRcXx4OI/AAAAAAAAAWs/pCmAx7kiz_g/dbdependency_thumb%5B3%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;353&quot; width=&quot;527&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Мы имеем кешированные данные на каждом сервере фермы, но не может знать периодичность их обновления и не можем гарантировать, что данные валидные на этот момент.&lt;br /&gt;&lt;/strong&gt;Это уже боле сложная ситуация и имеет несколько вариантов решения:&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;ul&gt; &lt;li&gt;Каждый сервер должен иметь дополнительный механизм оповещения о невалидности кешированных данных или обновлении кеша. Для примера – коммуникация через WebService. В итоге решение может быть слудующее: сервер, хранящий данные, при каждом обновлении этих данных вызывает данный сервис каждого сервера и передает либо просто оповещает, что определенные наборы изменились. Каждый сервер обновляет данные запросом либо же при следующей вычитке данных из кеша на новые.&lt;br /&gt;&lt;br /&gt;Для реализации данного подхода требуется дополнительные механизмы контроля за данными и за вычиткой приложениями, а именно: иметь список всех адресов сервисов серверов и при добавлении нового сервера обновлять этот список; мониторить загруженными данные и при необходимости не оповещать приложение, если оно не использует измененный набор данных вообще и т.д.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/Ta1FUekhtSI/AAAAAAAAAWw/faZGHhbGqa4/s1600-h/webserviceapproach%5B3%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;webserviceapproach&quot; alt=&quot;webserviceapproach&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/Ta1FYKCmSPI/AAAAAAAAAW0/HnLHZRdwlA0/webserviceapproach_thumb%5B1%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;329&quot; width=&quot;489&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Использовать отдельный сервер для кеширования данных и реализовать логику контроля над валидностью данных на этом сервере. Все другие компьютеры фермы через быстрое TCP/IP-соедиение обращаются на этот сервер и получают необходимую порцию данных. Тем самым единожды реализовываются механизмы кеширования и контроля над валидностью кеширования. Сам же кеш-сервер может читать данные из любого другого источника. Остальные веб-сервера имеют доступ только к данному серверу.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/Ta1FbM_oHwI/AAAAAAAAAW4/RJvx0I-lAlQ/s1600-h/remoting%5B4%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border: 0px none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;&quot; title=&quot;remoting&quot; alt=&quot;remoting&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/Ta1FeCaXlXI/AAAAAAAAAW8/QGtycFPgcsY/remoting_thumb%5B2%5D.png?imgmax=800&quot; border=&quot;0&quot; height=&quot;319&quot; width=&quot;492&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Использование серверов или механизмов сторонних фирм. Например использование &lt;strong&gt;CDN&lt;/strong&gt; от Microsoft или Google для получения статичных данных.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/8056504631400105191/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2011/04/webfarmwebgarden.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/8056504631400105191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/8056504631400105191'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2011/04/webfarmwebgarden.html' title='WebFarm/WebGarden сценарии – управление состоянием, сессией, кешем'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_2odjgpkNP38/Ta1EyYCIBOI/AAAAAAAAAXE/9glkfOx9lIM/s72-c/States_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-1578698315596529977</id><published>2011-01-27T23:31:00.001-08:00</published><updated>2011-01-27T23:31:27.261-08:00</updated><title type='text'>EasyHTTP – инструмент для удобного взаимодействия с веб-сервером</title><content type='html'>&lt;p&gt;Работая над множеством интернет-проектов, я довольно часто сталкиваюсь с проблемой, когда приходится обмениваться данными с сервером не посредстовом вызова веб-сервисов, а непосредственно создавая и отправляя HtppRequest с прикрепленными параметрами и обрабатывая HttpResponse, приводя возвращенные данные к нужному объекту класса.&lt;/p&gt; &lt;p&gt;Конечно же, если я разработчик и клиентской и серверной части приложения, то для более удобного обмена данными создаю необходимые мне веб-сервисы, а на клиенте с помощью встроенных механизмов VisualStudio парой кликов мыши легко генерирую proxy-классы для получения и отправки нужных мне объектов.В итоге на клиент я получаю сразу объекты нужных мне классов, без необходимости парсинга ответа сервера.&lt;/p&gt; &lt;p&gt;Можно продемонстрировать коротенький пример данного подхода: допустим мы имеем обычный RSS-клиент, но оперирующий данными, хранящимися на сервере. Наш клиент может получать список новых статей, добавлять новый RSS-канал, отмечать статьи как прочитанные.&lt;/p&gt; &lt;p&gt;Для удобного оперирования данными создадим соответвующие классы объектов приложения:&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; RssChanel&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; Id { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; Title { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; RssUrl { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; Category { get; set; }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; SitePage&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; Id { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; RssChanelId { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; RssChanel RssChanelSource { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; Title { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; Preview { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; Url { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; DateTime CreateDate { get; set; }&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; IsRead { get; set; }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Далее создаем CRUD-методы для получения, удаления, сохранения данных в хранилище. Ну а чтобы не усложнять себе работу в создании клиентского приложения, создаем веб-сервис для взаимодействия с данным веб-приложением и реализовуем перечисленные выше методы, необходимые нашему клиентскому приложению: получение данных, добавление нового канала, редактирование страницы (пометить как прочитанная).&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 280px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #008000&quot;&gt;/// Summary description for RssService&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;[WebService(Namespace = &lt;span style=&quot;color: #006080&quot;&gt;&quot;http://tempuri.org/&quot;&lt;/span&gt;)]&lt;br&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; RssService : System.Web.Services.WebService&lt;br&gt;{&lt;br&gt;&lt;br&gt;    [WebMethod]&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; RssChanelProvider_Insert(RssChanel chanel)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; DataRepository.RssChanelProvider.Insert(chanel);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    [WebMethod]&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; RssChanelProvider_Update(RssChanel chanel)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; DataRepository.RssChanelProvider.Update(chanel);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    [WebMethod]&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; RssChanelProvider_Delete(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; chanelId)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; DataRepository.RssChanelProvider.Delete(chanelId);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    [WebMethod]&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; SitePage[] SitePageProvider_GetAll(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; pageLength)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; DataRepository.SitePageProvider.GetAll(pageLength).ToArray();&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    [WebMethod]&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; SitePageProvider_Update(SitePage sitePage)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; DataRepository.SitePageProvider.Update();&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Итак, теперь с помощью соответсвующих запросов мы можем достучаться до методов нашего веб-сервиса&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TUJwe1YtzxI/AAAAAAAAAUk/zs8LSvlYrC0/s1600-h/image11.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TUJwhZEhw5I/AAAAAAAAAUo/smzjJ7cYcVs/image_thumb7.png?imgmax=800&quot; width=&quot;419&quot; height=&quot;402&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Теперь приступим к релазации клиентского приложения. С помощью встроенных механизмов генерации прокси-класов для вызова методов веб-сервиса, достучаться до нашего сервиса не составляет особого труда.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TUJwizrOzLI/AAAAAAAAAUs/rN3ZbV3zo8U/s1600-h/image10.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TUJwkrqRMWI/AAAAAAAAAUw/gdbbeT9npvo/image_thumb6.png?imgmax=800&quot; width=&quot;422&quot; height=&quot;238&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TUJwnr3Bw1I/AAAAAAAAAU0/iqlKED6Ng9E/s1600-h/image16.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TUJwpmqqthI/AAAAAAAAAU4/_ODgj9AG8Jc/image_thumb10.png?imgmax=800&quot; width=&quot;422&quot; height=&quot;339&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Все. Далее всю сложную работу по созданию прокси-класов, wsdl-описания сервиса и многое другое берет на себя VisualStudio. Также в конфигурационный файл добавляется сексия управления каналом связи с сервером. Тонна рутинной работы была сделана за нас студией. Нам же остается лишь изменить тестовый URL-адрес сервера на реальный.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;В итоге мы имеем удобную объектную модель для обмена данными с сервером. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TUJwq7oxPiI/AAAAAAAAAU8/heSZmoaWJOo/s1600-h/image3.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px 25px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TUJwsMUEozI/AAAAAAAAAVA/w-2vJEL7aPg/image_thumb.png?imgmax=800&quot; width=&quot;242&quot; height=&quot;200&quot;&gt;&lt;/a&gt; &lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TUJwtUDumCI/AAAAAAAAAVE/uHFqafRulf0/s1600-h/image111.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TUJwvGpcN5I/AAAAAAAAAVI/vT0VUW5OhRw/image_thumb4.png?imgmax=800&quot; width=&quot;434&quot; height=&quot;199&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Следующий код будет абсолютно валидным и компилируемым:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; Main(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;[] args)&lt;br&gt;{&lt;br&gt;    RssServiceSoapClient serviceClient = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; RssServiceSoapClient();&lt;br&gt;&lt;br&gt;    SitePage[] sitePages = serviceClient.SitePageProvider_GetAll(20);&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;foreach&lt;/span&gt; (SitePage sitePage &lt;span style=&quot;color: #0000ff&quot;&gt;in&lt;/span&gt; sitePages)&lt;br&gt;    {&lt;br&gt;        sitePage.IsRead = &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;;&lt;br&gt;        serviceClient.SitePageProvider_Update(sitePage);&lt;br&gt;    }&lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Отлично. Если же наше веб-приложение постоянно развивается и объектная модель со временем может менятся – для клиента необходимо просто перегенерировать ServiceReference и новые свойства будут доступны в перегенерированных proxy-классах.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TUJwwbHZpxI/AAAAAAAAAVM/vFth-jogMas/s1600-h/image20.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TUJwyWBEXnI/AAAAAAAAAVQ/8rszoBc1g1E/image_thumb12.png?imgmax=800&quot; width=&quot;395&quot; height=&quot;227&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;В итоге без особых сложностей мы можем делать клиент-серверные приложения, оперируя при этом единым набором объектов классов, без необходимости писать свои конверторы для анализа ответа сервера.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Хорошо, но что делать, если необходимо создать клиентское приложение, получающее и обрабатывающее данные не с нашего сервера, т.е. где мы не можем гарантировать, что обмен данными происходит через веб-сервисы.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;К тому же мы не можетvгарантировать, что все ресурсы, из которых мы чарпаем данные, отдают нам их именно в том формате, в котором нам надо. Хотелось бы иметь какое-то универсальное средство, упрощающее монотонную работу с HTTP – Get,Post,Delete,Put, сериализация из JSON в объектную модель приложения, чтение данных из REST-full сервисов.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Анализируя библиотеки сторонных разработчиков, я нашел для себя наиболее удобную – &lt;strong&gt;&lt;a href=&quot;https://github.com/hhariri/EasyHttp&quot;&gt;EsayHTTP&lt;/a&gt;&lt;/strong&gt;. Можно на первом коротеньком примере показать, в чем именно упрощается работа при использовании данной библиотеки:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;var http = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; HttpClient&lt;br&gt;           {&lt;br&gt;               Request = {Accept = HttpContentTypes.ApplicationJson}&lt;br&gt;           };&lt;br&gt;&lt;br&gt;var response = http.Get(&lt;span style=&quot;color: #006080&quot;&gt;&quot;http://domain.com/customer/25&quot;&lt;/span&gt;);&lt;br&gt;&lt;br&gt;var customer = response.StaticBody&amp;lt;Customer&amp;gt;();&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Буквально несколько строчек кода и сразу экономия нескольких часов рутинной работы: создания helper-классов для отправки запросов и получения ответов сервера, создание helper-классов для десеаризилицации ответов и многое другое.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;В этом же примере мы задаем Accept Header возвращаемой страницы и конвертируем ответ в strogly-typed объект Customer.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Если же наша бизнес-модель не имеет точного типа объекта для десериализации ответа сервера, мы может проделать следующие манипуляции:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;var http = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; HttpClient&lt;br&gt;           {&lt;br&gt;               Request = {Accept = HttpContentTypes.ApplicationJson}&lt;br&gt;           };&lt;br&gt;&lt;br&gt;var response = http.Get(&lt;span style=&quot;color: #006080&quot;&gt;&quot;http://domain.com/customer/25&quot;&lt;/span&gt;);&lt;br&gt;&lt;br&gt;dynamic customer = response.DynamicBody();&lt;br&gt;&lt;br&gt;Console.WriteLine(customer.Name);&lt;br&gt;Console.WriteLine(customer.Email);&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;В этом случае мы хотим возвратить динамический тип, чтобы десериализовать ответ в динамический объект. Это дает нам возможность выбирать лишь необходимые нам значения полей из объекта, не создавая для этогого отдельные классы.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Если же нам просто надо скачать страницу или изображение и сохранить его в файл на локальном компьюетере:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;var http = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; HttpClient();&lt;br&gt;http.GetAsFile(&lt;span style=&quot;color: #006080&quot;&gt;&quot;http://ydobno.net/logo.png&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;@&quot;C:\Logos\ydobno\logo.png&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Крайне просто также сделать POST-запрос на сервер:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;var http = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; HttpClient();&lt;br&gt;&lt;br&gt;var customer = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Customer()&lt;br&gt;                    {&lt;br&gt;                        Name = &lt;span style=&quot;color: #006080&quot;&gt;&quot;Joe Smith&quot;&lt;/span&gt;,&lt;br&gt;                        Email = &lt;span style=&quot;color: #006080&quot;&gt;&quot;Joe@Gmail.com&quot;&lt;/span&gt;&lt;br&gt;                    };&lt;br&gt;&lt;br&gt;http.Post(&lt;span style=&quot;color: #006080&quot;&gt;&quot;http://domain.com/customer&quot;&lt;/span&gt;, customer, HttpContentTypes.ApplicationJson);&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;К тому же мы можем задавать тип кодировки передаваемых данных, в нашем случае данные на сервере принимаются в формате JSON.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Отлично. Благодаря данной библиотеке мы сразу получили мощный инструмент для взаимодействия с удаленным сервером, получили возможность обрабатывать и посылать запросы, не погружаясь в глубины HTTP, получили возможность вытягивать из ответного потока объекты, не погружаясь в глубины десеарилизации. Конечно же, данная библиотека не является панацеей от всех проблем и скорее всего придется делать свои классы для работы с сервером на уровне HTTP, но во многих стандартных вопросах смело можно положится именно на нее.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/1578698315596529977/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2011/01/easyhttp.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/1578698315596529977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/1578698315596529977'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2011/01/easyhttp.html' title='EasyHTTP – инструмент для удобного взаимодействия с веб-сервером'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2odjgpkNP38/TUJwhZEhw5I/AAAAAAAAAUo/smzjJ7cYcVs/s72-c/image_thumb7.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-5790298128944581615</id><published>2011-01-19T06:44:00.001-08:00</published><updated>2011-01-19T06:44:41.469-08:00</updated><title type='text'>Выполнение методов веб сервиса в браузере</title><content type='html'>&lt;p&gt;Вы разрабатываете веб-приложение, используещее веб-сервисы для обмена данными с клиентской стороной. Если после публикации проекта на сервер загрузить в браузере файл веб-сервиса, то на экран Вы получите список методов, которые он имплементирует.&lt;/p&gt; &lt;p&gt;Примером может быть:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TTb4h-NR7EI/AAAAAAAAAUM/FKFnuIIVY_U/s1600-h/image%5B4%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TTb4k9ct91I/AAAAAAAAAUQ/-hfAr2pv6L8/image_thumb%5B2%5D.png?imgmax=800&quot; width=&quot;521&quot; height=&quot;404&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Если перейти по ссылке любого метода мы получим только мета-информацию о методе сервиса без какой-либо возможности выполнить его, а значит и для тестирования метода необходимо писать отдельный модуль, генерировать прокси-клас для вызова сервиса и програмно вызывать методы.&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TTb4nz_-yBI/AAAAAAAAAUU/nW6Bm6_CsDI/s1600-h/image%5B14%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TTb4r0wJumI/AAAAAAAAAUY/RMf8oPtqvj8/image_thumb%5B10%5D.png?imgmax=800&quot; width=&quot;523&quot; height=&quot;611&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Чтобы добавить возможность вызывать методы и передавать параметры методам сразу в браузере необходимо всего лишь добавить следующие строки в конфигурационный файл веб-приложения в секцию &amp;lt;&lt;strong&gt;system.web&lt;/strong&gt;&amp;gt;:&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;webServices&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;protocols&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;       &lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;HttpGet&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;       &lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;HttpPost&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;     &lt;br&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;protocols&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;webServices&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;В результате при переходе на конкретный метод веб-сервиса можно видеть форму ввода параметров и кнопку &lt;em&gt;Invoke&lt;/em&gt; для выполнения метода с введенными параметрами с выводом результата выполнения на экран.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TTb4vxmE6mI/AAAAAAAAAUc/_BWpsxH_1qk/s1600-h/image%5B22%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TTb41jilGaI/AAAAAAAAAUg/UV8aBim_J5k/image_thumb%5B14%5D.png?imgmax=800&quot; width=&quot;514&quot; height=&quot;536&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;По умолчанию данная опция неактивна, а связвно это с политикой безопасности приложения, но включается через конфигурационный файл по необходимости.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/5790298128944581615/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2011/01/blog-post.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/5790298128944581615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/5790298128944581615'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2011/01/blog-post.html' title='Выполнение методов веб сервиса в браузере'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_2odjgpkNP38/TTb4k9ct91I/AAAAAAAAAUQ/-hfAr2pv6L8/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-9079010610022377545</id><published>2011-01-06T02:48:00.001-08:00</published><updated>2011-01-06T05:36:17.339-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="error"/><category scheme="http://www.blogger.com/atom/ns#" term="logging"/><category scheme="http://www.blogger.com/atom/ns#" term="webdev"/><title type='text'>Контроль исключений ASP.NET с помощью модуля Elmah</title><content type='html'>&lt;p&gt;При создании любого веб-приложения, в том числе и ASP.NET, разработчику зачастую также ставится задача обеспечить удобный для администратора механизм контроля за критическими ошибками приложения, а также обезопасить пользователя от выпадания из рабочего процесса из-за необработанного исключения.&lt;/p&gt; &lt;p&gt;Что имеется ввиду. Допустим, логика работы нашего веб-приложения предусматривает, что на определенном этапе использования нашей системы пользователь оперирует со следующей формой&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TSWdf-ihiQI/AAAAAAAAALM/0k-FXOng2Ik/s1600-h/image%5B5%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TSWdhpdPOEI/AAAAAAAAALQ/t1oYxKJLEnM/image_thumb%5B3%5D.png?imgmax=800&quot; width=&quot;445&quot; height=&quot;132&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Используя валидаторы ASP.NET на этапе постинга формы мы проверяем введенное значения на условия: не пустое, целочисленное, меньше 5. Если введенные пользователем значения не попадают под наши правила валидации, мы выдаем предупреждения:&lt;/p&gt; &lt;p&gt;&lt;font color=&quot;#ff0000&quot;&gt;Введите количество человек&lt;br&gt;Только целочисленные значение не более 5&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Тем самым при постинге формы на сервер мы можем быть уверены, что данные проверены. Далее же мы делаем деление общей суммы на количество участников. Допустим мы забыли учесть, что и минимальный порог введенных значений должен начинаться с 1. В итоге, при вводе значения 0 в поле количества участников и отправки формы на сервер мы получим следующий ответ:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TSWdjPqW18I/AAAAAAAAALU/czbF2YeMWL8/s1600-h/image%5B9%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TSWdlkmYHVI/AAAAAAAAALY/-S6pi3EF3aM/image_thumb%5B5%5D.png?imgmax=800&quot; width=&quot;464&quot; height=&quot;238&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Было вызвано необработанное исключение в ответ на операцию деления на ноль. Крайне некрасиво смотрится в рабочем приложении и крайне сложно определяется на этапе тестирования, особенно если данная форма показывается пользователю после множества этапов ввода данных.&lt;/p&gt; &lt;p&gt;Если же исправление ошибки довольное длительная процедура, а необходимо какое-никакое решения прямо сейчас – можно на первое время перенапрявлять пользователя на custom error страницу, если произошло необработанное исключение. Тем самым со стороны пользователя остается мнение, что система держит все под контролем.&lt;/p&gt; &lt;p&gt;Чтобы добавить такую функциональность необходимо просто создать новую страницу (например error.aspx) и добавить следующую запись в конфигурационный файл web.config.&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 93px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;customErrors&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;mode&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;On&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;defaultRedirect&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;error.aspx&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;customErrors&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Теперь при постинге формы с нулевым значением количества участников мы получим следующий ответ сервера (для примера)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TSWdmwaX1iI/AAAAAAAAALc/ECiqnUCBIGk/s1600-h/image%5B13%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TSWdop764fI/AAAAAAAAALg/rk4nh1HksTQ/image_thumb%5B7%5D.png?imgmax=800&quot; width=&quot;547&quot; height=&quot;142&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Решение вроде бы подходящее, но малоинформативное для администратора системы. Можно полагаться конечно на сознательных пользователей нашей системы, которые точно опишут совершенные ими шаги, укажут введенные в поля значения и отправят письмо по указанному адресу. Хотелось бы получасть уведомления о каждой критической ошибке приложения и независимо от того – произошло это при постинге формы, либо же в фоновом процессе рассылки писем пользователям, либо при ajax-запросе для обновления пользовательского интерфейса.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Решений может быть несколько. Во первых – можно создать свой обработчик исключений и заносить в файл логирования всю информацию об ошибках. Данный вариант мы рассмотрим позже. Сначала, так как система живая и требует срочно вмешательсва, мы можем воспользоваться сторонними библиотеками и быстро добавить логирование ошибок и удобного доступа к этой информации администратору системы.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Для этого с помощью &lt;strong&gt;&lt;a href=&quot;http://nuget.codeplex.com/documentation&quot; target=&quot;_blank&quot;&gt;NuGet&lt;/a&gt;&lt;/strong&gt; (расширение Visual Studio) добавим библиотеку &lt;a href=&quot;http://code.google.com/p/elmah/&quot; target=&quot;_blank&quot;&gt;Elmah&lt;/a&gt; (если расширение NuGet не установлено – рекомендую срочным образом исправить это :) так как очень много именно рутинной работы помогает решить столь незаметное для всего рабочего процесса приложение).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TSWdrK4z3VI/AAAAAAAAALk/0tC1L7lLAJ8/s1600-h/image%5B21%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TSWdtkCmrNI/AAAAAAAAALo/iwHhA1-VIfQ/image_thumb%5B11%5D.png?imgmax=800&quot; width=&quot;538&quot; height=&quot;242&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TSWdwqxA9hI/AAAAAAAAALs/AJBFlwa9CDY/s1600-h/image%5B26%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TSWdzXxhs8I/AAAAAAAAALw/EDx-9bi_JEY/image_thumb%5B14%5D.png?imgmax=800&quot; width=&quot;638&quot; height=&quot;375&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Итак, нажимая кнопку Install происходят следующие действия (замечу, что без NuGet эти действия необходимо было бы проделать вручную):&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Закачивается последняя стабильная сборка Elmah библиотеки;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Библиотека добавляется в References вашего приложения (если тип проекта – WebSite – сборка добавляется в Bin директорию);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;В конфигурационном файле регистрируется новая SectionGroup – elmah и регистрируются новые модули и хендлеры. В частности, регистрируется хендлер elmah.axd, который генерирует структурированный отчет об ошибках приложения;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Все. Несколько кликов и механизм доступа администратором ко всем ошибкам приложения реализован. Введем в нашу форму 0 и еще раз запостим нашу форму. Теперь перейдем на страницу &lt;strong&gt;elmah.axd&lt;/strong&gt; в корне нашего приложения. Это зарегестрированный ранее хендлер, управляемый библиотекой Elmah.dll&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TSWd1ZGQfQI/AAAAAAAAAL0/5PYqCXgt-IY/s1600-h/image%5B31%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TSWd4FjFpcI/AAAAAAAAAL4/wsYC3WIUcng/image_thumb%5B17%5D.png?imgmax=800&quot; width=&quot;660&quot; height=&quot;243&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Выбирая детали сообщения мы можем видеть полную информацию об ошибке: место, где было сгенерировано необработанное исключение; ссылку на оригинальную страницу ошибки; содержимое запроса и многое другое. Как видите, более полной информации об проблемном месте сложно себе представить.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Хорошо, идем дальше. Имея удобный интерфейс анализа возникших ошибок, мы может довольно быстро реагировать на работу целой системы, улучшая качество взаимодйствия пользователя с сайтом. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Мы можем ежедневно просматривать таблицу сообщений и принимать те или иные меры по разрешеию возникших проблем. Но что делать, если некоторые иключения настолько опасны для пользователей и системы в целом, что длительное ожидание когда администратор заметит их может привести к краху системы в целом. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Примером может быть исключение, возникающее при попытке скомпроментировать систему на наличие &lt;a href=&quot;http://ru.wikipedia.org/wiki/%D0%92%D0%BD%D0%B5%D0%B4%D1%80%D0%B5%D0%BD%D0%B8%D0%B5_SQL-%D0%BA%D0%BE%D0%B4%D0%B0&quot; target=&quot;_blank&quot;&gt;SQL-inject&lt;/a&gt; уязвимости. Если наша система все же подвержена на некоторых страницах данной уязвимости, то ожидание в сутки пока администратор заметит попытки взлома, может привести к довольно значительной утечке данных. Посему для более полного контроля над проблемами системы нам хотелось бы в случае возникновения особого типа необработанных исключений, делать уведомления администратору на почтовый ящик для незамедлительного вмешательства в работу системы.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Для решения данной проблемы мы можем использовать возможности ранее подключенной библиотеки Elmah. Для этого в наш конфигурационный файл добавим в секцию &lt;strong&gt;&amp;lt;configuration&amp;gt;&lt;/strong&gt; и в секцию &lt;strong&gt;&amp;lt;httpModules&amp;gt;&lt;/strong&gt; следующие найтройки:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 322px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&amp;lt;elmah&amp;gt;&lt;br&gt;    &amp;lt;errorMail from=&lt;span style=&quot;color: #006080&quot;&gt;&quot;test@test.com&quot;&lt;/span&gt; &lt;br&gt;        to=&lt;span style=&quot;color: #006080&quot;&gt;&quot;test@test.com&quot;&lt;/span&gt;&lt;br&gt;        subject=&lt;span style=&quot;color: #006080&quot;&gt;&quot;Application Exception&quot;&lt;/span&gt;&lt;br&gt;        async=&lt;span style=&quot;color: #006080&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;br&gt;        smtpPort=&lt;span style=&quot;color: #006080&quot;&gt;&quot;25&quot;&lt;/span&gt;&lt;br&gt;        smtpServer=&lt;span style=&quot;color: #006080&quot;&gt;&quot;***&quot;&lt;/span&gt;&lt;br&gt;        userName=&lt;span style=&quot;color: #006080&quot;&gt;&quot;***&quot;&lt;/span&gt;&lt;br&gt;        password=&lt;span style=&quot;color: #006080&quot;&gt;&quot;***&quot;&lt;/span&gt;&amp;gt;&lt;br&gt;    &amp;lt;/errorMail&amp;gt;&lt;br&gt;&amp;lt;/elmah&amp;gt;&lt;br&gt;...&lt;br&gt;&amp;lt;httpModules&amp;gt;&lt;br&gt;    &amp;lt;add name=&lt;span style=&quot;color: #006080&quot;&gt;&quot;ErrorLog&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #006080&quot;&gt;&quot;Elmah.ErrorLogModule, Elmah&quot;&lt;/span&gt;/&amp;gt;&lt;br&gt;    &amp;lt;add name=&lt;span style=&quot;color: #006080&quot;&gt;&quot;ErrorMail&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #006080&quot;&gt;&quot;Elmah.ErrorMailModule, Elmah&quot;&lt;/span&gt; /&amp;gt;&lt;br&gt;&amp;lt;/httpModules&amp;gt;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Недостатком такого подхода является только невозможность выборки приоритетности исключений, на которые рассылать уведомления, а на которые только добавлять в общий список ошибок. В идеале хотелось бы выделить особо важные типы исключиений, на которые мы хотели бы реагировать мгновенно, в то время как остальные типы исключений обрабатывать по плану.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Для этого добавим в наше веб-приложение отдельный класс &lt;strong&gt;VeryImportantException&lt;/strong&gt;, унаследованный от базового класса &lt;em&gt;Exception&lt;/em&gt;. Мы будет автоматически генерировать исключения данного типа в тех местах, где необходимо срочное вмешательство администратора и добавим несколько методов, фильтрующих логику обработки исключений в зависимости от их типа. Итак, новый класс будет предельно простым:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 148px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; VeryImportantException : Exception&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; VeryImportantException(Exception ex) : &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;(ex.Message, ex)&lt;br&gt;    {&lt;br&gt;    }&lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;В &lt;strong&gt;global.asax&lt;/strong&gt; добавим следующие методы:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 369px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ErrorLog_Filtering(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, ExceptionFilterEventArgs e)&lt;br&gt;{&lt;br&gt;    Exception exception = e.Exception &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; VeryImportantException;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (exception != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;    {&lt;br&gt;        ErrorLog.GetDefault(HttpContext.Current).Log(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Error(exception.InnerException));&lt;br&gt;        e.Dismiss();&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ErrorMail_Filtering(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, ExceptionFilterEventArgs e)&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!(e.Exception &lt;span style=&quot;color: #0000ff&quot;&gt;is&lt;/span&gt; VeryImportantException))&lt;br&gt;        e.Dismiss();&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Данные методы помогают добавлять custom логику при обработке исключений библиотекой, вплоть до отмены обработки. В нашем же случае мы отменяем рассылку уведомлений на почту для всех исключений, кроме исключений типа &lt;em&gt;VeryImportantException&lt;/em&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Итак, благодаря возможностям библиотеки Elmah, мы реализовали все необходимые нашему приложению требования относительно логирования ошибок, вплоть до рассылки на почту особо опасных приложению исключений. Теперь, используя следующий синтаксис, мы можем контролировать блоки кода на наличие необработанных исключений, на которые в первую очередь нужно обратить внимание администратора:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; price = &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.Parse(lblPrice.Text);&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; count = &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.Parse(txtPersonCount.Text);&lt;br&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;double&lt;/span&gt; calcPrice = price / count;&lt;br&gt;}&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;br&gt;{&lt;br&gt;    ErrorSignal.FromContext(HttpContext.Current).Raise(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; VeryImportantException(ex));&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Теперь мы можем переловить опасное исключение и сообщить администратору на почту.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TSXFO5N1fcI/AAAAAAAAAL8/fDvaBYIfMQ8/s1600-h/image%5B36%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TSXFTIMCdoI/AAAAAAAAAMA/XGmeBlQnZLU/image_thumb%5B20%5D.png?imgmax=800&quot; width=&quot;782&quot; height=&quot;464&quot;&gt;&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/9079010610022377545/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2011/01/aspnet-elmah.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/9079010610022377545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/9079010610022377545'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2011/01/aspnet-elmah.html' title='Контроль исключений ASP.NET с помощью модуля Elmah'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_2odjgpkNP38/TSWdhpdPOEI/AAAAAAAAALQ/t1oYxKJLEnM/s72-c/image_thumb%5B3%5D.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-5054904127832091425</id><published>2010-12-30T23:48:00.001-08:00</published><updated>2010-12-30T23:58:36.025-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="combinig"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="ScriptManager"/><category scheme="http://www.blogger.com/atom/ns#" term="SEO"/><category scheme="http://www.blogger.com/atom/ns#" term="webdev"/><title type='text'>JavaScript combining с помощью ScriptManager контрола</title><content type='html'>&lt;p&gt;Почти любое современное web-приложение использует различные javascript-библиотеки для манипулирования данными на клиентской стороне. Будь то пользовательский файл, призванный помочь в управлении DOM-моделью на клиенте, будь то сторонняя библиотека (jQuery, Dojo, PrototypeJS и др.), будь то встроенные механизмы VisualStudio при генерации исходного html кода. Каждая библиотека – это отдельный файл на сервере, для загрузки которого браузер использует отдельный запрос. Если же на Вашей странице есть ссылки на несколько .js файлов, то загрузка по отдельности каждого файла крайне неэффективно скажется в целом на производительности web-приложения, особенно если построение DOM-модели вынуждено прервано до момента окончательной подгрузки файлов. Для пользователя данная страница будет выглядеть как частично загруженная и в подвисшем состоянии. Уж совсем некрасиво.&lt;/p&gt; &lt;p&gt;Допустим в нашем ASP.NET приложении мы имеем 3 различных javascript файла: &lt;em&gt;jscript1.js&lt;/em&gt;, &lt;em&gt;jscript2.js&lt;/em&gt;, &lt;em&gt;jscript3.js&lt;/em&gt;, в которых нам необходимы 3 функции: &lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 191px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; Execute1() {&lt;br&gt;    alert(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Execute 1&quot;&lt;/span&gt;);&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; Execute2() {&lt;br&gt;    alert(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Execute 2&quot;&lt;/span&gt;);&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; Execute3() {&lt;br&gt;    alert(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Execute 3&quot;&lt;/span&gt;);&lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;В ASP.NET для загрузки сторонних скриптов можно использовать привычный нам &lt;strong&gt;ScriptManager&lt;/strong&gt; контрол.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 161px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptManager&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Scripts&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptReference&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/Scripts/JScript1.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptReference&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/Scripts/JScript2.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptReference&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/Scripts/JScript3.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Scripts&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptManager&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Хорошо. Загрузим данную страницу и проанализируем ответ сервера на запрос к нашей странице с помощью Developer Tools в IE. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TR2KdIdAhtI/AAAAAAAAAKc/nh1SwXzfqgE/s1600-h/image%5B28%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TR2KgME7IcI/AAAAAAAAAKk/bMQnjhFD5cw/image_thumb%5B27%5D.png?imgmax=800&quot; width=&quot;592&quot; height=&quot;172&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Как видно, при запросе к серверу для получения практически ничего не делающей .aspx страницы в ответ мы получаем 7! файлов: сама .aspx страница (отмечена зеленым), 3 сгенерированные студией при компиляции проекта библиотеки и 3 пользовательских .js файла. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Если же проверить степень оптимизации нашей страницы для поисковиков с помощью утилиты &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot; target=&quot;_blank&quot;&gt;YSlow&lt;/a&gt; (разширение для &lt;a href=&quot;http://www.mozilla.com&quot; target=&quot;_blank&quot;&gt;FireFox&lt;/a&gt;), то увидим что даже пустая страница&amp;nbsp; без контента не на 100% оптимизирована. Основная проблема – много HTTP-запросов для построения контента.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TR2KireJYqI/AAAAAAAAAKs/WEGDMm665NI/s1600-h/image%5B30%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TR2Klig-uoI/AAAAAAAAAK0/a4U5CsDfrXQ/image_thumb%5B29%5D.png?imgmax=800&quot; width=&quot;586&quot; height=&quot;152&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Мощность &lt;strong&gt;ScriptManager&lt;/strong&gt; контрола в том, что множество сложных задач он позволяет делать в несколько строчек кода. Если раньше для объединения множества .js файлов необходимо было писать свои custom решения либо использовать сторонние библиотеки, такие как &lt;a href=&quot;http://mbcompression.codeplex.com&quot; target=&quot;_blank&quot;&gt;MbCompression&lt;/a&gt;, использовать сторонние модули, такие как ScriptCompressionModule и т.д., то сейчас достаточно внести необходимые для combine-инга скрипты в блок &amp;lt;&lt;strong&gt;CompositeScript&lt;/strong&gt;&amp;gt; контрола:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 193px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptManager&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;CompositeScript&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Scripts&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptReference&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/Scripts/JScript1.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptReference&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/Scripts/JScript2.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptReference&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/Scripts/JScript3.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Scripts&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;CompositeScript&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ScriptManager&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Проверим ответы сервера и качество оптимизации&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TR2KnVFjfOI/AAAAAAAAAK8/PDgeAujYq28/s1600-h/image%5B34%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TR2Kpag6dwI/AAAAAAAAALE/5StyOJ60fK4/image_thumb%5B33%5D.png?imgmax=800&quot; width=&quot;566&quot; height=&quot;122&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TR2Kqk55IpI/AAAAAAAAAJk/4aSYpRsLKUE/s1600-h/image%5B21%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TR2Ksj5E9pI/AAAAAAAAAJo/-whSqStYxqw/image_thumb%5B11%5D.png?imgmax=800&quot; width=&quot;332&quot; height=&quot;217&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Как видно количество закачанных файлов уменьшилось до 5 (3 файла были объеденены в один) и общая оценка оптимизации сменилась с B на A. А общий коэфициент оптимизации вырос с 91 до 95. Тем самым, с помощью буквально нескольких строчек мы решили довольно сложную задачу, возникающую уже в стадии SEO-оптимизации проекта – объединение множества скриптов в один.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/5054904127832091425/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2010/12/javascript-combining-scriptmanager.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/5054904127832091425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/5054904127832091425'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2010/12/javascript-combining-scriptmanager.html' title='JavaScript combining с помощью ScriptManager контрола'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2odjgpkNP38/TR2KgME7IcI/AAAAAAAAAKk/bMQnjhFD5cw/s72-c/image_thumb%5B27%5D.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-3336498210708268013</id><published>2010-08-27T04:59:00.001-07:00</published><updated>2010-08-27T05:25:08.252-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="SEO"/><title type='text'>Создание GridView-контрола в WebForms и MVC с SEO-friendly пейжингом</title><content type='html'>&lt;h3&gt;SEO-friendly пейжинг в ASP.NET webForms&lt;/h3&gt; &lt;p&gt;В предыдущем посте я описывал разные способы создания аналога контрола &amp;lt;asp:GridView /&amp;gt; средствами ASP.NET MVC. В итоге полученные результаты хоть и были более трудоемкими в создании кода, но обладали некоторыми свойствами, недоступными привычному WebForms контролу, такими как, например: &lt;em&gt;загрузка данных через AJAX-запрос, более удобное назначение стилей элементов таблицы, контроль над генерируемым кодом.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Конечно, рассмотрев несколько удачных примеров замены серверного контрола в среде WebForms на аналогичные (и даже более богатые возможностями) контролы в среде MVC, мы с ухмылкой посматриваем на старый проверенный элемент разметки страницы &amp;lt;asp:GridView runat=”server”… /&amp;gt;, подбирая в уме замену более подходящим вариантом. Но не стоит спешить выделять блок страницы и жать кнопку &amp;lt;del&amp;gt; – смогут ли решить следующую задачу найденные нами jQuery-контролы, с которой старый добрый GridView опять справляется на 5 баллов.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Итак задача. Создать таблицу с пейжингом для отображения новостей сайта. Добавить возможность перехода по пейжингу поисковым роботам, чтобы предоставить доступ к старым записям для более полной индексации ресурса.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Вроде бы ничего нового. Но… Что значит - &lt;strong&gt;Добавить возможность перехода по пейжингу поисковым роботам&lt;/strong&gt;?&lt;/p&gt; &lt;p&gt;Посещая ресурс, поисковый робот загружает только тот HTML-код, который был возвращен на запрос к сайту. Если мы используем jQuery-плагин, который загружает содержимое таблицы после загрузки основной страницы дополнительным AJAX-запросом через JavaScript-функцию, то поисковый робот получит HTML-код с пустой таблицей. &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THen-kT6ZII/AAAAAAAAAGs/qvGYvON2AfE/s1600-h/image9.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/THeoBPj1NrI/AAAAAAAAAGw/F1MotX4WJso/image_thumb5.png?imgmax=800&quot; width=&quot;806&quot; height=&quot;329&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Если же мы используем плагин, который осуществляет переход по страницам таблицы посредством вызова JavaScript-функции – поисковый робот опять-таки далее загрузки основной таблицы не пойдет. &lt;/p&gt; &lt;p&gt;Почему? Ответ простой – &lt;strong&gt;поисковые роботы не выполняют .js-код при загрузке содержимого страницы&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt;Но тут же и на время стопорится работа и при использовании привычного WebForms контрола &amp;lt;asp:GridView&amp;nbsp; /&amp;gt;, так как для перехода по страницам пейжинга он использует postback-механизм (нажатие кнопки для осуществления перехода на следующую страницу), что нарушает еще одно правило поведения робота на странице: &lt;strong&gt;поисковый робот на нежимает на кнопки&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THeoCairLWI/AAAAAAAAAG0/vjc-9jMjcmY/s1600-h/image14.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/THeoD2fvmFI/AAAAAAAAAG4/FbZI0pH-Fqc/image_thumb8.png?imgmax=800&quot; width=&quot;365&quot; height=&quot;239&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Попробуйте загрузить любую страницу интернета с помощью &lt;a href=&quot;http://www.yellowpipe.com/yis/tools/lynx/lynx_viewer.php&quot; target=&quot;_blank&quot;&gt;Lynx-браузера&lt;/a&gt; и увидите ее так, как видит ее поисковый бот. Вот пример страницы &lt;a href=&quot;http://ydobno.net&quot; target=&quot;_blank&quot;&gt;Торговой площадки Ydobno&lt;/a&gt;, отображенной с помощью lynx-браузера.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/THeoFIX9x0I/AAAAAAAAAG8/pe-sl27Yh5k/s1600-h/image18.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/THeoIa0wXpI/AAAAAAAAAHA/TXZ7wV1Rgt4/image_thumb10.png?imgmax=800&quot; width=&quot;633&quot; height=&quot;271&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Как видим – никаких стилей, никаких скриптов. Чистый текст. Отдльно от всего текста браузер выделяет список ссылок, по которым поисковой робот в дальнейшем может переходить.&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/THeoJjB0HgI/AAAAAAAAAHE/6BsV1K3tZOE/s1600-h/image22.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THeoL_aNy8I/AAAAAAAAAHI/OKDFQT-zfgQ/image_thumb12.png?imgmax=800&quot; width=&quot;529&quot; height=&quot;214&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Тем самым, только открытая ссылка на следующую страницу даст возможнсть поисковому боту ходить постранично. Все что &lt;strong&gt;требует запуска .js-функции либо нажатию непостредственно кнопки будет проигнорировано&lt;/strong&gt;. Нам необходимо иметь элементы пейжинга, непосредственно ссылающиеся на страницы. Примерно следующего вида:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/THeoOUlAt8I/AAAAAAAAAHM/yJKPYZpxXJs/s1600-h/image30.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/THeoQVBdNII/AAAAAAAAAHQ/qqD1RW4ZuUQ/image_thumb16.png?imgmax=800&quot; width=&quot;770&quot; height=&quot;141&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Хорошо, проблема ясна. Теперь можно искать ее решение. Для начала конечно же эксперементируем с нашим серверным контролом. Как упоминалось в самом начале об этом контроле – что нам снег, что нам зной, что нам пейжинг сотворить. Но, конечно, не без дополнительных манипуляций.&lt;/p&gt; &lt;p&gt;В паре с серверным контролом используем еще один контрол - &lt;strong&gt;&amp;lt;asp:DataPager runat=”server” /&amp;gt;&lt;/strong&gt;, который как раз и позволяет нам генерировать пейжинг в одном из следующих форматов: числовое отображение количества страниц (1-10, 11-20 и т.д.), переход вперед-назад, custom template пейжинг. При этом мы можем объединять варианты, получая числовые ссылки и ссылки вперед-назад по краям.&lt;/p&gt; &lt;p&gt;Итак, добавляем на страницу следующий контрол:&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:DataPager&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;DataPager1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;QueryStringField&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;page&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PagedControlID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;gvEmployee&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Fields&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:NextPreviousPagerField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;FirstPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;|&amp;amp;lt;&amp;amp;lt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowFirstPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowNextPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowPreviousPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PreviousPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;amp;lt;&amp;amp;lt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:NumericPagerField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ButtonCount&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;10&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;CurrentPageLabelCssClass&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;dataPager-current&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:NextPreviousPagerField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;LastPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;amp;gt;&amp;amp;gt;|&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowLastPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowPreviousPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowNextPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;NextPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;amp;gt;&amp;amp;gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Fields&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:DataPager&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Как мы видим, данный контрол имеет свойство &lt;strong&gt;PagedControlID&lt;/strong&gt;, которому присваиваем ID нашего грида для построения пейжинга. Одна лишь проблема, если мы запустим данный код на выполнение, то получим следующую страницу:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THeoRwfR8eI/AAAAAAAAAHU/EZoRr1ZVCBQ/s1600-h/image34.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/THeoT18QU8I/AAAAAAAAAHY/yM3fbQo52Kc/image_thumb18.png?imgmax=800&quot; width=&quot;901&quot; height=&quot;139&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Серверный контрол &amp;lt;asp:GridView …/&amp;gt; не имплементирует интерфейс &lt;strong&gt;IPageableItemContainer&lt;/strong&gt;. Для решения данной проблемы мы создаем новый класс &lt;strong&gt;DataPagerGridView&lt;/strong&gt;, унаследованный от &lt;strong&gt;GridView,&lt;/strong&gt; имплементирующий необходимый интерфейс:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 574px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #008000&quot;&gt;/// DataPagerGridView is a custom control that implements GrieView and IPageableItemContainer&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; DataPagerGridView : GridView, IPageableItemContainer&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; DataPagerGridView()&lt;br&gt;        : &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;()&lt;br&gt;    {&lt;br&gt;        PagerSettings.Visible = &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;;&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// TotalRowCountAvailable event key&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;readonly&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; EventTotalRowCountAvailable = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;();&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// Call base control&#39;s CreateChildControls method and determine the number of rows in the source &lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// then fire off the event with the derived data and then we return the original result.&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&quot;dataSource&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&quot;dataBinding&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; CreateChildControls(IEnumerable dataSource, &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; dataBinding)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; rows = &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.CreateChildControls(dataSource, dataBinding);&lt;br&gt;&lt;br&gt;        &lt;span style=&quot;color: #008000&quot;&gt;//  if the paging feature is enabled, determine the total number of rows in the datasource&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.AllowPaging)&lt;br&gt;        {&lt;br&gt;            &lt;span style=&quot;color: #008000&quot;&gt;//  if we are databinding, use the number of rows that were created, otherwise cast the datasource to an Collection and use that as the count&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; totalRowCount = dataBinding ? rows : ((ICollection)dataSource).Count;&lt;br&gt;&lt;br&gt;            &lt;span style=&quot;color: #008000&quot;&gt;//  raise the row count available event&lt;/span&gt;&lt;br&gt;            IPageableItemContainer pageableItemContainer = &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; IPageableItemContainer;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.OnTotalRowCountAvailable(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PageEventArgs(pageableItemContainer.StartRowIndex, pageableItemContainer.MaximumRows, totalRowCount));&lt;br&gt;&lt;br&gt;            &lt;span style=&quot;color: #008000&quot;&gt;//  make sure the top and bottom pager rows are not visible&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.TopPagerRow != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.TopPagerRow.Visible = &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;;&lt;br&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.BottomPagerRow != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.BottomPagerRow.Visible = &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;;&lt;br&gt;        }&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; rows;&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// Set the control with appropriate parameters and bind to right chunk of data.&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&quot;startRowIndex&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&quot;maximumRows&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&quot;databind&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; IPageableItemContainer.SetPageProperties(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; startRowIndex, &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; maximumRows, &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; databind)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; newPageIndex = (startRowIndex / maximumRows);&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.PageSize = maximumRows;&lt;br&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.PageIndex != newPageIndex)&lt;br&gt;        {&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; isCanceled = &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (databind)&lt;br&gt;            {&lt;br&gt;                &lt;span style=&quot;color: #008000&quot;&gt;//  create the event arguments and raise the event&lt;/span&gt;&lt;br&gt;                GridViewPageEventArgs args = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; GridViewPageEventArgs(newPageIndex);&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.OnPageIndexChanging(args);&lt;br&gt;&lt;br&gt;                isCanceled = args.Cancel;&lt;br&gt;                newPageIndex = args.NewPageIndex;&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            &lt;span style=&quot;color: #008000&quot;&gt;//  if the event wasn&#39;t cancelled change the paging values&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!isCanceled)&lt;br&gt;            {&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.PageIndex = newPageIndex;&lt;br&gt;&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (databind)&lt;br&gt;                    &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.OnPageIndexChanged(EventArgs.Empty);&lt;br&gt;            }&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (databind)&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.RequiresDataBinding = &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;;&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// IPageableItemContainer&#39;s StartRowIndex = PageSize * PageIndex properties&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; IPageableItemContainer.StartRowIndex&lt;br&gt;    {&lt;br&gt;        get { &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.PageSize * &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.PageIndex; }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// IPageableItemContainer&#39;s MaximumRows  = PageSize property&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; IPageableItemContainer.MaximumRows&lt;br&gt;    {&lt;br&gt;        get { &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.PageSize; }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;event&lt;/span&gt; EventHandler&amp;lt;PageEventArgs&amp;gt; IPageableItemContainer.TotalRowCountAvailable&lt;br&gt;    {&lt;br&gt;        add { &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.Events.AddHandler(DataPagerGridView.EventTotalRowCountAvailable, &lt;span style=&quot;color: #0000ff&quot;&gt;value&lt;/span&gt;); }&lt;br&gt;        remove { &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.Events.RemoveHandler(DataPagerGridView.EventTotalRowCountAvailable, &lt;span style=&quot;color: #0000ff&quot;&gt;value&lt;/span&gt;); }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&quot;e&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; OnTotalRowCountAvailable(PageEventArgs e)&lt;br&gt;    {&lt;br&gt;        EventHandler&amp;lt;PageEventArgs&amp;gt; handler = (EventHandler&amp;lt;PageEventArgs&amp;gt;)&lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.Events[DataPagerGridView.EventTotalRowCountAvailable];&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (handler != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;        {&lt;br&gt;            handler(&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;, e);&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Готово. Теперь можно добавлять custom-контрол на страницу, связывать с источником данных и с пейжинг-контролом:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;background-color: #ffff00&quot;&gt;&amp;lt;%@ Register TagPrefix=&quot;pager&quot; Namespace=&quot;WebApplication2&quot; Assembly=&quot;WebApplication2&quot; %&amp;gt;&lt;/span&gt;&lt;br&gt;...&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;pager:DataPagerGridView&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;gvEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;DataSourceID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;dsEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;AllowPaging&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:DataPager&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;DataPager1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;QueryStringField&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;page&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PagedControlID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;gvEmployee&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Fields&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:NextPreviousPagerField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;FirstPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;|&amp;amp;lt;&amp;amp;lt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowFirstPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowNextPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowPreviousPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PreviousPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;amp;lt;&amp;amp;lt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:NumericPagerField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ButtonCount&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;10&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;CurrentPageLabelCssClass&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;dataPager-current&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:NextPreviousPagerField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;LastPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;amp;gt;&amp;amp;gt;|&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowLastPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowPreviousPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowNextPageButton&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;NextPageText&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;amp;gt;&amp;amp;gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Fields&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:DataPager&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Судя по декларации DataPager-контрола имеем ссылку на предыдущую страницу в начале и на следующую страницу в конце пейжинга, а также имеет ссылки на 10 текущих страниц (поскольку у нас мало данных, то показано всего 2 страницы). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Вуаля! Получаем следующий результат:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THeoU651rXI/AAAAAAAAAHc/yDE4EUIFpB0/s1600-h/image45.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/THeoWg5MWTI/AAAAAAAAAHg/MStEXr5rBVo/image_thumb25.png?imgmax=800&quot; width=&quot;249&quot; height=&quot;335&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Отлично! Полученный результат вполне удовлетворяет нашим пожеланием относительно возможности максимально глубокого сканирования поисковым ботом содержимого сайта. И, опять таки, решение построение на базе мощного серверного контрола &lt;strong&gt;&amp;lt;asp:GridView /&amp;gt;&lt;/strong&gt; при помощи &lt;strong&gt;&amp;lt;asp:DataPager /&amp;gt;&lt;/strong&gt;. Теперь, загружая данную страницу, поисковый бот получит и список ссылок на другие страницы пейжинга, что позволит ему последовательно посетить и просканировать все элементы данной таблицы.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/h3&gt;&lt;br /&gt;&lt;h3&gt;&lt;strong&gt;SEO-friendly пейжинг в ASP.NET MVC&lt;/strong&gt;&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;К сожалению вся красота и динамичность jQuery плагинов для таблиц становятся совсем непригодными, когда нам необходимо реализовать логику построения табличных данных с пейжингом уже на сервере, чтобы поисковый робот мог загрузить текущие данные и ссылки на следующие наборы. Разработчику ставится задача не отобразить данные максимально удобно для пользователя, а передать на клиент уже хорошо сгенерированные данные.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Поскольку конечным результатом нам необходимо отобразить запрашиваемый срез данных и показать пейжинг для перехода к другим страницам контрола, то для более удобной манипуляции данными на сервере было бы хорошо использовать объект, позволюящий нам хранить лишь нужный нам в данный момент набор данных, но при этом сохраняя информацию об общем количестве объектов, как далеко мы находимся от начала набора и т.д. В процессе приготовления к данному материалу я наткнулся на реализацию данного класса на &lt;strong&gt;codeplex&lt;/strong&gt; - &lt;a href=&quot;http://pagedlist.codeplex.com/&quot; target=&quot;_blank&quot;&gt;PagedList&amp;lt;T&amp;gt;&lt;/a&gt; (либо же можно найти похожую реализацию &lt;a href=&quot;http://blog.wekeroad.com/2007/12/10/aspnet-mvc-pagedlistt/&quot; target=&quot;_blank&quot;&gt;на этом блоге&lt;/a&gt;). Для работы с данными в веб-ориентированных проектах данный класс будет крайне пригодным, так как позволяет превратить любой объект, наследуемый от &lt;strong&gt;IEnumerable&lt;/strong&gt;, в объект &lt;strong&gt;PagedList&lt;/strong&gt;, благодаря которому можно получить много полезной информации о наборе данных: первая ли это страница из всего набора, последняя ли это страница, общее количество данных, количество данных в отображаемой наборе и т.д.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Для отображения данных на страницу создадим отдельный HtmlHelper-метод – &lt;strong&gt;GridView&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; GridViewExtensions&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; GridView&amp;lt;T&amp;gt;(&lt;br&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt; HtmlHelper html,&lt;br&gt;         PagedList&amp;lt;T&amp;gt; data,&lt;br&gt;         Action&amp;lt;PagedList&amp;lt;T&amp;gt;&amp;gt; headerTemplate,&lt;br&gt;         Action&amp;lt;T, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; itemTemplate,&lt;br&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; cssClass,&lt;br&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; cssAlternatingClass,&lt;br&gt;         Action&amp;lt;PagedList&amp;lt;T&amp;gt;&amp;gt; footerTemplate,&lt;br&gt;         Action&amp;lt;PagedList&amp;lt;T&amp;gt;&amp;gt; paging)&lt;br&gt;    {&lt;br&gt;        headerTemplate(data);&lt;br&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; data.Count; i++)&lt;br&gt;        {&lt;br&gt;            var item = data[i];&lt;br&gt;            itemTemplate(item, (i % 2 == 0 ? cssClass : cssAlternatingClass));&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        footerTemplate(data);&lt;br&gt;        paging(data);&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Чтобы жестко не прописывать логику генерации кода контрола, а сделать его универсальным для отображения разных табличных данных – прибегаем к использованию &lt;em&gt;Action&lt;/em&gt;-методов (чтобы не загружать наш контрол делегатными функциями), логику работы которых мы будем индивидуально прописывать в шаблоне &lt;strong&gt;View&lt;/strong&gt;. Конечно это заставит нас писать больше кода для каждого View, в котором мы будем использовать данный контрол, поэтому для полного комфорта было бы хорошо ввести два контрола – один с широкими возможностями для изменения внешнего вида, второй – построение единого шаблона отображения, но и требующего написания меньше кода. Остановимся пока на первом варианте.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Создаем новый strongly-typed view и вводим следующий тип (он не будет присутствовать в выпадающем списке) -&lt;strong&gt;PagedList&amp;lt;EmployeeModel&amp;gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/THeoYU2NExI/AAAAAAAAAHk/_qkK1Z0H4xg/s1600-h/image10.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THeoaNHADKI/AAAAAAAAAHo/zKI80l8Wwgo/image_thumb4.png?imgmax=800&quot; width=&quot;365&quot; height=&quot;359&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Добавляем следующий код на страницу:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; color: black&quot;&gt;&lt;pre&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt; Html.GridView&amp;lt;MvcApplication1.Models.EmployeeModel&amp;gt;(&lt;br /&gt;    &lt;span style=&quot;color: blue&quot;&gt;this&lt;/span&gt;.ViewData.Model,&lt;br /&gt;    data =&amp;gt;&lt;br /&gt;    { &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;table&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;grid&quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;cellpadding&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;cellspacing&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt; },&lt;br /&gt;    (item, css) =&amp;gt;&lt;br /&gt;    { &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;tr&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;&amp;lt;%=css%&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%=&lt;/span&gt;item.EmployeeID&lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%=&lt;/span&gt;item.FirstName&lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%=&lt;/span&gt;item.LastName&lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt; },&lt;br /&gt;    &lt;span style=&quot;color: #a31515&quot;&gt;&quot;item&quot;&lt;/span&gt;,&lt;br /&gt;    &lt;span style=&quot;color: #a31515&quot;&gt;&quot;item-alternating&quot;&lt;/span&gt;,&lt;br /&gt;    data =&amp;gt;&lt;br /&gt;    { &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt; &lt;br /&gt;        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt; },&lt;br /&gt;    data =&amp;gt; &lt;br /&gt;    { &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt; &lt;br /&gt;        &lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%=&lt;/span&gt; Html.Pager(Model, &lt;span style=&quot;color: #a31515&quot;&gt;&quot;/Employee/GetList&quot;&lt;/span&gt;)&lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt;}); &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; color: black&quot;&gt;Необходимо разобрать более детально этот код для лучшего его понимания.&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Для генерации табличного контрола мы создали статический html-helper метод GridView, в который в нужной последовательности необходимо передать данные, согласно декларации метода. Хотелось бы сильнее обратить внимание на следующую запись:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; color: black&quot;&gt;&lt;pre&gt;data =&amp;gt;&lt;br /&gt;{ %&amp;gt;&lt;br /&gt;     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;table&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;grid&quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;cellpadding&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;cellspacing&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;% },&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;согласно декларации метода в классе третьим параметором мы должны были передать Action-метод&lt;/p&gt;&lt;pre class=&quot;csharpcode&quot;&gt;...&lt;br /&gt;Action&amp;lt;PagedList&amp;lt;T&amp;gt;&amp;gt; headerTemplate&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Как Action-метод может быть заменен такой конструкцией? Сначала необходимо разобраться что из себя представляет класс Action и как серверный код превращается в html-код. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Начнем со второго вопроса. Не задумывались ла Вы, почему компилятор при компиляции страницы указывает лишь об ошибках внутри серверных блоков (&amp;lt;% %&amp;gt;, &amp;lt;%= %&amp;gt;), но пропускает любое упоминание об ошибке в записи Html-тега например? Все очень просто: для компилятора все что внутри серверных блоков – это инструкции для выполнения, все что за пределами – это строки текста, которые просто надо вывести на страницу. Представим что мы имеем следующую декларацию на странице:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; color: black&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ul&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: blue&quot;&gt;int&lt;/span&gt; i=1; i&amp;lt;=3; i++) { &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%=&lt;/span&gt; i &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow&quot;&gt;&amp;lt;%&lt;/span&gt; } &lt;span style=&quot;background-color: yellow&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ul&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;При компиляции страницы в сборку данный код будет выглядеть приблизительно так:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;Response.Write(&lt;span style=&quot;color: #006080&quot;&gt;&quot;&amp;lt;ul&amp;gt;&quot;&lt;/span&gt;);&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; i=1; i&amp;lt;=3; i++) &lt;br&gt;{&lt;br&gt;    Response.Write(&lt;span style=&quot;color: #006080&quot;&gt;&quot;&amp;lt;li&amp;gt;&quot;&lt;/span&gt;);&lt;br&gt;    Response.Write(i);&lt;br&gt;    Response.Write(&lt;span style=&quot;color: #006080&quot;&gt;&quot;&amp;lt;/li&amp;gt;&quot;&lt;/span&gt;);&lt;br&gt;}&lt;br&gt;Response.Write(&lt;span style=&quot;color: #006080&quot;&gt;&quot;&amp;lt;/ul&amp;gt;&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Именно поэтому компилятор не показывает сообщение об ошибке записи тега, как как для него – это обычный блок текста, который необходимо вывести в output-поток согласно своей позиции.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Что же такое Action-методы? Объекты данного класса используются для замены делегатов-функций определенного синтаксиса – принимают один параметр и на выходе не возвращают ничего (void). К тому же Action-методы позволяют задавать декларации с использованием анонимных функций и лямбда-выражений. Следующий код демонстрирует простой пример использования Action-метода для замены делегатов.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; Main()&lt;br&gt;{&lt;br&gt;   Action&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; messageTarget; &lt;br&gt;   messageTarget = s =&amp;gt; ShowWindowsMessage(s); &lt;br&gt; &lt;br&gt;   messageTarget(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;);&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ShowWindowsMessage(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; message)&lt;br&gt;{&lt;br&gt;   MessageBox.Show(message);      &lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;В нашем же примере мы используем тоже анонимные функции и лямбда-выражение для декларации Action-метода. &lt;br /&gt;&lt;p&gt;В итоге, наш код &lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;data =&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;{ &lt;span style=&quot;background-color: #ffff00&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;table&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;grid&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;cellpadding&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;cellspacing&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;background-color: #ffff00&quot;&gt;&amp;lt;%&lt;/span&gt; },&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;можно превратить в следующую аналогичную запись:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;delegate&lt;/span&gt;(PagedList&amp;lt;T&amp;gt; data) { Response.Write(&lt;span style=&quot;color: #006080&quot;&gt;&quot;&amp;lt;table class=&#39;grid&#39; cellpadding=&#39;0&#39; cellspacing=&#39;0&#39;&amp;gt;&quot;&lt;/span&gt;); },&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Хорошо,&amp;nbsp; детально разобрали декларацию нового &lt;em&gt;HtmlHelper&lt;/em&gt;-метода &lt;strong&gt;GridView&lt;/strong&gt;. Но, как видно, для отображения пейжинга на странице используем еще один HtmlHelper-метод – &lt;strong&gt;Pager&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Я не буду вдаваться в детали его реализации – более детально можно &lt;a href=&quot;http://www.forkcan.com/viewcode/216/PagedList-class-and-paging-code-for-ASPNet-MVC--Nothing-new-but-kind-of-usefull-&quot; target=&quot;_blank&quot;&gt;почитать на этом ресурсе&lt;/a&gt;. Одно лишь замечу, что в качестве источника данных для построения пейжинга данный контрол использует объект реализованного выше класса &lt;em&gt;PagedList&lt;/em&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;После компиляции мы получил следующий результат:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/THeobURK1yI/AAAAAAAAAHs/XAfrrl6a70E/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/THeodUOnAQI/AAAAAAAAAHw/2sh5ygzhmLQ/image_thumb%5B1%5D.png?imgmax=800&quot; width=&quot;334&quot; height=&quot;362&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Если просмотреть html-код, то видим, что весь контент присутствует и ссылки на месте. Это значит, что при загрузке данной страницы поисковым роботом, он получит всю информацию для индексации.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Отлично, поставленная задача опять выполнена, хотя и потребовалось много дополнительной ручной работы – создать дополнительные контролы и дополнительные классы для оперирования данными. Но при этом опять с лучшим результатом, чем для серверного контрола &lt;strong&gt;&amp;lt;asp:GridView runat=”server” /&amp;gt;&lt;/strong&gt;, а именно получили ссылку без параметров строки (&lt;em&gt;article.aspx?Id=2&lt;/em&gt;, как в примере с WebForms), а полноценную ссылку. В этом случае поисковики больше доверяют ссылке без параметров строки.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Для упрощения работы с созданием табличных контролов можно посоветовать использовать контролы сторонних разработчиков. Для примера компания &lt;strong&gt;Telerik&lt;/strong&gt; предлагает удобный Grid-контрол для MVC. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/THeoe1-3SdI/AAAAAAAAAH0/GvlllR3_LPU/s1600-h/image%5B7%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/THeohDthoYI/AAAAAAAAAH4/nuPdnPx2HTw/image_thumb%5B3%5D.png?imgmax=800&quot; width=&quot;478&quot; height=&quot;241&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Примеры его использования можно посмотреть &lt;a href=&quot;http://demos.telerik.com/aspnet-mvc/grid&quot; target=&quot;_blank&quot;&gt;здесь&lt;/a&gt;.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/3336498210708268013/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2010/08/gridview-webforms-mvc-seo-friendly.html#comment-form' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/3336498210708268013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/3336498210708268013'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2010/08/gridview-webforms-mvc-seo-friendly.html' title='Создание GridView-контрола в WebForms и MVC с SEO-friendly пейжингом'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2odjgpkNP38/THeoBPj1NrI/AAAAAAAAAGw/F1MotX4WJso/s72-c/image_thumb5.png?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-598553959520816787</id><published>2010-07-30T00:04:00.001-07:00</published><updated>2010-08-27T05:32:33.967-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><title type='text'>GridView в MVC - jQuery плагины для манипуляции с табличными данными</title><content type='html'>&lt;p&gt;Не секрет, что важным правилом для любого уважающего себя веб-мастера является - избегать использование тегов &amp;lt;table&amp;gt;&amp;lt;/table&amp;gt; для построения интерфейса пользователя. В то же время нет более подходящего набора элементов, чем &amp;lt;table&amp;gt;,&amp;lt;th&amp;gt;, &amp;lt;tr&amp;gt;, &amp;lt;td&amp;gt; для структурирования и удобного отображения табличных данных. &lt;/p&gt; &lt;p&gt;Простота генерации табличного контента и возможность назначения CSS-стилей заглавным строкам либо же строкам данных делает этот тег незаменимым при отображении значений, полученных из источников данных. Но простота использования – и преимущество и недостаток данного тега. Если же встает необходимость отображать большие объемы данных, требующие разбиение на страницы, сортировку или фильтрацию - необходимо всю эту логику реализовывать самостоятельно либо же прибегать к компонентам сторонних разработчиков.&lt;/p&gt; &lt;p&gt;Данная статья как раз и поможет подобрать наиболее подходящий компонент для генерации и манипулирования табличными данными.&lt;/p&gt; &lt;p&gt;Для сравнения возмем привычный серверный компонент для ASP.NET WebForms - &amp;lt;asp:GridView&amp;gt;, позволяющий очень просто отобразить табличные данные на странице.&lt;/p&gt; &lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;asp:GridView&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;gvEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;DataSourceID&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;dsEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;asp:SqlDataSource&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;dsEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum4&quot; style=&quot;color:#606060;&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color:#ff0000;&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;&amp;lt;%$ ConnectionStrings:NorthwindConnectionString %&amp;gt;&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum5&quot; style=&quot;color:#606060;&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color:#ff0000;&quot;&gt;SelectCommand&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;SELECT [EmployeeID], [FirstName], [LastName] FROM [Employees]&quot;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum6&quot; style=&quot;color:#606060;&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;asp:SqlDataSource&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;В результате получим следующий контент на странице:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TFhSQOdPv6I/AAAAAAAAAFU/2HEH7oxHfzk/s1600-h/image2.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSR8VmiSI/AAAAAAAAAFY/IVwFjSOv4lA/image_thumb.png?imgmax=800&quot; width=&quot;219&quot; height=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;За простой записью декларации скрываются сложные механизмы рендеринга контента, получения данных из источника данных, привязки данных к контролу для последующего отображения. Прелесть WebForms для начинающего программиста в том, что сложное может создаваться простой декларацией на странице. Сложные механизмы авторизации можно добавлять к сайту, не вникая в детали их работы; отображение вложенности страниц легко создается простой декларацией .sitemap-файла и многое другое. Для ASP.NET MVC многие тривиальные задачи для WebForms могут превратится в сложные нетривиальные задачи, требующие глубокого освоения клиентских и серверных языков. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;На примере все же данной статьи хотелось бы проверить – насколько сложно будет повтрорить огромную функциональность серверного контрола &amp;lt;asp:GridView /&amp;gt;в рамках модели MVC.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Хорошо, просто отобразить табличные данные подобно примеру выше не составляет особого труда – выводим их на страницу с помощью &lt;strong&gt;foreach&lt;/strong&gt;-перебора.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; height: 298px; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;    &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;        &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;EmployeeID&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;        &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;FirstName&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;        &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;LastName&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;    &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;% foreach (&lt;span style=&quot;color:#0000ff;&quot;&gt;var&lt;/span&gt; item in Model) { %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;    &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;        &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.EmployeeID&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;        &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.FirstName&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;        &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.LastName&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;    &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;% } %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Получаем похожий результат:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TFhSSyMbIHI/AAAAAAAAAFc/Uub23R9j5Ac/s1600-h/image5.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TFhSUf6xWnI/AAAAAAAAAFg/49kTp8HI_4w/image_thumb11.png?imgmax=800&quot; width=&quot;204&quot; height=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Вполне приемлемый результат. К тому же в этом примере мы имеем полный контроль над генерируемым кодом, так как сами определяем структуру таблицы. Тем самым задаем стили отображения таблицы просто, без особого штудирования MSDN (как в примере с &amp;lt;asp:GridView /&amp;gt;)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;В реальных приложениях зачастую выводить все содержимое таблицы нецелесообразно, особенно если число записей исчисляется сотнями и тысячами. В этом случае необходимо добавлять пейжинг и выводить лишь небольшую часть данных.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Привычный контрол &amp;lt;asp:GridView&amp;gt; справляется с этой задачей на все 100% без особых усилий – добавляем лишь пару атрибутов:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;asp:GridView&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;gvEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;DataSourceID&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;dsEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;&lt;strong&gt;AllowPaging&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;PageSize&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;5&quot;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Результат:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TFhSVespDcI/AAAAAAAAAFk/eU5FT61hEd8/s1600-h/image8.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TFhSW0tf0UI/AAAAAAAAAFo/EpejlzbeFDI/image_thumb2.png?imgmax=800&quot; width=&quot;244&quot; height=&quot;164&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;MVC-модель в свою очередь заствляет разработчика остановится на данном этапе, откинуться на спинку кресла и предаться размышлениям. Увы, столь простого механизма нету. Делаем чай, ходим по комнате, внимательно протирая глазами дырку в полу – таки да, столь простого механизма нету.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Ну что же – самому реализовывать логику пейжинга слишком лениво, в то время как много плагинов сторонних разработчиков присутствует в сети. Врезультате несложно поиска выделяем для себя сразу несколько компонентов, чтобы сравнивать функциональность.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.datatables.net/&quot; target=&quot;_blank&quot;&gt;DataTables&lt;/a&gt; – плагин для библиотеки jQuery. Чем особенно интересен плагин, так это возможностью делать гибкую таблицу с пейжингом, сортировками и т.д. из уже сгенерированного кода. Точнее – сначала мы генерируем таблицу, а потом используем плагин для придания этой таблице необходимых нам свойств.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Попробуем на примере.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Подключаем .js библиотеки:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&amp;lt;script src=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;../../Scripts/jquery-1.4.1.min.js&quot;&lt;/span&gt; type=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script src=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;../../Scripts/jquery.dataTables.min.js&quot;&lt;/span&gt; type=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Создаем таблицу:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;table&lt;/span&gt; id=&quot;tblEmployees&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;thead&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;           &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;EmployeeID&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;           &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;FirstName&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;           &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;LastName&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;thead&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tbody&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;% foreach (&lt;span style=&quot;color:#0000ff;&quot;&gt;var&lt;/span&gt; item in Model) { %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;           &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;               &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.EmployeeID&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;               &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.FirstName&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;               &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.LastName&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;           &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;% } %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tbody&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Обязательно необходимо полно описывать структуру данных, используя теги &amp;lt;thead&amp;gt;, &amp;lt;tbody&amp;gt; – данный плагин использует их для разбиения на заголовок и контент. Пропустив теги &amp;lt;thead&amp;gt; и &amp;lt;tbody&amp;gt;, мы получим ошибку выполнения функции скрипта.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Добавляем следущий код на страницу:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;   $(document).ready(&lt;span style=&quot;color:#0000ff;&quot;&gt;function&lt;/span&gt; () {&lt;br /&gt;       $(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;#tblEmployees&quot;&lt;/span&gt;).dataTable();&lt;br /&gt;   });&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Немного корректируем стили отображения элементов:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;style&lt;/span&gt; type=&quot;text/css&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;   #tblEmployees_wrapper { &lt;span style=&quot;color:#0000ff;&quot;&gt;border&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;solid 2px #a4a4a4;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;width&lt;/span&gt;:450px }&lt;br /&gt;   #tblEmployees_length { &lt;span style=&quot;color:#0000ff;&quot;&gt;float&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;left;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;:5px 30px 5px 5px }&lt;br /&gt;   #tblEmployees_filter { &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;5px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;background-color&lt;/span&gt;:#d4d4d4 }&lt;br /&gt;   #tblEmployees_info { &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;5px 30px 5px 5px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;background-color&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;#d4d4d4;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;float&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;left;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;font-size&lt;/span&gt;:10px }&lt;br /&gt;   #tblEmployees_paginate { &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;5px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;background-color&lt;/span&gt;:#d4d4d4 }&lt;br /&gt;   #tblEmployees_paginate &lt;span style=&quot;color:#0000ff;&quot;&gt;span&lt;/span&gt; { &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;2px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;font-size&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;11px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;color&lt;/span&gt;:#474d7c }&lt;br /&gt;   #tblEmployees_paginate &lt;span style=&quot;color:#0000ff;&quot;&gt;span&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.paginate_button&lt;/span&gt; { &lt;span style=&quot;color:#0000ff;&quot;&gt;cursor&lt;/span&gt;:pointer }&lt;br /&gt;   #tblEmployees_paginate &lt;span style=&quot;color:#0000ff;&quot;&gt;span&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.paginate_button&lt;/span&gt;:hover { &lt;span style=&quot;color:#0000ff;&quot;&gt;text-decoration&lt;/span&gt;:underline }&lt;br /&gt;   #tblEmployees_paginate &lt;span style=&quot;color:#0000ff;&quot;&gt;span&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.paginate_active&lt;/span&gt; { &lt;span style=&quot;color:#0000ff;&quot;&gt;font-weight&lt;/span&gt;:bold }&lt;br /&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;И получаем следующий результат:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSYCBlysI/AAAAAAAAAFs/hLuH9Y4pmTQ/s1600-h/image161.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TFhSZtVdHPI/AAAAAAAAAFw/QCVmFqHVrUA/image_thumb6.png?imgmax=800&quot; width=&quot;368&quot; height=&quot;275&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Превосходно. И при этом совсем минимум дополнительного кода, а на выходе – разбиение на страницы, сортировка по убыванию-возрастанию каждой колонки, выбор количества выводимых элементов на страницу, поиск. И самое важное – построили этот контрол на базе обычной таблицы.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://tablesorter.com/&quot; target=&quot;_blank&quot;&gt;TableSorter&lt;/a&gt; – также плагин к популярной JavaScript-библиотеки jQuery, который превращает стандартную таблицу с тегами THEAD и TBODY в удобный контрол с возможностью сортировки по колонкам без перезагрузки страницы.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Пробуем на примере:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Подключаем необходимые библиотеки&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt; src=&quot;../../Scripts/jquery-1.4.1&lt;span style=&quot;color:#cc6633;&quot;&gt;.min&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.js&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt; src=&quot;../../Scripts/jquery&lt;span style=&quot;color:#cc6633;&quot;&gt;.tablesorter&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.min&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.js&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt; src=&quot;../../Scripts/jquery&lt;span style=&quot;color:#cc6633;&quot;&gt;.tablesorter&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.pager&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.js&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Последняя библиотека необходима для придания нашей таблице возможностей пейжинга.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Генерируем таблицу предыдущим способом:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;table&lt;/span&gt; id=&quot;tblEmployees&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;thead&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt;         &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum4&quot; style=&quot;color:#606060;&quot;&gt;   4:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;EmployeeID&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum5&quot; style=&quot;color:#606060;&quot;&gt;   5:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;FirstName&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum6&quot; style=&quot;color:#606060;&quot;&gt;   6:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;LastName&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum7&quot; style=&quot;color:#606060;&quot;&gt;   7:&lt;/span&gt;         &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum8&quot; style=&quot;color:#606060;&quot;&gt;   8:&lt;/span&gt;     &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;thead&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum9&quot; style=&quot;color:#606060;&quot;&gt;   9:&lt;/span&gt;     &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tbody&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum10&quot; style=&quot;color:#606060;&quot;&gt;  10:&lt;/span&gt;         &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;% foreach (&lt;span style=&quot;color:#0000ff;&quot;&gt;var&lt;/span&gt; item in Model) { %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum11&quot; style=&quot;color:#606060;&quot;&gt;  11:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum12&quot; style=&quot;color:#606060;&quot;&gt;  12:&lt;/span&gt;                 &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.EmployeeID&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum13&quot; style=&quot;color:#606060;&quot;&gt;  13:&lt;/span&gt;                 &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.FirstName&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum14&quot; style=&quot;color:#606060;&quot;&gt;  14:&lt;/span&gt;                 &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;%= Html&lt;span style=&quot;color:#cc6633;&quot;&gt;.Encode&lt;/span&gt;(item&lt;span style=&quot;color:#cc6633;&quot;&gt;.LastName&lt;/span&gt;) %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum15&quot; style=&quot;color:#606060;&quot;&gt;  15:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tr&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum16&quot; style=&quot;color:#606060;&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;% } %&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum17&quot; style=&quot;color:#606060;&quot;&gt;  17:&lt;/span&gt;     &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;tbody&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum18&quot; style=&quot;color:#606060;&quot;&gt;  18:&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Добавляем следующий код на страницу:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt; $(&lt;span style=&quot;color:#0000ff;&quot;&gt;function&lt;/span&gt; () {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt;     $(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;#tblEmployees&quot;&lt;/span&gt;).tablesorter({ widthFixed: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt; }).tablesorterPager({ container: $(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;#pager&quot;&lt;/span&gt;) });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt; });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;и изменяем стиль отображения контрола:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt; #tblEmployees &lt;span style=&quot;color:#0000ff;&quot;&gt;th&lt;/span&gt; { &lt;span style=&quot;color:#0000ff;&quot;&gt;text-align&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;left;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;5px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;#6E6E6E;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;color&lt;/span&gt;:&lt;span style=&quot;color:#006080;&quot;&gt;#ffffcc;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;cursor&lt;/span&gt;:pointer }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt; #tblEmployees &lt;span style=&quot;color:#0000ff;&quot;&gt;td&lt;/span&gt; { &lt;span style=&quot;color:#0000ff;&quot;&gt;color&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;#FFF;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;padding&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;5px;&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt; #tblEmployees { &lt;span style=&quot;color:#0000ff;&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;12px;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;#4D4D4D;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;border&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;1px solid #000;&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum4&quot; style=&quot;color:#606060;&quot;&gt;   4:&lt;/span&gt; #pager &lt;span style=&quot;color:#cc6633;&quot;&gt;.pagedisplay&lt;/span&gt; { &lt;span style=&quot;color:#0000ff;&quot;&gt;width&lt;/span&gt;:50px }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;На выходе получаем следующий результат:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSafJ8NxI/AAAAAAAAAF0/C44EUnq7mMI/s1600-h/image31.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TFhScWcT7LI/AAAAAAAAAF4/IFhGg0-aA1w/image_thumb1.png?imgmax=800&quot; width=&quot;239&quot; height=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Как видим – полученный результат вполне удовлетворяет нашим потребностям: пейжинг, сортировка по колонкам.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;После непродолжительных поисков в сети находим еще несколько плагинов, подходящих для построения удобных таблиц с дополнительными возможностями: сортировка, пейжинг.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://flexigrid.info/&quot; target=&quot;_blank&quot;&gt;FlexiGrid&lt;/a&gt; – легкий, но богатый функциональностью плагин для создания таблиц с пейжингом, сортировками и возможностью подключаться к внешним источникам данных с помощью AJAX-запросов.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TFhSeU4y-xI/AAAAAAAAAF8/xUq48iqktlo/s1600-h/image11.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh4.ggpht.com/_2odjgpkNP38/TFhSf6q81wI/AAAAAAAAAGA/0q3eobfFxCc/image_thumb5.png?imgmax=800&quot; width=&quot;439&quot; height=&quot;202&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://reconstrukt.com/ingrid/&quot; target=&quot;_blank&quot;&gt;Ingrid&lt;/a&gt; – еще один интересный jQuery плугин для придания таблицам свойств: сортировка, пейжниг, назначение стилей таблицам, колонкам, подгрузка данных с помощью AJAX-запросов и многое другое.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TFhSitOSgrI/AAAAAAAAAGE/4RVPfjYHn68/s1600-h/image16.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSlH7JTkI/AAAAAAAAAGI/GeKXyhNkXt4/image_thumb8.png?imgmax=800&quot; width=&quot;572&quot; height=&quot;252&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://neoalchemy.org/tablePagination.html&quot; target=&quot;_blank&quot;&gt;TablePagination&lt;/a&gt; – очень простой jQuery плагин, добавляющий возможности пейжинга к существующей таблице.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG5rWfVpRlNzZWy_kSSbP2sVVnxGaPU1Q1rZtkW8Y3Zi65gxNiL4echEOOZYWHiI8ASwQHAnSaWivU9k7gxFwybpbVaIb9fpy-yeaWvzqpYEsLxRIp_E6roljQOV_nsNzQVUNVum9qo58/s1600-h/image42.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSn3UWOGI/AAAAAAAAAGQ/1_ZwFJpHMD8/image_thumb32.png?imgmax=800&quot; width=&quot;280&quot; height=&quot;163&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Итак, судя по анализу, существует несколько способов создать MVC-контрол, аналогичный WebForms контролу – asp:GridView. Но не полноценный аналог, а лишь повторяющий некоторую функциональность данного контрола – сортировка по столбцам, пейжинг.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;В реальных приложениях, обрабатывающих большие массивы данных, загрузка всего контента на страницу для последующего построения удобной таблицы с пейжингом – это явно нехороший тон программирования. Большая загрузка сервера для вычитки всех данных, большая загрузка сервера приложений для построения страницы, загрузка сети для передачи больших объемов данных, увеличенное время ожидания пользователем загрузки и генерации страницы браузером. Все эти негативные моменты заставляют разработчиков использовать другие методы для построения страницы – подгрузка только определенного среза данных, в зависимости от запроса.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Вышеупомянутый WebForms серверный контрол – asp:GridView и в этом случае радуем программиста, так как имеет механизмы для отображения только небольшого объема данных с возможностью подгружать новые, переходя по страницам пейжинга. Для этого необходимо в качестве источника данных использовать контрол:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;asp:ObjectDataSource&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;odsEmployee&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;SelectMethod&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;GetAll&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;SelectCountMethod&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;GetTotalCount&quot;&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;TypeName&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;Employee&quot;&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;и реализовав 2 метода для получения теущего набора данных и общего количесва данных:&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;static&lt;/span&gt; List&amp;lt;Employee&amp;gt; GetAll()&lt;br /&gt;{&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;int&lt;/span&gt; GetTotalCount()&lt;br /&gt;{&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;можно подгружать только отображаемые в данных момент данные, а переходя по страницам пейжинга, подгружать новые.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Попробуем создать подобный контрол для ASP.NET MVC. Задача – загружать только те данные, которые пользователь просматривает в данный момент и подгружать по мере необходимости новые.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Сканируя документацию по вышеперчесленным jQuery-плагинам, находим следующие полезные возможности:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.datatables.net/&quot; target=&quot;_blank&quot;&gt;DataTables&lt;/a&gt; – возможность задавать конструктору локальный набор данных в виде JSON-объекта, либо URL – который возвращает JSON-объект. Используем данный плагин для создания контрола, отображающего только запрашиваемые в данный момент данные, не подгружая при этом ничего лишнего.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Редактируем существующий javascript-код на странице:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;script&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;text/javascript&quot;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt;     $(document).ready(&lt;span style=&quot;color:#0000ff;&quot;&gt;function&lt;/span&gt; () {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt;         $(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;#tblEmployees&quot;&lt;/span&gt;).dataTable({ &lt;span style=&quot;color:#006080;&quot;&gt;&quot;sPaginationType&quot;&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;&quot;full_numbers&quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum4&quot; style=&quot;color:#606060;&quot;&gt;   4:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&quot;bProcessing&quot;&lt;/span&gt;: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum5&quot; style=&quot;color:#606060;&quot;&gt;   5:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&quot;bServerSide&quot;&lt;/span&gt;: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum6&quot; style=&quot;color:#606060;&quot;&gt;   6:&lt;/span&gt;             &lt;span style=&quot;color:#006080;&quot;&gt;&quot;sAjaxSource&quot;&lt;/span&gt;: &lt;span style=&quot;color:#006080;&quot;&gt;&quot;../Employee/GetAllEmployees&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum7&quot; style=&quot;color:#606060;&quot;&gt;   7:&lt;/span&gt;         });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum8&quot; style=&quot;color:#606060;&quot;&gt;   8:&lt;/span&gt;     });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;В конструкторе плагина мы указываем, что собираемся получать данные для построения таблицы из сервера и задаем URI для получения JSON-объекта.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;В контроллере Employee создаем новый метод – GetAllEmployees:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public&lt;/span&gt; JsonResult GetAllEmployees()&lt;br /&gt;{&lt;br /&gt;   &lt;span style=&quot;color:#008000;&quot;&gt;//загружаем всех Employee. Если хотим совсем правильно делать, то создаем процедуру, возвращающую&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color:#008000;&quot;&gt;//только запрашиваемый в данный момент набор&lt;/span&gt;&lt;br /&gt;   var data = EmployeeModel.GetAll();&lt;br /&gt;&lt;br /&gt;   &lt;span style=&quot;color:#008000;&quot;&gt;//получаем текущее состояние пейжинга&lt;/span&gt;&lt;br /&gt;   var start = &lt;span style=&quot;color:#0000ff;&quot;&gt;int&lt;/span&gt;.Parse(Request.QueryString[&lt;span style=&quot;color:#006080;&quot;&gt;&quot;iDisplayStart&quot;&lt;/span&gt;]);&lt;br /&gt;&lt;br /&gt;   &lt;span style=&quot;color:#008000;&quot;&gt;//количество отображаемых элементов на странице&lt;/span&gt;&lt;br /&gt;   var pageCount = &lt;span style=&quot;color:#0000ff;&quot;&gt;int&lt;/span&gt;.Parse(Request.QueryString[&lt;span style=&quot;color:#006080;&quot;&gt;&quot;iDisplayLength&quot;&lt;/span&gt;]);&lt;br /&gt;&lt;br /&gt;   var json = &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; { iTotalRecords = pageCount, iTotalDisplayRecords = data.Count, aaData = (from d &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; data.Skip(start).Take(pageCount) select &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt;[] { d.EmployeeID.ToString(), d.FirstName, d.LastName }) };&lt;br /&gt;   &lt;span style=&quot;color:#0000ff;&quot;&gt;return&lt;/span&gt; Json(json, JsonRequestBehavior.AllowGet);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Готово! Теперь при загрузке страницы изначально получаем дружественную надпись, что данные загружаются&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSo9YWeiI/AAAAAAAAAGU/NSQ955G7_mM/s1600-h/image%5B4%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/_2odjgpkNP38/TFhSqmf-jNI/AAAAAAAAAGY/PRc67siWv6g/image_thumb%5B2%5D.png?imgmax=800&quot; width=&quot;409&quot; height=&quot;90&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;после чего генерируется привычная нам таблица данных:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSr6oqZEI/AAAAAAAAAGc/dtB5wSv39U8/s1600-h/image%5B8%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_2odjgpkNP38/TFhSuKNOtrI/AAAAAAAAAGg/IieuQg9Jkg8/image_thumb%5B4%5D.png?imgmax=800&quot; width=&quot;392&quot; height=&quot;311&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Сперва я пытался сделать, чтобы URI для получения данных для плагина был ссылкой на веб-метод, но никак не мог добится того, чтобы объект получился в JSON-формате. Даже задавая атрибут &lt;strong&gt;[ScriptMethod(ResponseFormat=ResponseFormat.Json)] &lt;/strong&gt;в результате получал XML-файл. Возможно кто-то подскажет мне – в чем я недоглядел :). &lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Далее на глаза попадается очень интересный плагин для построения мощных таблиц – &lt;a href=&quot;http://flexigrid.info/&quot; target=&quot;_blank&quot;&gt;FlexiGrid&lt;/a&gt;. Пропускаем примеры создания таблиц с возможностями пейжинга и сортировки по столбцам и штудирую документацию по AJAX-подгрузке данных и генерации таблицы на лету. Очень полезна в освоении данного плагина &lt;a href=&quot;http://www.codeproject.com/KB/aspnet/MVCFlexigrid.aspx&quot; target=&quot;_blank&quot;&gt;статьюя на CodeProject&lt;/a&gt; – советую посмотреть.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Итак, добавляем в проект нужные библиотеки:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt; src=&quot;../../Scripts/jquery-1.4.1&lt;span style=&quot;color:#cc6633;&quot;&gt;.min&lt;/span&gt;&lt;span style=&quot;color:#cc6633;&quot;&gt;.js&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt; src=&quot;../../Scripts/flexigrid&lt;span style=&quot;color:#cc6633;&quot;&gt;.js&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;link&lt;/span&gt; href=&quot;../../Content/flexigrid&lt;span style=&quot;color:#cc6633;&quot;&gt;.css&lt;/span&gt;&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&lt;span style=&quot;color:#006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Помещаем следующий код на страницу:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; height: 268px; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;table&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;tblEmployees&quot;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;script&lt;/span&gt; &lt;span style=&quot;color:#ff0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;=&quot;text/javascript&quot;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum1&quot; style=&quot;color:#606060;&quot;&gt;   1:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum2&quot; style=&quot;color:#606060;&quot;&gt;   2:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum3&quot; style=&quot;color:#606060;&quot;&gt;   3:&lt;/span&gt;     $(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;#tblEmployees&quot;&lt;/span&gt;).flexigrid({&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum4&quot; style=&quot;color:#606060;&quot;&gt;   4:&lt;/span&gt;         url: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;GetFlexigridData&#39;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum5&quot; style=&quot;color:#606060;&quot;&gt;   5:&lt;/span&gt;         dataType: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;json&#39;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum6&quot; style=&quot;color:#606060;&quot;&gt;   6:&lt;/span&gt;         method: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;GET&#39;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum7&quot; style=&quot;color:#606060;&quot;&gt;   7:&lt;/span&gt;         colModel: [&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum8&quot; style=&quot;color:#606060;&quot;&gt;   8:&lt;/span&gt;             { display: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;ID&#39;&lt;/span&gt;, name: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;EmployeeID&#39;&lt;/span&gt;, width: 40, sortable: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;, align: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;center&#39;&lt;/span&gt; },&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum9&quot; style=&quot;color:#606060;&quot;&gt;   9:&lt;/span&gt;             { display: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;First Name&#39;&lt;/span&gt;, name: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;FirstName&#39;&lt;/span&gt;, width: 150, sortable: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;, align: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;left&#39;&lt;/span&gt; },&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum10&quot; style=&quot;color:#606060;&quot;&gt;  10:&lt;/span&gt;             { display: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;Last Name&#39;&lt;/span&gt;, name: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;LastName&#39;&lt;/span&gt;, width: 150, sortable: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;, align: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;left&#39;&lt;/span&gt;}],&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum11&quot; style=&quot;color:#606060;&quot;&gt;  11:&lt;/span&gt;         sortname: &lt;span style=&quot;color:#006080;&quot;&gt;&quot;id&quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum12&quot; style=&quot;color:#606060;&quot;&gt;  12:&lt;/span&gt;         sortorder: &lt;span style=&quot;color:#006080;&quot;&gt;&quot;asc&quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum13&quot; style=&quot;color:#606060;&quot;&gt;  13:&lt;/span&gt;         usepager: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum14&quot; style=&quot;color:#606060;&quot;&gt;  14:&lt;/span&gt;         title: &lt;span style=&quot;color:#006080;&quot;&gt;&#39;Employee List&#39;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; color=&quot;black&quot; style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span  id=&quot;lnum15&quot; style=&quot;color:#606060;&quot;&gt;  15:&lt;/span&gt;         useRp: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum16&quot; style=&quot;color:#606060;&quot;&gt;  16:&lt;/span&gt;         rp: 10,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; color=&quot;black&quot; style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span  id=&quot;lnum17&quot; style=&quot;color:#606060;&quot;&gt;  17:&lt;/span&gt;         showTableToggleBtn: &lt;span style=&quot;color:#0000ff;&quot;&gt;true&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum18&quot; style=&quot;color:#606060;&quot;&gt;  18:&lt;/span&gt;         height: 250,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span  id=&quot;lnum19&quot; style=&quot;color:#606060;&quot;&gt;  19:&lt;/span&gt;         width: 400&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum20&quot; style=&quot;color:#606060;&quot;&gt;  20:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span  id=&quot;lnum21&quot; style=&quot;color:#606060;&quot;&gt;  21:&lt;/span&gt;     );&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot;&gt;&lt;span  id=&quot;lnum22&quot; style=&quot;color:#606060;&quot;&gt;  22:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Для получения JSON-данных содержимого таблицы создаем еще один метод в нашем Employee-контроллере, так как структура данных будет отлична от предыдущего примера:&lt;/p&gt;&lt;br /&gt;&lt;div    style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background- margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px;  direction: ltr; max-height: 200px;  overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:#f4f4f4;&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre    style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace;font-size:8pt;color:black;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public&lt;/span&gt; JsonResult GetFlexigridData()&lt;br /&gt;{&lt;br /&gt;   var data = EmployeeModel.GetAll();&lt;br /&gt;   var start = &lt;span style=&quot;color:#0000ff;&quot;&gt;int&lt;/span&gt;.Parse(Request.QueryString[&lt;span style=&quot;color:#006080;&quot;&gt;&quot;page&quot;&lt;/span&gt;]);&lt;br /&gt;   var pageCount = &lt;span style=&quot;color:#0000ff;&quot;&gt;int&lt;/span&gt;.Parse(Request.QueryString[&lt;span style=&quot;color:#006080;&quot;&gt;&quot;rp&quot;&lt;/span&gt;]);&lt;br /&gt;&lt;br /&gt;   var json = &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; { page = start, total = data.Count, rows = (from d &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; data.Skip((start - 1) * pageCount).Take(pageCount) select &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; { id = d.EmployeeID, cell = &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt;[] { d.EmployeeID.ToString(), d.FirstName, d.LastName } }) };&lt;br /&gt;   &lt;span style=&quot;color:#0000ff;&quot;&gt;return&lt;/span&gt; Json(json, JsonRequestBehavior.AllowGet);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Готово. На выходе получаем довольно красивую и функциональную таблицу, которая подгружает данные по мере запроса (по мере перехода по страницам пейжинга).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSvOIVpBI/AAAAAAAAAGk/mLjQw4nDh3c/s1600-h/image%5B13%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_2odjgpkNP38/TFhSwzde-EI/AAAAAAAAAGo/P6GnjRIGyQ4/image_thumb%5B7%5D.png?imgmax=800&quot; width=&quot;422&quot; height=&quot;409&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Итак. Задачей данной статьи было найти примемленые JavaScript-плагины, которые в полной мере заменили бы мне до боли привычный и полностью освоенный контрол &amp;lt;asp:GridView&amp;gt;. Благодаря расширенному jQuery community довольно быстро были найдены и довольно быстро осовены разные плагины. К тому же я имел больше контроля над генерируемым кодом, а значит и больше контроля над присвоением стилей отображения данным контролам. К тому же подгрузка данных производилась с помощью  AJAX-запросов, в то время как в обычном &amp;lt;asp:GridView /&amp;gt; я получал постоянно полноценный PostBack, а значит и полный цикл генерации страницы на сервере и передачи ее клиенту. &lt;/p&gt;&lt;p&gt;В общем, мой страх перед сложностями перехода на MVC в доле регенерации аналогов сложных серверных контролов помалу улетучился. Хотелось бы дальше продолжить тематику воссоздания аналогов серверных контролов посредством клиентских JavaScript-библиотек.&lt;/p&gt;&lt;p&gt;Читайте также о том, &lt;a href=&quot;http://vadimba.blogspot.com/2010/08/gridview-webforms-mvc-seo-friendly.html&quot;&gt;как сделать не просто пейжинг для контрола, а сделать его SEO-friendly&lt;/a&gt;, чтобы страницы грида могли также загружать роботы поисковиков, индексуруя старый контент. Нынешняя же реализация, к сожалению, этого не позволяет.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/598553959520816787/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2010/07/gridview-mvc-jquery.html#comment-form' title='Комментарии: 3'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/598553959520816787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/598553959520816787'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2010/07/gridview-mvc-jquery.html' title='GridView в MVC - jQuery плагины для манипуляции с табличными данными'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_2odjgpkNP38/TFhSR8VmiSI/AAAAAAAAAFY/IVwFjSOv4lA/s72-c/image_thumb.png?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-2957263451981647684</id><published>2010-06-23T13:47:00.001-07:00</published><updated>2010-06-23T13:51:32.330-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Загрузка .js-файлов в html коде – best practicies от Nokia</title><content type='html'>&lt;ul&gt; &lt;li&gt;Использование lazy-loading для .js-файлов&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;При генерации страницы среда последовательно считывает содержимое html-кода. Если в процессе генерации попадается тег &amp;lt;script&amp;gt; с указанием на загрузку скрипта из внешнего источника – парсинг страницы прекращается до момента загрузки и выполнения попавшего скрипта. Тем самым, если скрипты объемные либо соединение нестабильное и медленное, построение страницы может затянутся на длительное время, даже если скрипт используется совсем для других целей. Для избежания проблем с залипанием процесса рендеринга страницы используется механизм, так называемого, динамической загрузки скриптов или иньекции скриптов. Данный механизм позволяет последовательно генерировать страницу без ожидания загрузки скриптов, в том время как сами скрипты автоматически будут выполнены после загрузки, паралельно построению layout-а.&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//bad&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;div&lt;/span&gt; id=&quot;splash&quot;/&lt;span style=&quot;color: #006080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt; src=&quot;my-&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;-file&lt;span style=&quot;color: #cc6633&quot;&gt;.js&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&lt;span style=&quot;color: #006080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #006080&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #006080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//good&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;div&lt;/span&gt; id=&quot;splash&quot;/&lt;span style=&quot;color: #006080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;// JavaScript&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; function loadScript(src, callback) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;head&lt;/span&gt; = document&lt;span style=&quot;color: #cc6633&quot;&gt;.getElementsByTagName&lt;/span&gt;(&#39;&lt;span style=&quot;color: #0000ff&quot;&gt;head&lt;/span&gt;&#39;)[0],&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt; = document&lt;span style=&quot;color: #cc6633&quot;&gt;.createElement&lt;/span&gt;(&#39;&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&#39;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;     done &lt;span style=&quot;color: #006080&quot;&gt;= false;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.setAttribute&lt;/span&gt;(&#39;src&#39;, src);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.setAttribute&lt;/span&gt;(&#39;type&#39;, &#39;text/javascript&#39;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.setAttribute&lt;/span&gt;(&#39;charset&#39;, &#39;utf-8&#39;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.onload&lt;/span&gt; = &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.onreadstatechange&lt;/span&gt; = function() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;         if (!done &lt;span style=&quot;color: #006080&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #006080&quot;&gt;&amp;amp;&lt;/span&gt; (!this&lt;span style=&quot;color: #cc6633&quot;&gt;.readyState&lt;/span&gt; || this&lt;span style=&quot;color: #cc6633&quot;&gt;.readyState&lt;/span&gt; == &#39;loaded&#39; || this&lt;span style=&quot;color: #cc6633&quot;&gt;.readyState&lt;/span&gt; == &#39;complete&#39;)) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;             done &lt;span style=&quot;color: #006080&quot;&gt;= true;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.onload&lt;/span&gt; = &lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.onreadystatechange&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;= null;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;                 if (callback) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;                     callback();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;                 }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;             }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.insertBefore&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.firstChild&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;// load the my-script-file.js and display an alert dialog once the script has been loaded&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt; loadScript(&#39;my-&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;-file&lt;span style=&quot;color: #cc6633&quot;&gt;.js&lt;/span&gt;&#39;, function() { alert(&#39;my-&lt;span style=&quot;color: #0000ff&quot;&gt;script&lt;/span&gt;-file&lt;span style=&quot;color: #cc6633&quot;&gt;.js&lt;/span&gt; loaded.&#39;); });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Использование http-заголовков Expires для загружаемых скриптов&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Данный механизм позволяет не загружать скрипты, если локальная копия еще имеет не просроченное время срока жизни. Тем самым, после первого посещения сайта загруженные и сохраненные в локальном кеше скрипты можно будет повторно использовать без перезагрузки.&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Сжатие передаваемых скриптов посредстов Gzip-компрессии&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Объединение нескольких скриптов в один – это позволит уменьшить количество http-запросов к серверу, а, соответственно, и время ожидания загрузки всех скриптов&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Использовать при возможности несколько мест хранения скриптов с разными адрессами, что позволит распаралелить загрузку&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Не использовать inline-скрипты – встроенные в страницу, выносите их в отдельных файл. При последующей загрузке страницы будет использована локальная копия скриптового файла, а не загружать регулярно при загрузке страницы&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Для уменьшения скорости построения страницы старайтесь использовать минимально возможное количество DOM-элементов&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//получить количество DOM-элементов на странице&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; n = document&lt;span style=&quot;color: #cc6633&quot;&gt;.getElementsByTagName&lt;/span&gt;(&#39;*&#39;&lt;span style=&quot;color: #006080&quot;&gt;).length;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Если есть возможность – изменяйте свойства DOM-объекта в состоянии – не видим.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; subElem = document&lt;span style=&quot;color: #cc6633&quot;&gt;.createElement&lt;/span&gt;(&#39;&lt;span style=&quot;color: #0000ff&quot;&gt;div&lt;/span&gt;&#39;),&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     elem = document&lt;span style=&quot;color: #cc6633&quot;&gt;.getElementById&lt;/span&gt;(&#39;animated&#39;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.display&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;= &#39;none&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.appendChild&lt;/span&gt;(subElem);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.width&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;= &#39;320px&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.display&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;= &#39;block&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Не считывайте следующие свойства без необходимости – это приводит к изменению положения элемента и перепроверке положения последующих: getComputedStyle, offsetWidth, scrollWidth и clientWidth&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; elem = document&lt;span style=&quot;color: #cc6633&quot;&gt;.getElementById&lt;/span&gt;(&#39;animated&#39;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.fontSize&lt;/span&gt; = (elem&lt;span style=&quot;color: #cc6633&quot;&gt;.offsetWidth&lt;/span&gt; / 10) &lt;span style=&quot;color: #006080&quot;&gt;+ &#39;px&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.firstChild&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.marginleft&lt;/span&gt; = (elem&lt;span style=&quot;color: #cc6633&quot;&gt;.offsetWidth&lt;/span&gt; / 20) &lt;span style=&quot;color: #006080&quot;&gt;+ &#39;px&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; elem = document&lt;span style=&quot;color: #cc6633&quot;&gt;.getElementById&lt;/span&gt;(&#39;animated&#39;),&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     elemWidth &lt;span style=&quot;color: #006080&quot;&gt;= elem.offsetWidth;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.fontSize&lt;/span&gt; = (elemWidth / 10) &lt;span style=&quot;color: #006080&quot;&gt;+ &#39;px&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; elem&lt;span style=&quot;color: #cc6633&quot;&gt;.firstChild&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.style&lt;/span&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;.marginleft&lt;/span&gt; = (elemWidth / 20) &lt;span style=&quot;color: #006080&quot;&gt;+ &#39;px&#39;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Вместо измнения нескольких стилей элемента последовально, лучше использовать назвачение отдельного css-класса&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; elem = document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;styled&#39;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; elem.style.background = &lt;span style=&quot;color: #006080&quot;&gt;&#39;blue&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; elem.style.color = &lt;span style=&quot;color: #006080&quot;&gt;&#39;white&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//Faster &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &amp;lt;style type=&lt;span style=&quot;color: #006080&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; div { background: white; color: black; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; div.active { background: blue; color: white; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &amp;lt;/style&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; elem = document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;styled&#39;&lt;/span&gt;).className = &lt;span style=&quot;color: #006080&quot;&gt;&#39;active&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Чтобы не создавать отдельный css-класс – можно использовать метод setAttribute для назначения нескольких свойст за раз&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; elem = document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;styled&#39;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; elemStyle = &lt;span style=&quot;color: #006080&quot;&gt;&#39;background: blue; color: white;&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; elem.setAttribute(&lt;span style=&quot;color: #006080&quot;&gt;&#39;style&#39;&lt;/span&gt;, elemStyle);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;сохранять найденные элементы в переменные при необходимости повторного их использования&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;elem&#39;&lt;/span&gt;).propertyOne = &lt;span style=&quot;color: #006080&quot;&gt;&#39;value of first property&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;elem&#39;&lt;/span&gt;).propertyTwo = &lt;span style=&quot;color: #006080&quot;&gt;&#39;value of second property&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;elem&#39;&lt;/span&gt;).propertyThree = &lt;span style=&quot;color: #006080&quot;&gt;&#39;value of third property&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; elem = document.getElementById(&lt;span style=&quot;color: #006080&quot;&gt;&#39;elem&#39;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; elem.propertyOne = &lt;span style=&quot;color: #006080&quot;&gt;&#39;value of first property&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; elem.propertyTwo = &lt;span style=&quot;color: #006080&quot;&gt;&#39;value of second property&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; elem.propertyThree = &lt;span style=&quot;color: #006080&quot;&gt;&#39;value of third property&#39;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/2957263451981647684/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2010/06/js-html-best-practicies-nokia.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/2957263451981647684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/2957263451981647684'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2010/06/js-html-best-practicies-nokia.html' title='Загрузка .js-файлов в html коде – best practicies от Nokia'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-1389104367796091189</id><published>2010-06-23T09:52:00.001-07:00</published><updated>2010-06-23T09:52:26.980-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>JavaScript Performance Best Practices от Nokia</title><content type='html'>&lt;p&gt;&lt;strong&gt;Избегать использования функции eval()&lt;/strong&gt;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; setInterval(1000, &lt;span style=&quot;color: #006080&quot;&gt;&quot;alert(&#39;hello&#39;)&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; setInterval(1000, function() { alert(&lt;span style=&quot;color: #006080&quot;&gt;&#39;hello&#39;&lt;/span&gt;); });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Избегать использования выражения with&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; with (test.&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;) {    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     foo = &lt;span style=&quot;color: #006080&quot;&gt;&#39;Value of foo property of object&#39;&lt;/span&gt;;    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     bar = &lt;span style=&quot;color: #006080&quot;&gt;&#39;Value of bar property of object&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; var myObj = test.&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; myObj.foo = &lt;span style=&quot;color: #006080&quot;&gt;&#39;Value of foo property of object&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; myObj.bar = &lt;span style=&quot;color: #006080&quot;&gt;&#39;Value of bar property of object&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Не использовать try-catch-finnaly в требующих времени функциях&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; var &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; = [&lt;span style=&quot;color: #006080&quot;&gt;&#39;foo&#39;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&#39;bar&#39;&lt;/span&gt;], i;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (i = 0; i &amp;lt; &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;.length; i++) {   &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt; {      &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;// do something that throws an exception   &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     } &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (e) {      &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;// handle exception   &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt; var &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; = [&lt;span style=&quot;color: #006080&quot;&gt;&#39;foo&#39;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&#39;bar&#39;&lt;/span&gt;], i;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt; {    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (i = 0; i &amp;lt; &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;.length; i++) {        &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;// do something    &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt; } &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (e) {    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// handle exception&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Использовать минимум глобальных переменных&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; var i,    str = &lt;span style=&quot;color: #006080&quot;&gt;&#39;&#39;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; function globalScope() {    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (i=0; i &amp;lt; 100; i++) {        &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;         str += i; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; globalScope();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; function localScope() {    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     var i, str = &lt;span style=&quot;color: #006080&quot;&gt;&#39;&#39;&lt;/span&gt;;    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (i=0; i &amp;lt; 100; i++) {        &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;         str += i; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt; localScope();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;В сложных и долговременных циклах стараться не использовать выражение for-in&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Не делать многоразовых арифметических операций над строками одним выражением&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//Slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; a += &lt;span style=&quot;color: #006080&quot;&gt;&#39;x&#39;&lt;/span&gt; + &lt;span style=&quot;color: #006080&quot;&gt;&#39;y&#39;&lt;/span&gt;; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//Faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; a += &lt;span style=&quot;color: #006080&quot;&gt;&#39;x&#39;&lt;/span&gt;; a += &lt;span style=&quot;color: #006080&quot;&gt;&#39;y&#39;&lt;/span&gt;; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Бинарные, тернарные, простые операции будут выполняться быстрее чем вызов аналогичных функций&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; var min = Math.min(a, b);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; arr.push(val);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//faster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; var min = a &amp;lt; b ? a : b;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; arr[arr.length] = val;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Не создавать без надобности переменные, имеющие привязки к DOM-модели&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//bad&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; var car = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Object();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; car.color = &lt;span style=&quot;color: #006080&quot;&gt;&quot;red&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; car.type = &lt;span style=&quot;color: #006080&quot;&gt;&quot;sedan&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//good&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; var car = { color : &lt;span style=&quot;color: #006080&quot;&gt;&quot;red&quot;&lt;/span&gt;; type : &lt;span style=&quot;color: #006080&quot;&gt;&quot;sedan&quot;&lt;/span&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Стараться не вызывать элементы из глобального скопа&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//bad&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; var url = location.href;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//good&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; var url = window.location.href;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Не использовать длинных комментариев и длинных названий переменных&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//bad&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; function someFunction() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     var user_first_last_name = &lt;span style=&quot;color: #006080&quot;&gt;&quot;first last&quot;&lt;/span&gt;; &lt;span style=&quot;color: #008000&quot;&gt;/* stores the full name of user*/&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//good&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; function someFunction() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     var fullName = &lt;span style=&quot;color: #006080&quot;&gt;&quot;first last&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Кешировать переменные, значения которых не меняются&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//slow&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; var m = 10;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt;(var i=0; i&amp;lt;250; i++)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     n += Math.tan(m);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;//falster&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; var m = 10;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; var exp = Math.tan(m);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt;(var i=0; i&amp;lt;250; i++)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     n += exp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/1389104367796091189/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2010/06/javascript-performance-best-practices.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/1389104367796091189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/1389104367796091189'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2010/06/javascript-performance-best-practices.html' title='JavaScript Performance Best Practices от Nokia'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7958256517041351593.post-1587562140462861247</id><published>2010-06-22T23:23:00.000-07:00</published><updated>2010-06-23T01:21:18.901-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="minifying"/><category scheme="http://www.blogger.com/atom/ns#" term="optimization"/><title type='text'>Оптимизация CSS</title><content type='html'>Для уменьшения трафика для Вашего сайта и для более быстрой загрузки страниц (что на данный момент крайне важный аттрибут при ранжировании сайта поисковиками) необходимо особое внимание уделять не только содержимому веб-страницы, но и содержимому вспомагательных файлов, помогающих Вам генерировать внешний вид страницы (css-файлы), либо же помогающих Вам добавлять к странице особые эффекты (js-файлы).&lt;br&gt;&lt;br&gt;Помимо обязательного использования архивации при загрузке файлов (gzip) и удаления лишних символов для уменьшения объема файла (minifying), также следует обращать внимание и на основные принципы построения блоков кода, которые также помогут уменьшить объем исходного файла.&lt;br&gt;&lt;br&gt;Далее вкратце перечислим особые приемы:&lt;br&gt;&lt;b&gt;Использование сокращений для кодов цветовой гаммы&lt;/b&gt;&lt;br&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; node { &lt;span style=&quot;color: #0000ff&quot;&gt;background-color&lt;/span&gt;: rgb(255,255,255);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*превращаем в...*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*используем другой синтаксис записи цвета*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; node { &lt;span style=&quot;color: #0000ff&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#ffffff;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*используем 3-значное сокращение*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; node { &lt;span style=&quot;color: #0000ff&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#fff;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*используем декларацию для задания общего стиля фона, но не указываем других node параметров */&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;{ #fff;&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;Тем самым при записи декларации для задания цвета фона элемента по сравнению с первой и последней записью мы добились почти вдвое меньшей длины записи.&lt;br&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Объединение повторяющихся свойств&lt;/b&gt;&lt;/div&gt;Для примера мы имеем следующие декларации:&lt;br&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 275px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #cc6633&quot;&gt;.artcile&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;p&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-family&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;Georgia, serif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-weight&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;normal;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;line-height&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;12px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;p&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-family&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;Georgia, serif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-weight&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;normal;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;line-height&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;12px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;11px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br&gt;Как мы видим, объявления для параграфа почти идентичны, за исключением свойства размера фона. Нам нет необходимости переобъявлять свойства, которые и так будут унаследованы. Тем самым синтаксис можно сменить на следующий:&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #cc6633&quot;&gt;.artcile&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;p&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;p&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-family&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;Georgia, serif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-weight&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;normal;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;line-height&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;12px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;11px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class=&quot;css&quot; name=&quot;code&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;b&gt;Использование глобальный деклараций&lt;/b&gt;&lt;br&gt;&lt;br /&gt;&lt;div&gt;Наиболее объемные записи в кодах css получаются, когда при задании свойств кодер обращается к отдельному свойству, а не задает сразу группу. Рассмотрим на примере:&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;p&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-family&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;Georgia, serif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-weight&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;normal;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;line-height&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;1.33em;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;1.33em;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/* Можно превратить в следующую запись */&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;p&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-family&lt;/span&gt;: normal 1.33em&lt;span style=&quot;color: #006080&quot;&gt;/1.33 Georgia, serif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br&gt;Тем самым, чтобы не задавать каждому свойсту значения в отдельности, можно задать сразу группе свойств одной записью. Как видно - экономия места налицо. Следущие свойства также можно объединять в группы.&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#fff;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background-image&lt;/span&gt;: url(&lt;span style=&quot;color: #0000ff&quot;&gt;i&lt;/span&gt;/dope&lt;span style=&quot;color: #cc6633&quot;&gt;.png&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background-repeat&lt;/span&gt;: repeat&lt;span style=&quot;color: #006080&quot;&gt;-x;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background-position&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;0 0;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/* 4 свойства заменяется 1 */&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background&lt;/span&gt;: #fff url(&lt;span style=&quot;color: #0000ff&quot;&gt;i&lt;/span&gt;/dope&lt;span style=&quot;color: #cc6633&quot;&gt;.png&lt;/span&gt;) repeat&lt;span style=&quot;color: #006080&quot;&gt;-x 0 0;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;-&lt;span style=&quot;color: #0000ff&quot;&gt;top&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;-&lt;span style=&quot;color: #0000ff&quot;&gt;right&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;20px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;-&lt;span style=&quot;color: #0000ff&quot;&gt;bottom&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;-&lt;span style=&quot;color: #0000ff&quot;&gt;left&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;20px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/* можно записать как */&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px 20px 10px 20px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;border-width&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;1px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;border-style&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;solid;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;border-color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;red;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/* можно записать как */&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;border&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;1px solid red;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br&gt;&lt;b&gt;Объединение одинаковых числовых значений&lt;/b&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px 20px 10px 20px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*можно записать как*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px 20px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px 10px 10px 10px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*можно записать как*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br&gt;&lt;b&gt;Удаление 0 в дробных числах&lt;/b&gt;&lt;br&gt;&lt;/div&gt;&lt;pre class=&quot;css&quot; name=&quot;code&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 100px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;padding&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;0.1em;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10.0em;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*Можно записать как*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;padding&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;.1em;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;10em;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br&gt;&lt;b&gt;Удаление единиц измерения для нулевых значений&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;padding&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;0px;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*Можно записать как*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;padding&lt;/span&gt;: 0;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Удаление комментарией из продакшн-версий&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Удаление ненужных пробелов&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;body&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-family&lt;/span&gt;: &quot;Trebuchet MS&quot;, Verdana, Arial, Helvetica, sans&lt;span style=&quot;color: #006080&quot;&gt;-serif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#333;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;text-align&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;center;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;0px auto;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;62.5%;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#FFF;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/*Можно записать как*/&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;body&lt;/span&gt; { ont-family: &quot;Trebuchet MS&quot;, Verdana, Arial, Helvetica, sans&lt;span style=&quot;color: #006080&quot;&gt;-serif;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;background-color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#333;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;text-align&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;center;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;margin&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;0px auto;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;62.5%;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;color&lt;/span&gt;: &lt;span style=&quot;color: #006080&quot;&gt;#FFF;&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Желательно использовать специальные программы для удаления ненужных пробелов и переносов строки уже при переносе файла на сервер. Процесс удаления называется minifying.&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://vadimba.blogspot.com/feeds/1587562140462861247/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://vadimba.blogspot.com/2010/06/css.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/1587562140462861247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7958256517041351593/posts/default/1587562140462861247'/><link rel='alternate' type='text/html' href='http://vadimba.blogspot.com/2010/06/css.html' title='Оптимизация CSS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00754759528883299809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>