Analytics

顯示具有 Web 標籤的文章。 顯示所有文章
顯示具有 Web 標籤的文章。 顯示所有文章

2015年2月6日 星期五

[AngularJS]解決 AngularJS於IE11下,Option第一次點擊時只會在第一筆 (Solve AngularJS at IE11, Option first click only the first pen)


問題
在IE11裡,option不管怎麼選,第一次觸發都是顯示第一筆選項



解決方法
由於AngularJS在option的繫結上於第一次觸發時,會繫結不到資料(尚未選擇select內容), 因此會自動加入一個空白的select,在第二次觸發時,就會自動移除該筆資料. 而IE11底下,發生第一次觸發選擇後,只會顯示第一筆資料的問題 目前尚未有解決方式:
[Angular.js] ng-option doesn't handle first selection properly under IE11
所以讓我直覺該朝著避開此問題著手!!
由於上述有講到AngularJS在option的繫結方式,因此我想讓AngularJS不會於觸發時繫結不到資料,
所以在一開始就指定ng-model的變數值為資料來源的第一個項目~結果~~~
bingo!成功避過此問題!!!

2015年1月22日 星期四

[IE]如何 關閉/開啟IE指令碼錯誤提示 (How to turn off / on IE script error)


問題
如何 關閉/開啟IE指令碼錯誤提示



解決方法
依預設會關閉指令碼錯誤除錯與通知功能。 如果除錯與通知已經開啟,請依照下列步驟再關閉一次。 1.開啟 [Internet Explorer]
2.按一下 [工具] 按鈕,然後按一下 [網際網路選項]。
3.按一下 [進階] 索引標籤,選取 [停用指令碼除錯 (Internet Explorer)] 和 [停用指令碼除錯 (其他)] 核取方塊。
4.清除 [每次出現指令碼錯誤時皆顯示通知] 核取方塊,然後按一下 [確定]。

開啟動作與關比動作相反即可。


微軟官方說明

[IE]解決 iFrame在IE11裡發生堆疊,分層不明問題 (Unknown problem solving occurs in IE11 inside iFrame stacked, layered)


問題
系統從IE 8 升到 IE 11後,原本頁面使用TAB切換,每個TAB包含一個iFrame頁面,且各自獨立,但在IE 11裡,竟然堆疊在一起,且可透示與互相干擾



解決方法
IE 11支援新版的CSS,其中一項就是iFrame預設為透明,且本身IE 11改版內容裡,對zIndex圖層堆疊有做過調整,因此在IE 11裡使用iFrame時,將視為圖層且該圖層背景預設為透明,當iFrame內容比較少,寬高比較小時,就會看得到另一iFrame的內容
所以解決方式為將iFrame要顯示的內容頁做調整,如下:
加入css檔案,並於頁面註冊


css內容
body {
 margin: 5px;
 width: 99%; 
 height: 100%;
 background-color:white;
}

2014年5月8日 星期四

[Oracle]解決 Windows7 Asp.net出現ORA-12154: TNS: 無法解析指定的連線 ID (Solve Windows7 Asp.net appear ORA-12154: TNS: could not resolve the specified connection ID)


問題
執行連接Oracle db時,出現ORA-12154: TNS: 無法解析指定的連線 ID的錯誤!
但是PLSQL Developer卻正常連線,因此問題應該是出現在asp.net config設定上




解決方法

web.config將oracle連線改為用tns方式指定,如下:

<add key="DB_ORACLE" value="User ID=Oraclename;Password=123456;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.99)(PORT=7542)))(CONNECT_DATA=(SERVICE_NAME=DB_ORACLE)));" />

2013年3月22日 星期五

[IIS]解決 SecurityException: 型別 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 的使用權限要求失敗。]


問題

在使用第三方原件後,開發端使用虛擬IIS執行時一切皆正常,但是部屬到IIS上以後,出現

SecurityException: 型別 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 的使用權限要求失敗。




解決方法
網路上試過方式
1.在第三方原件的Assambly.cs裡,加入
using System.Security;
[assembly: AllowPartiallyTrustedCallers()]

2.WebConfig裡加入
<trust level="Medium"/>
不過沒用,因為已經加入!

最後嘗試
在IIS7 → 應用程式集區 → 設置應用程式區預設值 → 載入使用者設定檔→False改為 True



結果就正常了!!分享這個解決方式給大家參考!

解決來源

2011年4月7日 星期四

[IIS]解決 IIS 7.5 詳細錯誤–404.3 找不到asp檔案(Resolve IIS 7.5 Detailed Error -404.3 find asp file)


問題

當在Win7環境底下開發Web程式時,使用Javascript去呼叫日曆的asp檔案,卻發生IIS 7.5找不到檔案的問題
1




解決方法
IIS底下啟用Active Server Pages的服務
1.控制台=>開啟或關閉Windows功能=>Internet Information Services展開
2
2.在World Wide Web服務展開=>應用程式開發功能=>確認ASP是否勾選
3
3.開始=>我的電腦右鍵=>管理=>找到Internet Information Services=>雙擊開啟IIS
4
4.找到ISAPI及CGI限制並開啟
5
5.確認Active Server Pages服務是否被允許
6
測試:
底下畫面為正常顯示的樣子
7

2011年3月14日 星期一

[AJAX]解決 Sys.WebForms.PageRequestManagerParserErrorException: 無法剖析從伺服器收到的訊息。這項錯誤通常的原因是回應被 Response.Write()、回應篩選條件、HttpModules 的呼叫修改了,或是已啟用伺服器追蹤。 詳細資料: 剖析 near 'xxx' 時發生錯誤。(Solve Sys.WebForms.PageRequestManagerParserErrorException: Unable to parse the message received from the server. This error usually occurs because the response is Response.Write (), to respond to the filter criteria, HttpModules call modified, or server trace is enabled. Details: Error parsing near 'xxx'.)


問題
Sys.WebForms.PageRequestManagerParserErrorException: 無法剖析從伺服器收到的訊息。這項錯誤通常的原因是回應被 Response.Write()、回應篩選條件、HttpModules 的呼叫修改了,或是已啟用伺服器追蹤。 詳細資料: 剖析 near 'xxx' 時發生錯誤。



解決方法
在使用ajax開發時,當頁面使用update panel時,而頁面如果有檔案下載的動作,就發出現這樣的問題,因此現有的解決方式就是將update panel移除,就可以避免這樣的問題出現

2011年3月7日 星期一

[VISUAL STUDIO]解決 IIS已設定為應用程式,卻仍出現"在應用程式層級之外使用註冊為 allowDefinition='MachineToApplication' 的區段發生錯誤。錯誤的原因可能是虛擬目錄尚未在 IIS 中設定為應用程式。"(IIS has been set to resolve apps still appear in addition to using the app level registered as allowDefinition = 'MachineToApplication' segment error. It may be the cause of the error has not been set for the virtual directory in IIS app.)


問題

IIS已設定為應用程式,卻仍出現"在應用程式層級之外使用註冊為 allowDefinition='MachineToApplication' 的區段發生錯誤。錯誤的原因可能是虛擬目錄尚未在 IIS 中設定為應用程式。



解決方法

由於網路上都說要註冊IIS為應用程式就可以解決,但這方法試過卻不行,所以檢查了一下自己的方案,發現WebSite的網站裡,不知道被誰又包了一個WebSite,也就是WebSite裡有另一個Website,所以將另一個WebSiet提出來,問題就解決了!!
如果有這樣的問題解決不了,也可以試著找一下是否有跟我一樣的狀況

2010年12月2日 星期四

[Web]解決 The underlying connection was closed: The remote name could not be resolved. 的幾種可能性(Several possibilities The remote name could not be resolved: Addressing The underlying connection was closed.)


問題

The underlying connection was closed: The remote name could not be resolved.




解決方法

很容易看的出來,意思指出遠端的位置無法"解析".
造成無法解析的原因有很多種,請從最基本的找起
而所謂的基本=>就是有沒有辦法連線到遠端位置!!

1.請確定IP是ping的到,若ping不到,就不用玩啦!先把遠端電腦防火牆調成可以被PING
2.若PING的到,則確定DNS解析是否正常=>確定方式為"將NAMING改為IP"
EX:http://www.google.com/=>http://72.14.203.106/

若這樣就找的到,則確定DNS解析有問題!

2010年11月12日 星期五

[IIS]解決 Server Application Unavailable(Solve Server Application Unavailable)


問題
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable.  Please hit the Refresh button in your web browser to retry your request.




解決方法
if you have over one of .Net Framework work on your IIS.May see message like this !
because .Net Framework every version need each AppPool to control under w3wp.exe,so just give each version one AppPool that problem will be resolve!!

[Web Service]解決 Server did not recognize the value of HTTP Header SOAPAction(Solve Server did not recognize the value of HTTP Header SOAPAction)


問題
Server did not recognize the value of HTTP Header SOAPAction



解決方法
Please check the web service is exist and can connect first!

2010年11月5日 星期五

[Web]使用 VisualStudio 2008 看 POST跟GET的差別(Use Visual Studio 2008 to see the difference between the POST with GET)


問題
使用 VisualStudio 2008 看 POST跟GET的差別



解決方法
POST跟GET的區別如果不清楚,可以參考http://www.dotblogs.com.tw/jimmyyu/archive/2010/10/16/difference-between-get-and-post.aspx

雖然已經清楚POST跟GET的差異,但今天突然從Script Documents看到,真是感動...
原來有這麼多小工具阿~鳩貼心ㄟ


POST





GET






有沒有很直覺阿~

2010年10月14日 星期四

[ASP.NET]解決 這個頁面的狀態資訊無效,而且可能已經損毀(Solve this page status information is invalid, and may have been destroyed)


問題

這個頁面的狀態資訊無效,而且可能已經損毀
在開發使用jQuery UI 的 jquery.dataTables.js 與jquery.jeditable.js plugin做出來的Gridview效果,並可即時編輯,而編輯後將資訊送出,此做法大量減少當資料量多時postback所帶來的問題,畫面如下:
Capture3
而在編輯該欄位後,按下ENTER,則會將資料送往指定的頁面處理,而採用非同步的方式,因此減少資料的傳輸數量

語法如下:
<script src='js/jquery.js' type='text/javascript'></script>   
<script src='js/jquery.dataTables.js' type='text/javascript'></script>    
<script type='text/javascript' language='javascript' src='js/jquery.jeditable.js'></script>    
<script type='text/javascript' charset='utf-8'>    
    function test() {    
        var btn = document.getElementById("Button1");    
        btn.click();    
    }    
    var aDataSet = [    
                ['Trident', 'Internet Explorer 4.0', 'Win 95+', '4', 'X'],    
                ['Trident', 'Internet Explorer 5.0', 'Win 95+', '5', 'C']    ];
    $(document).ready(function() {   
        $('#dynamic').html("<table cellpadding='0' cellspacing='0' border='0' class='display' id='example'></table>");
        $('#example').dataTable({   
            'aaData': aDataSet,    
            'aoColumns': [    
                          { 'sTitle': 'Engine' },    
                          { 'sTitle': 'Browser' },    
                          { 'sTitle': 'Platform' },    
                          { 'sTitle': 'Version', 'sClass': 'center' },    
                                  {    
                                     'sTitle': 'Grade',    
                                     'sClass': 'center',    
                                     'fnRender': function(obj) {    
                                      var sReturn = obj.aData[obj.iDataColumn];    
                                                    if (sReturn == 'A') {    
                                                        sReturn = '<b>A</b>';    
                                                    }    
                                                    return sReturn;    
                                                }    
                                            }    
                                        ]    
        });    
        var oTable = $('#example').dataTable();
        /* Apply the jEditable handlers to the table */   
        $('td', oTable.fnGetNodes()).editable('UpdateExcel.aspx', {    
            'submitdata': function(value, settings) {    
                return {    
                    'row_id': this.parentNode.getAttribute('id'),    
                    'column': oTable.fnGetPosition(this)[2]    
                };    
            }    
        });    
    });    
</script >

在'submitdata'裡可以加上你要傳到處理更新資料的頁面的所需資料
網頁寫好後,也都正確執行,但加入了SERVER端的BUTTON後,卻發生了問題
Capture4

花了2小時多找了相關資訊,終於找正解!!




解決方法

原來是出於微軟自訂義的訊息,當asp.net頁面被javascript修改後,會造成ViewState與原先的資訊無法驗證而錯誤

http://forums.asp.net/p/955145/1173230.aspx 最底下的回覆
http://brunhild194.pixnet.net/blog/post/31279292
修改如下:
.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="testPageaspx.aspx.cs" Inherits="testPageaspx" enableEventValidation="false" %>
.cs
public partial class testPageaspx : System.Web.UI.Page   
{
    protected override object LoadPageStateFromPersistenceMedium()     
    {      
        return null;      
    }
    protected override void SavePageStateToPersistenceMedium(object viewState)     
    {       

    }
    protected void Page_Load(object sender, EventArgs e)    
    {
    }   
    protected void Button1_Click(object sender, EventArgs e)    
    {
    }   
}

如此一來,問題就可以解決了!

另外dataTables當修改資料後,可能會需要傳回某cell當key值去更新資料,所以自己加了一個function在裡面去取的key值
程式碼如下(加在改在dataTables.js裡)
this.fnGetRowIndex = function(nNode) {   
    var oSettings = _fnSettingsFromNode(this[_oExt.iApiIndex]);
    if (nNode.nodeName.toUpperCase() == "TR") {   
        return _fnNodeToDataIndex(oSettings, nNode);    
    }    
    else if (nNode.nodeName.toUpperCase() == "TD") {    
        var iDataIndex = _fnNodeToDataIndex(oSettings, nNode.parentNode);    
        return oSettings.aoData[iDataIndex]._aData[0];//由此決定傳回哪一個column的值   
    }    
    return null;    
};

2010年10月4日 星期一

[ASP.NET]解決 Server was unable to process request. --> File or assembly name xxx, or one of its dependencies, was not found.


問題

在連線WebSite Application時發現以下錯誤:
xxx為隨機產生的dll
Server was unable to process request. --> File or assembly name hzh4pgkw.dll, or one of its dependencies, was not found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.



解決方法

在Windows\Temp的Folder裡加上Everyone的使用者,權限給予FullControl(完全控制)
參考:http://support.microsoft.com/default.aspx?scid=kb;en-us;322886

或是清除temporary asp.net files資料夾的暫存檔

2010年9月2日 星期四

[ASP.NET]解決 用來執行 ASP.NET 的處理序帳戶必須擁有 IIS Metabase (例如 IIS://servername/W3SVC) 的讀取權限。如需修改 Metabase 使用權限的詳細資訊,請參閱 http://support.microsoft.com/?kbid=267904。(Resolved to execute the processing sequence ASP.NET account must have IIS Metabase: Read permission (for example, IIS // servername / W3SVC) of. For more information Metabase modify permissions, see http://support.microsoft.com/?kbid=267904.)


問題

用來執行 ASP.NET 的處理序帳戶必須擁有 IIS Metabase (例如 IIS://servername/W3SVC) 的讀取權限。如需修改 Metabase 使用權限的詳細資訊,請參閱 http://support.microsoft.com/?kbid=267904。(Resolved to execute the processing sequence ASP.NET account must have IIS Metabase: Read permission (for example, IIS // servername / W3SVC) of. For more information Metabase modify permissions, see http://support.microsoft.com/?kbid=267904.)



解決方法

會顯示這樣的訊息常見情境:
    • 已經安裝好.NET Framework 2.0的機器,事後才加裝IIS
    • IIS被移除重裝過
一般來說,安裝.NET Framework 2.0時,若安裝程式偵測到機器上有IIS,會向IIS註冊以便能執行ASP.NET 2.0。
若先裝了.NET 2.0才裝IIS,就漏掉這個一註冊ASP.NET程序了(不過就算沒註冊,IIS的應用程式選項裡還是可以看到ASP.NET 2.0,讓人誤以為ASP.NET 2.0已裝好),必須手動執行

在Visual Studio Tools -> Visual Studio 2005 Command Prompt 中執行
aspnet_regiis -i  重新安裝 .net framework就可以了

2010年7月1日 星期四

[ASP.NET]在IIS底下對Access執行資料異動,傳回錯誤訊息(System.Data.OleDb.OleDbException: 運作必須使用更新查詢。 於 System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) 於 System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) 於 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) 於 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) )(Access under IIS to perform data movement returned an error message (System.Data.OleDb.OleDbException:. Operation must use an update query to System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling (OleDbHResult hr) in System.Data.OleDb.OleDbCommand .ExecuteCommandTextForSingleResult (tagDBPARAMS dbParams, Object & amp; executeResult) in System.Data.OleDb.OleDbCommand.ExecuteCommandText (Object & amp; executeResult) in System.Data.OleDb.OleDbCommand.ExecuteCommand (CommandBehavior behavior, Object & amp; executeResult)))


問題

在IIS底下對Access執行資料異動,傳回錯誤訊息 System.Data.OleDb.OleDbException: 運作必須使用更新查詢。 於 System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) 於 System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) 於 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) 於 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) )(Access under IIS to perform data movement returned an error message (System.Data.OleDb.OleDbException:. Operation must use an update query to System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling (OleDbHResult hr) in System.Data.OleDb.OleDbCommand .ExecuteCommandTextForSingleResult (tagDBPARAMS dbParams, Object & amp; executeResult) in System.Data.OleDb.OleDbCommand.ExecuteCommandText (Object & amp; executeResult) in System.Data.OleDb.OleDbCommand.ExecuteCommand (CommandBehavior behavior, Object & amp; executeResult)))

查看事件檢視器如下:
Capture
原因是沒有權限造成!!

解決方法

打開檔案總管=>點選上方的"工具"=>資料夾選項=>檢視=>"使用簡易的檔案共用"將這個勾勾取消掉
Capture2
之後按下確定
再把你的access資料庫檔案=>右鍵"內容"=>安全性
預設是只能讀取跟執行
Capture3
設定User這個帳號可以寫入
Capture4

2010年5月29日 星期六

[Web]URL Encoding 大哉問


問題

URL Encoding 大哉問



解決方法

昏倒~又卡在這個關卡....終於用爛方法搞定

"源來"看這邊

背景提要:開發是用ASP.NET,WebService,Flash技術
程式流程:
1.ASP.NET網頁在接到上一頁面所傳的值以後,傳入Flash程式,傳入方式採用Literal控制項.
2.Flash呼叫WebService所做資料的擷取與運算.
3.由於傳值到ASP.NET網頁的方式是採取Get的方式傳值,所以在傳值之前都已經加密,而解米密的動作則做在WebService,好處是可以確保資料的安全性,不易暴露在外

問題:ASP.NET接收與WebServices乃同一個SampleCode所加密出來的資料,奇怪的是WebService會解密失敗??

為此,去仔細的看了一下WebService的code,還真是奇怪,明明上一篇所說的問題已經解決了,怎麼又會突然"某些"加密後的資料又被Decode,造成解密長度錯誤的Exception....

debug去看了一下資料....挖哩~Flash傳進來的值....怎麼會是Decode之後的值呢???
原來Flash在接到ASP.NET所傳的值以後,會"自己"Decode....


好吧~原來問題的核心終於找到了~出在Flash!

那該怎麼解呢?WebService再把Flash傳進來的值Encode嗎?
試試看好了....不行,問題還在!傳進來的資料一樣是被Decode掉,我要的原始的資料!!

那...把傳進Flash之前的資料在加一次Encode??

...可以呢!

Flash終於傳進一模一樣的值了~謝天謝地...

2010年5月27日 星期四

[Web]URL Encoding 簡單的介紹

昨天客戶那邊給了一個bug,問題是說"加密後的資料"傳到WebService時,解密的時候會出現錯誤,導致程式結果錯誤


為了這個問題,我仔細的看了自己的WebService的解密方式,也確認了與客戶當初所說的一致


但客戶給了SampleCode裡的加解密方式,當初是原封不動的加入程式再呼叫而已...問題出在哪?


為此問題找了一下解答,才發現,
是客戶"加密後的資料",雖用同一支SamlpeCode加密而成,但並未使用HttpUtility.HtmlEncode(),導致好死不死的,加密後的資料有20%3d%3d,
而在WebService裡又使用HttpUtility.HtmlDecode()先轉譯,導致20的部份轉譯成"空白",
傳入SamlpeCode裡解密時,造成64bit長度不符的Exception
(好笑的是我花了兩個小時才發現,之前用debug的方式在找,都看不出來,
直到貼到notepad上才看到~昏倒)

為此找個一些資料做整理,原始出處於URL Encoding


"Reserved characters"
    Why:URLs use some characters for special use in defining their syntax. When these characters are not used in their special role inside a URL, they need to be encoded.
Characters:
CharacterCode
Points
(Hex)
Code
Points
(Dec)
 Dollar ("$")
 Ampersand ("&")
 Plus ("+")
 Comma (",")
 Forward slash/Virgule ("/")
 Colon (":")
 Semi-colon (";")
 Equals ("=")
 Question mark ("?")
 'At' symbol ("@")
24
26
2B
2C
2F
3A
3B
3D
3F
40
36
38
43
44
47
58
59
61
63
64
"Unsafe characters"
    Why:Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded.
Characters:
CharacterCode
Points
(Hex)
Code
Points
(Dec)
Why encode?
Space2032Significant sequences of spaces may be lost in some uses (especially multiple spaces)
Quotation marks
'Less Than' symbol ("<")
'Greater Than' symbol (">")
22
3C
3E
34
60
62
These characters are often used to delimit URLs in plain text.
'Pound' character ("#")2335This is used in URLs to indicate where a fragment identifier (bookmarks/anchors in HTML) begins.
Percent character ("%")2537This is used to URL encode/escape other characters, so it should itself also be encoded.
Misc. characters:
   Left Curly Brace ("{")
   Right Curly Brace ("}")
   Vertical Bar/Pipe ("|")
   Backslash ("\")
   Caret ("^")
   Tilde ("~")
   Left Square Bracket ("[")
   Right Square Bracket ("]")
   Grave Accent ("`")

7B
7D
7C
5C
5E
7E
5B
5D
60

123
125
124
92
94
126
91
93
96
Some systems can possibly modify these characters.


看到了嗎?就是因為出現"20"導致Decode時,將之轉成"空白"~真是冤忘阿!!

哈哈~要來去跟客戶請錢了,竟然害我做白工~~

以上

熱門文章