| 方法 | 描述 |
|---|---|
| Analytics.GetGoogleHtml(webPropertyId) | 渲染指定 GA 追蹤 ID 的 JavaScript 程式碼 |
| Analytics.GetStatCounterHtml(project, security) | 渲染 StatCounter 分析追蹤碼 |
| Analytics.GetYahooHtml(account) | 渲染 Yahoo Analytics 追蹤碼 |
| 方法 | 描述 |
|---|---|
| Bing.SearchBox([boxWidth]) | 嵌入 Bing 搜尋框,可設定 SiteUrl、SiteTitle (通常在 _AppStart 設定) |
| Bing.AdvancedSearchBox([boxWidth, resultWidth, resultHeight, themeColor, locale]) | 進階搜尋結果嵌入,支援自訂寬高、主題色、地區設定 |
| 方法 | 描述 |
|---|---|
| Chart(width, height [, template] [, templatePath]) | 初始化圖表物件,設定寬高、選用樣板 |
| Chart.AddLegend([title] [, name]) | 新增圖例 |
| Chart.AddSeries([name] [, chartType] [, chartArea] [, axisLabel] [, legend] [, markerStep] [, xValue] [, xField] [, yValues] [, yFields] [, options]) | 新增資料系列,支援多種圖表類型 (column, bar, line, pie, area 等) |
| 方法 | 描述 |
|---|---|
| Crypto.Hash(string [, algorithm]) | 字串雜湊,預設 SHA256,支援 MD5、SHA1、SHA384、SHA512 |
| Crypto.Hash(bytes [, algorithm]) | 位元組陣列雜湊 |
| 方法 | 描述 |
|---|---|
| Facebook.LikeButton(href [, buttonLayout] [, showFaces] [, width] [, height] [, action] [, font] [, colorScheme] [, refLabel]) | 嵌入 Facebook 讚按鈕,支援版面、臉部顯示、尺寸、動作類型、字型、配色 |
| 方法 | 描述 |
|---|---|
| FileUpload.GetHtml([initialNumberOfFiles] [, allowMoreFilesToBeAdded] [, includeFormTag] [, addText] [, uploadText]) | 渲染檔案上傳介面,支援多檔、自訂按鈕文字 |
| 方法 | 描述 |
|---|---|
| GamerCard.GetHtml(gamerTag) | 渲染指定 Xbox Gamertag 玩家卡片 |
| 方法 | 描述 |
|---|---|
| Gravatar.GetHtml(email [, imageSize] [, defaultImage] [, rating] [, imageExtension] [, attributes]) | 依 Email 產生 Gravatar 圖片,支援尺寸、預設圖、分級、副檔名、HTML 屬性 |
| 方法 | 描述 |
|---|---|
| Json.Encode(object) | 物件序列化為 JSON 字串 |
| Json.Decode(string) | JSON 字串反序列化為動態物件 |
| 方法 | 描述 |
|---|---|
| LinkShare.GetHtml(pageTitle [, pageLinkBack] [, twitterUserName] [, additionalTweetText] [, linkSites]) | 產生社群分享連結 (Facebook、Twitter、LinkedIn 等) |
| 方法/屬性 | 描述 |
|---|---|
| ModelStateDictionary.AddError(key, errorMessage) | 關聯錯誤訊息至表單欄位 |
| ModelStateDictionary.AddFormError(errorMessage) | 關聯錯誤訊息至整個表單 |
| ModelStateDictionary.IsValid | 無驗證錯誤時回傳 true |
| 方法 | 描述 |
|---|---|
| ObjectInfo.Print(value [, depth] [, enumerationLength]) | 遞迴列印物件所有屬性與值,適合偵錯 |
| 方法/屬性 | 描述 |
|---|---|
| ReCaptcha.GetHtml([publicKey] [, theme] [, language] [, tabIndex]) | 渲染 reCAPTCHA 驗證元件 |
| ReCaptcha.PublicKey / PrivateKey | 設定金鑰 (通常在 _AppStart 設定) |
| ReCaptcha.Validate([privateKey]) | 驗證使用者回應,回傳驗證結果 |
| 方法 | 描述 |
|---|---|
| Twitter.Profile(twitterUserName) | 顯示指定使用者推文時間軸 |
| Twitter.Search(searchQuery) | 顯示指定關鍵字搜尋結果 |
| 方法 | 描述 |
|---|---|
| Video.Flash(filename [, width, height]) | Flash 影片播放器 |
| Video.MediaPlayer(filename [, width, height]) | Windows Media Player |
| Video.Silverlight(filename, width, height) | Silverlight 播放器 (.xap 檔案) |
| 方法 | 描述 |
|---|---|
| WebCache.Get(key) | 取得快取物件,不存在回傳 null |
| WebCache.Remove(key) | 移除指定快取 |
| WebCache.Set(key, value [, minutesToCache] [, slidingExpiration]) | 寫入快取,支援滑動過期 (每次存取重設計時) |
| 方法 | 描述 |
|---|---|
| WebGrid(data) | 以查詢資料建立 WebGrid 實例 |
| WebGrid.GetHtml() | 渲染 HTML 表格 |
| WebGrid.Pager() | 渲染分頁導航 |
| 方法 | 描述 |
|---|---|
| WebImage(path) | 從路徑載入影像 |
| WebImage.AddImagesWatermark(image) | 加入圖片浮水印 |
| WebImage.AddTextWatermark(text) | 加入文字浮水印 |
| WebImage.FlipHorizontal() / FlipVertical() | 水平/垂直翻轉 |
| WebImage.GetImageFromRequest() | 從上傳要求載入影像 |
| WebImage.Resize(width, height) | 調整尺寸 |
| WebImage.RotateLeft() / RotateRight() | 左右旋轉 90 度 |
| WebImage.Save(path [, imageFormat]) | 儲存影像 |