Coolite Cool Study 2 同時(shí)更新多個(gè)Tab
當(dāng)時(shí)用Coolite做測(cè)試遇到兩個(gè)問題:
1. 傳遞給Tab的Url參數(shù)會(huì)莫名其妙的被添加上其他字符(到Coolite論壇上問了一下估計(jì)是bug)。正常情況下,google搜索url是這個(gè)樣子:http://www.google.com/search?q=Hello 但因?yàn)镃oolite在Tab的Url后面添加了某些字符,結(jié)果變成這樣:http://www.google.com/search?q=Hellosfkjsdkfjskdf, 解決辦法是把搜索Url設(shè)成這樣形式:http://www.google.com/search?q=Hello&End=Y ,呵呵!!
2. 多個(gè)Tab同時(shí)加載頁面引起沖突,導(dǎo)致后面加載的Tab頁面有javascript錯(cuò)誤。解決辦法很簡(jiǎn)單,TabPanel的屬性 DeferredRender="false" 就OK了。
完整代碼:
<%@ Page Language="C#" %> <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { } protected void UpdatePage(object sender, AjaxEventArgs e) { string keyWord = txtS.Text; string url; url = "http://www.google.com/search?q=" + keyWord + "&End=Y"; tabDtlInfo.Load(new LoadConfig { Mode = LoadMode.IFrame, Url = url, NoCache = true, ShowMask = true }); url = "http://cnweb.search.live.com/results.aspx?q=" + keyWord + "&End=Y"; tabChgInfo.Load(new LoadConfig { Mode = LoadMode.IFrame, Url = url, NoCache = true, ShowMask = true }); url = "http://www.flickr.com/search/?q=" + keyWord + "&End=Y"; tabSmyInfo.Load(new LoadConfig { Mode = LoadMode.IFrame, Url = url, NoCache = true, ShowMask = true }); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Update 3 Pages</title> </head> <body style="padding:15px,5px,5px,15px;"> <form id="form1" runat="server"> <ext:ScriptManager ID="ScriptManager1" runat="server" AjaxViewStateMode="Include"> </ext:ScriptManager> <table > <tr> <td style="padding:15px,5px,5px,15px;"> Search: </td> <td style="padding:15px,5px,5px,15px;"> <ext:TextField runat="server" ID="txtS" Width="300"> </ext:TextField> </td> <td style="padding:15px,5px,5px,15px;"> <ext:Button ID="btnTest" runat="server" Text="Search By Multi-Engine" Icon="Accept"> <AjaxEvents> <Click OnEvent="UpdatePage"> <EventMask ShowMask="true" MinDelay="500" Msg="Updating Page..." /> </Click> </AjaxEvents> </ext:Button> </td> </tr> </table> <ext:TabPanel runat="server" ActiveTabIndex="0" Border="true" Height="500" DeferredRender="false" > <Tabs> <ext:Tab ID="tabDtlInfo" runat="server" Title="Google" Height="500" Frame="true" > </ext:Tab> <ext:Tab ID="tabChgInfo" runat="server" Title="Live" Height="500" Frame="true"> </ext:Tab> <ext:Tab ID="tabSmyInfo" runat="server" Title="Filckr" Height="500"> </ext:Tab> <ext:Tab ID="tab1" runat="server" Title="AutoLoad_Google" Height="500" Frame="true"> <AutoLoad NoCache="true" Mode="IFrame" ShowMask="true" Url="http://www.google.com/search?q=Hello&End=Y"> </AutoLoad> </ext:Tab> <ext:Tab ID="tab2" runat="server" Title="AutoLoad_Live" Height="500" Frame="true"> <AutoLoad NoCache="true" Mode="IFrame" Url="http://cnweb.search.live.com/results.aspx?q=Hello&End=Y"> </AutoLoad> </ext:Tab> </Tabs> </ext:TabPanel> </form> </body> </html>
PS: 這篇文章是用Windows Live Writer來寫的,感覺效率高了很多,排版也好了,Cool, I like it!( – 。- !) 感覺有點(diǎn)賣廣告味道~
相關(guān)文章
asp.net iis 無法顯示網(wǎng)頁的解決方法分析
使用過IIS的朋友都可能遇到過這樣的情況:即使您按照教科書的步驟做好各步設(shè)置以后,仍會(huì)出現(xiàn)“無法顯示網(wǎng)頁”的現(xiàn)象。2010-06-06
ASP.NET MVC @Helper輔助方法和@functons自定義函數(shù)的使用方法
本文主要介紹ASP.NET MVC中使用@Helper和@functons自定義一些代碼片段,方便視圖調(diào)用,從而達(dá)到減少重復(fù)代碼,快速開發(fā)的目的,希望對(duì)大家有所幫助。2016-04-04
asp.net 網(wǎng)頁動(dòng)態(tài)查詢條件的實(shí)現(xiàn)
最近有一個(gè)需求,會(huì)在 mongodb 中插入各種類型的數(shù)據(jù),算是記錄業(yè)務(wù)日志的數(shù)據(jù)庫吧。因?yàn)闃I(yè)務(wù)對(duì)象類型都不同,所以插入的數(shù)據(jù)格式也完全不同2012-10-10
ASP.NET堆和棧二之值類型和引用類型的參數(shù)傳遞和內(nèi)存分配
這篇文章介紹了ASP.NET堆和棧中值類型和引用類型的參數(shù)傳遞和內(nèi)存分配,文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-08-08
asp.net中CSharpThinking擴(kuò)展方法分析
這篇文章主要介紹了asp.net中CSharpThinking擴(kuò)展方法,實(shí)例講述了擴(kuò)展方法的特征及應(yīng)用,具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2014-11-11
限制CheckBoxList控件只能單選實(shí)現(xiàn)代碼及演示動(dòng)畫
開發(fā)要求,原本對(duì)CheckBoxList控件是用來讓用戶多選的。但現(xiàn)在特殊要求,這個(gè)CheckBoxList控件限制只能單選,很多新手朋友可能不知從何下手,為此本文的出現(xiàn)時(shí)有必要的了,有需要的朋友可以了解此文2013-01-01
ASP.NET實(shí)現(xiàn)按拼音碼模糊查詢的方法
我們?cè)谧鰯?shù)據(jù)錄入或者查詢的時(shí)候,經(jīng)常需要實(shí)現(xiàn)按用戶輸入的拼音碼進(jìn)行數(shù)據(jù)的模糊查詢功能,本文為大家介紹ASP.NET如何實(shí)現(xiàn)按拼音碼模糊查詢,需要的朋友可以參考下2015-09-09
asp.net(c#)文件下載實(shí)現(xiàn)代碼
本文通過一個(gè)實(shí)例向大家介紹用C#進(jìn)行Internet通訊編程的一些基本知識(shí)。我們知道.Net類包含了請(qǐng)求/響應(yīng)層、應(yīng)用協(xié)議層、傳輸層等層次。2009-11-11
Asp.net mvc 數(shù)據(jù)調(diào)用示例代碼
Asp.net mvc 數(shù)據(jù)調(diào)用示例代碼,學(xué)習(xí)asp.net mvc框架的朋友可以參考下。2010-10-10

