ASP.NET ဝဘ်စာမျက်နှာများ - အကူအညီပေးသူများ
Web Helpers သည် ဝဘ်ဖွံ့ဖြိုးတိုးတက်မှုနှင့် ဘုံပရိုဂရမ်ရေးဆွဲခြင်းလုပ်ငန်းများကို များစွာရိုးရှင်းစေသည်။
ASP.NET အကူအညီများ
ASP.NET helpers များသည် Razor ကုဒ်လိုင်းတစ်ခုတည်းဖြင့် ဝင်ရောက်နိုင်သော အစိတ်အပိုင်းများဖြစ်သည်။
.cshtml ဖိုင်များအဖြစ် သိမ်းဆည်းထားသော Razor syntax ကို အသုံးပြု၍ သင့်ကိုယ်ပိုင်အကူအညီများကို တည်ဆောက်နိုင်သည် သို့မဟုတ် built-in ASP.NET အကူအညီများကို အသုံးပြုနိုင်သည်။
ဤကျူတိုရီရယ်၏ နောက်အခန်းများတွင် Razor helpers ကို မည်သို့အသုံးပြုရမည်ကို သင်လေ့လာနိုင်မည်ဖြစ်ပါသည်။
အောက်တွင် အသုံးဝင်သော Razor helpers အချို့၏ အတိုချုံးဖော်ပြချက်ဖြစ်ပါသည်။
WebGrid အကူအညီပေးသူ
WebGrid အကူအညီပေးသူက ဒေတာပြသရန် နည်းလမ်းကို ရိုးရှင်းစေသည်-
- ဒေတာပြသရန် HTML ဇယားကို အလိုအလျောက် သတ်မှတ်ပေးသည်။
- ဖော်မတ်ချခြင်းအတွက် မတူညီသောရွေးချယ်စရာများကို ပံ့ပိုးပေးသည်။
- ဒေတာမှတဆင့် pageaging (ပထမ၊ နောက်၊ ယခင်၊ နောက်ဆုံး) ကိုပံ့ပိုးသည်။
- ကော်လံခေါင်းစီးများကိုနှိပ်ခြင်းဖြင့် စီခြင်းအား ပံ့ပိုးပေးသည်။
ဇယားအကူ
"ဇယားကွက်အကူအညီပေးသူ" သည် ပုံစံချခြင်းရွေးချယ်စရာများနှင့် အညွှန်းများစွာဖြင့် မတူညီသောအမျိုးအစားများ၏ဇယားပုံများကို ပြသနိုင်သည်။
Chart helper သည် arrays များ၊ databases များမှ သို့မဟုတ် files များမှ data များကို ပြသနိုင်ပါသည်။
WebMail အကူအညီပေးသူ
WebMail ကူညီသူသည် SMTP (Simple Mail Transfer Protocol) ကို အသုံးပြု၍ အီးမေးလ်စာတိုပေးပို့ခြင်းအတွက် လုပ်ဆောင်ချက်များကို ပံ့ပိုးပေးပါသည်။
WebImage Helper
WebImage helper သည် ဝဘ်စာမျက်နှာရှိ ပုံများကို စီမံခန့်ခွဲရန် လုပ်ဆောင်နိုင်စွမ်းကို ပေးပါသည်။
သော့ချက်စာလုံးများ- လှန်၊ လှည့်၊ အရွယ်အစားပြောင်း၊ ရေစာ။
ပြင်ပအကူအညီပေးသူများ
Razor ဖြင့် သင်သည် အီးမေးလ်၊ ဒေတာဘေ့စ်များ၊ မာလ်တီမီဒီယာနှင့် လူမှုကွန်ရက်များအသုံးပြုမှုကို ရိုးရှင်းလွယ်ကူစေရန် တပ်ဆင်ထားသော သို့မဟုတ် ပြင်ပအကူအညီပေးသူများကို အခွင့်ကောင်းယူနိုင်သည်။
ပိုင်းခြားစိတ်ဖြာချက် (Google)
Helper | Description |
---|---|
Analytics.GetGoogleHtml(webPropertyId) | Renders the Google Analytics JavaScript code for the specified ID. |
Analytics.GetStatCounterHtml(project, security) | Renders the StatCounter Analytics JavaScript code for the specified project. |
Analytics.GetYahooHtml(account) | Renders the Yahoo Analytics JavaScript code for the specified account. |
Bing
Helper | Description |
---|---|
Bing.SearchBox([boxWidth]) | Passes a search to Bing. To specify the site to search and a title for the search box, you can set the Bing.SiteUrl and Bing.SiteTitle properties. Normally you set these properties in the _AppStart page. |
Bing.AdvancedSearchBox([, boxWidth] [,
resultWidth] [, resultHeight] [, themeColor] [, locale]) | Displays Bing search results in the page with optional formatting. To specify the site to search and a title for the search box, you can set the Bing.SiteUrl and Bing.SiteTitle properties. Normally you set these properties in the _AppStart page. |
Crypto
Helper | Description |
---|---|
Crypto.Hash(string [, algorithm])
Crypto.Hash(bytes [, algorithm]) | Returns a hash for the specified data. The default algorithm is sha256. |
Helper | Description |
---|---|
Facebook.LikeButton(href [,
buttonLayout] [, showFaces] [, width] [, height] [, action] [, font] [, colorScheme] [, refLabel]) | Lets Facebook users make a connection to pages. |
ဖိုင်တင်ခြင်း။
Helper | Description |
---|---|
FileUpload.GetHtml([initialNumberOfFiles]
[, allowMoreFilesToBeAdded] [, includeFormTag] [, addText] [, uploadText]) | Renders UI for uploading files. |
GamerCard
Helper | Description |
---|---|
GamerCard.GetHtml(gamerTag) | Renders the specified Xbox gamer tag. |
Gravatar Object အကိုးအကား
Helper | Description |
---|---|
Gravatar.GetHtml(email [, imageSize]
[, defaultImage] [, rating] [, imageExtension] [, attributes]) | Renders the Gravatar image for the specified email address. |
Json
Helper | Description |
---|---|
Json.Encode(object) | Converts a data object to a string in the JavaScript Object Notation (JSON) format. |
Json.Decode(string) | Converts a JSON-encoded input string to a data object that you can iterate over or insert into a database. |
LinkShare
Helper | Description |
---|---|
LinkShare.GetHtml(pageTitle [,
pageLinkBack] [, twitterUserName] [, additionalTweetText] [, linkSites]) | Renders social networking links using the specified title and optional URL. |
ModelState
Helper | Description |
---|---|
ModelStateDictionary.AddError(key, errorMessage) | Associates an error message with a form field. Use the ModelState helper to access this member. |
ModelStateDictionary.AddFormError(errorMessage) | Associates an error message with a form. Use the ModelState helper to access this member. |
ModelStateDictionary.IsValid | Returns true if there are no validation errors. Use the ModelState helper to access this member. |
ObjectInfo
Helper | Description |
---|---|
ObjectInfo.Print(value [, depth] [, enumerationLength]) | Renders the properties and values of an object and any child objects. |
Recaptcha
Helper | Description |
---|---|
Recaptcha.GetHtml([, publicKey] [, theme] [, language] [, tabIndex]) | Renders the reCAPTCHA verification test. |
ReCaptcha.PublicKey ReCaptcha.PrivateKey | Sets public and private keys for the reCAPTCHA service. Normally you set these properties in the _AppStart page. |
ReCaptcha.Validate([, privateKey]) | Returns the result of the reCAPTCHA test. |
ဆာဗာအင်ဖို
Helper | Description |
---|---|
ServerInfo.GetHtml() | Renders status information about ASP.NET Web Pages. |
တွစ်တာ
Helper | Description |
---|---|
Twitter.Profile(twitterUserName) | Renders a Twitter stream for the specified user. |
Twitter.Search(searchQuery) | Renders a Twitter stream for the specified search text. |
ဗီဒီယို
Helper | Description |
---|---|
Video.Flash(filename [, width, height]) | Renders a Flash video player for the specified file with optional width and height. |
Video.MediaPlayer(filename [, width, height]) | Renders a Windows Media player for the specified file with optional width and height. |
Video.Silverlight(filename, width, height) | Renders a Silverlight player for the specified .xap file with required width and height. |
WebCache
Helper | Description |
---|---|
WebCache.Get(key) | Returns the object specified by key, or null if the object is not found. |
WebCache.Remove(key) | Removes the object specified by key from the cache. |
WebCache.Set(key, value [, minutesToCache] [, slidingExpiration]) | Puts value into the cache under the name specified by key. |
WebImage
Helper | Description |
---|---|
WebImage(path) | Loads an image from the specified path. |
WebImage.AddImagesWatermark(image) | Adds the specified image as a watermark. |
WebImage.AddTextWatermark(text) | Adds the specified text to the image. |
WebImage.FlipHorizontal() WebImage.FlipVertical() | Flips the image horizontally or vertically. |
WebImage.GetImageFromRequest() | Loads an image when an image is posted to a page during a file upload. |
WebImage.Resize(width, height) | Resizes the image. |
WebImage.RotateLeft() WebImage.RotateRight() | Rotates the image to the left or the right. |
WebImage.Save(path [, imageFormat]) | Saves the image to the specified path. |