久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='cF82e'></bdo><ul id='cF82e'></ul>

        <i id='cF82e'><tr id='cF82e'><dt id='cF82e'><q id='cF82e'><span id='cF82e'><b id='cF82e'><form id='cF82e'><ins id='cF82e'></ins><ul id='cF82e'></ul><sub id='cF82e'></sub></form><legend id='cF82e'></legend><bdo id='cF82e'><pre id='cF82e'><center id='cF82e'></center></pre></bdo></b><th id='cF82e'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cF82e'><tfoot id='cF82e'></tfoot><dl id='cF82e'><fieldset id='cF82e'></fieldset></dl></div>

        <small id='cF82e'></small><noframes id='cF82e'>

        <legend id='cF82e'><style id='cF82e'><dir id='cF82e'><q id='cF82e'></q></dir></style></legend>

        <tfoot id='cF82e'></tfoot>
      1. masterpage initializeculture 找不到合適的方法來覆蓋錯

        masterpage initializeculture no suitable method found to override error?(masterpage initializeculture 找不到合適的方法來覆蓋錯誤?)

      2. <legend id='vmI33'><style id='vmI33'><dir id='vmI33'><q id='vmI33'></q></dir></style></legend>

        <small id='vmI33'></small><noframes id='vmI33'>

            <bdo id='vmI33'></bdo><ul id='vmI33'></ul>
          • <tfoot id='vmI33'></tfoot>
            <i id='vmI33'><tr id='vmI33'><dt id='vmI33'><q id='vmI33'><span id='vmI33'><b id='vmI33'><form id='vmI33'><ins id='vmI33'></ins><ul id='vmI33'></ul><sub id='vmI33'></sub></form><legend id='vmI33'></legend><bdo id='vmI33'><pre id='vmI33'><center id='vmI33'></center></pre></bdo></b><th id='vmI33'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vmI33'><tfoot id='vmI33'></tfoot><dl id='vmI33'><fieldset id='vmI33'></fieldset></dl></div>

                  <tbody id='vmI33'></tbody>

                  本文介紹了masterpage initializeculture 找不到合適的方法來覆蓋錯誤?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試使用帶有 C# 的 ASP.NET 開發(fā)多語言網(wǎng)站我的問題是:我想讓我的 MasterPage 支持語言之間的切換,但是當(dāng)我將InitializeCulture()"放入 masterpage.cs 時,我得到了這個錯誤.

                  I'm trying to develop a MultiLanguage web site using ASP.NET with C# My problem is: I want to make my MasterPage support switching among languages, but when i put the "InitializeCulture()" inside the masterpage.cs, I got this error.

                  這是我的代碼:

                  public partial class BasicMasterPage : System.Web.UI.MasterPage
                  {
                  protected void Page_Load(object sender, EventArgs e)
                  {
                  
                  }
                  protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
                  {
                      if (e.Day.IsToday)
                      {
                          e.Cell.Style.Add("background-color", "#3556bf");
                          e.Cell.Style.Add("font-weight", "bold");
                      }
                  }
                  Dictionary<string, System.Globalization.Calendar> Calendars =
                      new Dictionary<string, System.Globalization.Calendar>()
                      {
                          {"GregorianCalendar", new GregorianCalendar()},
                          {"HebrewCalendar", new HebrewCalendar()},
                          {"HijriCalendar", new HijriCalendar()},
                          {"JapaneseCalendar", new JapaneseCalendar()},
                          {"JulianCalendar", new JulianCalendar()},
                          {"KoreanCalendar", new KoreanCalendar()},
                          {"TaiwanCalendar", new TaiwanCalendar()},
                          {"ThaiBuddhistCalendar", new ThaiBuddhistCalendar ()}
                      };
                  
                  protected override void InitializeCulture()
                  {
                      if (Request.Form["LocaleChoice"] != null)
                      {
                          string selected = Request.Form["LocaleChoice"];
                          string[] calendarSetting = selected.Split('|');
                          string selectedLanguage = calendarSetting[0];
                  
                          CultureInfo culture = CultureInfo.CreateSpecificCulture(selectedLanguage);
                  
                          if (calendarSetting.Length > 1)
                          {
                              string selectedCalendar = calendarSetting[1];
                              var cal = culture.Calendar;
                              if (Calendars.TryGetValue(selectedCalendar, out cal))
                                  culture.DateTimeFormat.Calendar = cal;
                          }
                  
                          Thread.CurrentThread.CurrentCulture = culture;
                          Thread.CurrentThread.CurrentUICulture = culture;
                      }
                      base.InitializeCulture();
                  }
                  }
                  

                  如何創(chuàng)建基類?

                  推薦答案

                  InitializeCulture()方法只存在于Page 類,而不是 MasterPage 類,這就是你得到這個錯誤的原因.

                  The method InitializeCulture() exists only on the Page class, not the MasterPage class, and that's why you get that error.

                  要解決這個問題,您可以創(chuàng)建一個 BasePage 讓您的所有特定頁面都繼承:

                  To fix this, you could create a BasePage that all your specific pages inherit:

                  1. 創(chuàng)建一個新類(不是 Webform),將其命名為 BasePage 或任何您想要的名稱.
                  2. 使其繼承System.Web.UI.Page.
                  3. 讓所有其他頁面繼承 BasePage.
                  1. Create a new Class (not Webform), call it BasePage, or whatever you want.
                  2. Make it inherit System.Web.UI.Page.
                  3. Make all your other pages inherit the BasePage.

                  這是一個例子:

                  public class BasePage : System.Web.UI.Page
                  {
                      protected override void InitializeCulture()
                      {
                          //Do the logic you want for all pages that inherit the BasePage.
                      }
                  }
                  

                  具體的頁面應(yīng)該是這樣的:

                  And the specific pages should look something like this:

                  public partial class _Default : BasePage //Instead of it System.Web.UI.Page
                  {
                      protected void Page_Load(object sender, EventArgs e)
                      {
                          //Your logic.
                      }
                  
                      //Your logic.
                  }
                  

                  這篇關(guān)于masterpage initializeculture 找不到合適的方法來覆蓋錯誤?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標(biāo)簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)

                    • <tfoot id='Vnfg5'></tfoot>
                      <i id='Vnfg5'><tr id='Vnfg5'><dt id='Vnfg5'><q id='Vnfg5'><span id='Vnfg5'><b id='Vnfg5'><form id='Vnfg5'><ins id='Vnfg5'></ins><ul id='Vnfg5'></ul><sub id='Vnfg5'></sub></form><legend id='Vnfg5'></legend><bdo id='Vnfg5'><pre id='Vnfg5'><center id='Vnfg5'></center></pre></bdo></b><th id='Vnfg5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Vnfg5'><tfoot id='Vnfg5'></tfoot><dl id='Vnfg5'><fieldset id='Vnfg5'></fieldset></dl></div>

                        <small id='Vnfg5'></small><noframes id='Vnfg5'>

                          <tbody id='Vnfg5'></tbody>
                          <bdo id='Vnfg5'></bdo><ul id='Vnfg5'></ul>
                          <legend id='Vnfg5'><style id='Vnfg5'><dir id='Vnfg5'><q id='Vnfg5'></q></dir></style></legend>
                            主站蜘蛛池模板: 国产99久久久国产精品 | 国产91黄色 | 欧美激情在线播放 | 91社区在线观看 | 国产一区不卡在线观看 | 四虎永久在线精品免费一区二 | 天天弄天天操 | 欧美淫片| 国产精品久久久久国产a级 欧美日本韩国一区二区 | 日韩亚洲视频 | 成人小视频在线观看 | 亚洲人精品 | 狠狠狠色丁香婷婷综合久久五月 | 少妇特黄a一区二区三区88av | 国产在线视频一区 | 亚洲精品91 | 先锋资源在线 | 国产精品日本一区二区不卡视频 | 久久在线 | 国产精品一区二区久久精品爱微奶 | 日日夜夜天天 | 国产成人免费视频网站视频社区 | 天天色综网 | 无人区国产成人久久三区 | 日韩在线观看视频一区 | 黄色一级免费观看 | 一级片av| 久久久久久久久久久久亚洲 | 久久久久久久一区 | 国产精品免费视频一区 | 亚洲在线一区二区 | 欧美爱爱视频网站 | 超碰成人免费 | 999精品网| 欧美日韩国产一区 | 久久久一区二区三区四区 | 成人午夜免费在线视频 | 国产精品1区 | 欧美一区二区三区在线观看 | 国产专区在线 | 91社区在线观看 |