如何在移动浏览器上创建轻量级页面? [英] How to create lightweight page on mobile browser?

查看:90
本文介绍了如何在移动浏览器上创建轻量级页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个依赖于一个文本文件的代码.该文件存储数据.
我阅读了此文件&从中获取详细信息,将其绑定到GridView.所有这些过程都在page_load 事件中.
请告诉我如何使用scriptmanager& amp;调用页面加载事件时如何创建轻量级页面. Gridview的updatepanel.请帮忙.

代码在页面加载事件中:-----

I wrote a code that depends on one text file. This file stores data.
I read this file & get details from it, bind it to GridView. This all process is in page_load event.
Please tell me how can i create lightweight page when page load event is called using scriptmanager & updatepanel for Gridview. Please help.

Code is in Page Load Event:-----

AddressBookSearch AddressSearch = new AddressBookSearch();
string mStr = AddressSearch.GetData();
Dt = AddressSearch.processAllDetails(mStr);
try
{
   if (Dt.Rows.Count > 0 && Dt != null)
   {
     TempDt.Columns.Add("Name");
     TempDt.Columns.Add("NameUrl");
     foreach (DataRow Dr in Dt.Rows)
     {
       DataRow TempDr = TempDt.NewRow();
       if (string.IsNullOrEmpty(Dr["Title"].ToString().Trim() + Dr["First Name"].ToString().Trim() + Dr["Middle Name"].ToString().Trim() + Dr["Last Name"].ToString().Trim()) == true)
       {
         TempDr["Name"] = "(UnName)";
       }
       else
       {
         TempDr["Name"] = Dr["Title"].ToString().Trim() + " " + Dr["First Name"].ToString().Trim() + " " + Dr["Middle Name"].ToString().Trim() + " " + Dr["Last Name"].ToString().Trim();
       }
       TempDr["NameUrl"] = "Demo.aspx?Index=" + Dr["Index"].ToString();
       TempDt.Rows.Add(TempDr);
    }
    DataView TempDv = new DataView(TempDt, "", "Name", DataViewRowState.CurrentRows);
    GridView1.DataSource = TempDt = TempDv.ToTable();
    GridView1.DataBind();
}
catch{}


当我有200个联系人要查看时,此代码需要352kb.允许进行gridview分页.

该代码的任何帮助,以减少移动浏览器上的kb .....
为此请帮我

问候


this code takes 352kb when i have 200 contacts i''m to see...& allowed for gridview paging.

Any help for that code to reduce kb on mobile browser.....
Please help me for that

regards

推荐答案

首先,可能有200个联系人构成了您的大量页面.减少该文本的唯一方法是减少联系人数量.

除此之外,Microsoft Web控件可能非常冗长.如果您确实需要减少麻烦,则可能需要完全避免使用控件,并自行布置页面.
First off, 200 contacts probably makes up a large amount of your page. The only way to reduce that text is to reduce the number of contacts.

Beyond that, Microsoft web controls can be very verbose. If you really need to cut down on the bloat, you will probably need to avoid the controls entirely and lay out the page yourself.


这篇关于如何在移动浏览器上创建轻量级页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆