UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (21)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
  • API串接 (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • 7082121121
  • image
  • [t],
  • c
  • 2VcOh0l5
  • ef
  • 50
  • json212112
  • 6763
  • mrtg 連接數
  • firewall O
  • cookie
  • javascript
  • sftp
  • editor
  • a
  • 威勝
  • db
  • egs
  • vpn
  • s3,
  • asp.net#we
  • SSL
  • 4hew.com
  • 250
  • 858
  • 888
  • utf8
  • dotnet
  • 116
  • -3968
  • ti
  • -5197
  • 108
  • 5669
  • The servic
  • send mail,
  • 資安
  • 0
  • json
  • DxHizbmA
  • MScvKiovQU
  • 8
  • EN,
  • 四拾五入
  • 212
  • column
  • git
  • Contains
  • 126
頁數 38 / 55 上一頁 下一頁
搜尋 結果:
jquery 中判斷 checkbox 是否選取的不要再用 attr 要改用 prop
最近為了在 iframe 中的 history.goback 的問題,把後台的 jquery 升級到 1.10.1 版,結果發生讓 checkbox 全選的語法無效,原來是 attr('checked') 在 1.10.1 版中不會隨著 checkbox 是否選取而改變。


<input type="checkbox" onclick="if ($(this).attr('checked')) { $('.cbProducts').attr('checked', true) } else { $('.cbProducts').attr('checked', false) }" />

要換成

<input type="checkbox" onclick="if ($(this).prop('checked')) { $('.cbProducts').prop('checked', true) } else { $('.cbProducts').prop('checked', false) }" />


不過很麻煩節是,若是 jquery 1.5.x 及以前的版本是不支援 prop 的,請參考文章:
http://blog.xuite.net/vexed/tech/44905647-jQuery+1.6+.attr()+%E5%92%8C+.prop()

我先把後台的 MasterPageWithForm.master 由 1.10.1 改回 1.6.2 版, MasterPage.master 和 MasterPage_NoMenu.master 兩支程式的 jquery 由 1.5.1 改到 1.6.2 版。未來要升級 1.10.1 以上的版本時可能會需要大工程把 attr 改為 prop。 或是考慮用 

$.fn.attr = $.fn.prop;

來把整個 attr 改為 prop


 
More...
Bike, 2014/2/23 上午 02:57:24
VirtualPath 不在目前應用程式根目錄中。
用 Visual Studio 2013 時會遇到這個問題,解法如下:

http://techatplay.wordpress.com/2013/10/24/vs2013-asp-net-application-error-virtualpath-was-outside-the-current-application-root/

要關閉 "啟用瀏覽器連結" 的功能。

 
 
More...
Bike, 2014/2/13 下午 01:45:17
解決 Chrome 在開啟的 Fancybox 之中的 iframe 無法使用 history.back 的問題
若是用 Chrome 開了一個 fancybox ,在 iframe 中的網頁執行了 history.back 會把 fancybox 關掉而不是回到上一頁,這會造成 UW.WU.ShowMessageAndBack 等等利用 history.back 的 function 無法使用。
 
在多次測試後,很神奇的發現,若是在 iframe 中再進入第二頁,第二頁就可以用 history.back 了。

所以寫了一個 UW.WU.DelayRedirect(),若是某個頁面是要在 fancybox 的 iframe 中執行,就在 PageLoad 加一個


If UW.WU.GetValueFromQueryStringOrForm("Action").ToLower = "delayredirect" Then
            UW.WU.DelayRedirect()
End If


在 a 的 href 中多加一個 Action=DelayRedirect,預設就會在 500 ms 之後重新載入這個頁面 (新網址是 UW.WU.UrlWithNewTFWithoutAction)。
 
More...
Bike, 2014/2/12 下午 06:16:59
尋找 Aspnet_regsql.exe 的正確版本

參考網址:http://msdn.microsoft.com/zh-tw/library/ms229862(v=vs.100).aspx#findingthecorrectversion

Aspnet_regsql.exe 安裝在 Microsoft .NET Framework 目錄中。 如果電腦正在並存執行多個 .NET Framework 版本,就可能會安裝此工具的多個版本。 下表將針對不同的 .NET Framework 版本列出此工具的安裝位置。

 

.NET Framework 的版本

Aspnet_regsql.exe 檔案的位置

.NET Framework 2.0 版、3.0 版和 3.5 版 (32 位元系統)

%windir%\Microsoft.NET\Framework\v2.0.50727

.NET Framework 2.0 版、3.0 版和 3.5 版 (64 位元系統)

%windir%\Microsoft.NET\Framework64\v2.0.50727

.NET Framework 4 版 (32 位元系統)

%windir%\Microsoft.NET\Framework\v4.0.30319

.NET Framework 4 版 (64 位元系統)

%windir%\Microsoft.NET\Framework64\v4.0.30319

More...
Doug, 2014/2/10 下午 12:20:20
無法對應路徑 '/' (Visual Studio 要用管理員權限來執行)
今天在 Visual Studio 2012 發生無法對應路徑 '/' 的錯誤,且 auto complete 失效, int32 都不認得。結果解決方式竟然是要用管理員的權限來執行 VS2012 然後再開啟 sln 檔,真是令人傻眼。

darren 補充:
請到此目錄 C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
設定 devenv.exe 為管理者權限開啟



很神奇,在 Windows 8.1 的 devenv.exe 沒有相容性的 tag, 改了一些顯示相容性的 registry 也都沒有用,後來找到一個解法: http://superuser.com/questions/465065/no-compatibility-tab-for-devenv-exe-vs-2010-and-vs-2012-on-windows-8
主要內容如下:
Rightklick devenv.exe and choose Troubleshoot compatibility. In the new window click atTroubleshoot programm, then check The programm requires additional permission.

補上:
這個執行檔也要設定

C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VSLauncher.exe
 
More...
Bike, 2014/1/23 下午 09:09:14
SqlDependency 之 Stored Procedure
SqlDependency 的原理是對某些目標 table 設定所謂的 ChangeId
資料存在 dob.[AspNet_SqlCacheTablesForChangeNotification]
當目標 Table 有 Insert, Update, Delete 時會 Trigger 把 ChangeId + 1
而前端網站就是不斷定時詢問此 [AspNet_SqlCacheTablesForChangeNotification] 的 ChangeId


-- 新增目標 Table 加入 SqlDependency (此範例 MenuFirst是 table name)
Exec dbo.AspNet_SqlCacheRegisterTableStoredProcedure N'MenuFirst'

-- 直接變更 ChangeId (效果等同於去變更該table資料)
-- 會去將 ChangeId + 1
EXEC dbo.AspNet_SqlCacheUpdateChangeIdStoredProcedure N'MenuFirst'


AspNet_SqlCacheUpdateChangeIdStoredProcedure 通常是不需要做的
因為目標table都有設定 Trigger
但是在某些狀況下 目標table資料沒有變更 但是也希望前端cache要更新
就可以用此 SP
 
More...
darren, 2014/1/21 下午 12:25:33
[SQL] 簡體字存入資料庫之亂碼
Question :  update sql 若有簡體字. 會出現? 
Sol :   '  '   在加字串第一個的 ' (單引號)  前 加上 N  (大寫)
資料庫型態須定義為 ntext 或是 nchar , nvarchar
若定義成一般習慣前面未加 'N' 使用 Big-5 
 
More...
Vicky, 2014/1/20 上午 09:52:18
Send Mail by godaddy
Sub SendMail_godaddy(ByVal Subject As String, ByVal Body As String, ByVal FromMail As String, ByVal ToMail As String)
        Dim objMail As New System.Web.Mail.MailMessage()

        objMail.From = FromMail
        objMail.To = ToMail
        objMail.Subject = Subject
        objMail.BodyFormat = Mail.MailFormat.Html
        objMail.Priority = Mail.MailPriority.High
        objMail.Body = Body

        System.Web.Mail.SmtpMail.SmtpServer = UW.Mail.SMTP_SERVER_NAME
        System.Web.Mail.SmtpMail.Send(objMail)
    End Sub
More...
Reiko, 2014/1/17 下午 02:50:53
Send Mail By gmail SMTP
Sub SendMail_gmail(ByVal Subject As String, ByVal Body As String, ByVal FromMail As String, ByVal ToMail As String)
        Dim msg As New System.Net.Mail.MailMessage

        Dim client As New System.Net.Mail.SmtpClient
        Try

            msg.Subject = Subject
            msg.Body = Body
            msg.From = New System.Net.Mail.MailAddress(FromMail)
            msg.To.Add(ToMail)
            msg.IsBodyHtml = True

            client.Host = "smtp.gmail.com"
            Dim basicauthenticationinfo As System.Net.NetworkCredential = New System.Net.NetworkCredential("username@gmail.com", "password")
            client.Port = Int32.Parse("587")
            client.EnableSsl = True
            client.UseDefaultCredentials = False
            client.Credentials = basicauthenticationinfo
            client.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
            client.Send(msg)

        Catch ex As Exception
            UW.WU.DebugWriteLine(ex.ToString, True, True)
        End Try

    End Sub
More...
Reiko, 2014/1/17 下午 02:48:37
[程式片段][後台]VB懶惰版快取
        
'更新
        If UW.WU.IsNonEmptyFromQueryStringOrForm("Refresh") Then
            System.Web.HttpContext.Current.Cache.Remove(CacheName)
        End If
        '快取部分
        If obj Is Nothing Then
            Dim SQL As String = ""
            SQL = "select * from Product with (nolock)"
            obj = UW.SQL.DTFromSQL(SQL)

            Dim AC As New AggregateCacheDependency

            Dim DepArray() As CacheDependency = { _
                 New SqlCacheDependency(UW.SQL.sqlCacheDependencyName, "Product"), _
                 New SqlCacheDependency(UW.SQL.sqlCacheDependencyName, "Product_Category") _
            }

            AC.Add(DepArray)
            Dim FD As New CacheDependency(UW.Template.TemplateRoot & "2013UI\Product\DirectBuyAllProduct.html")
            AC.Add(FD)

            System.Web.HttpContext.Current.Cache.Insert(CacheName, obj, AC)

        End If
More...
Doug, 2014/1/15 下午 02:12:27
|< …29303132333435363738… >|
頁數 38 / 55 上一頁 下一頁
~ Uwinfo ~