visual studio microsoft español descargar community asp.net c#-4.0 globalization tabpanel tabcontainer

asp.net - studio - La propiedad Auto Post back no funciona con el contenedor de pestañas



visual studio installer (2)

Aquí encontré respuesta después de dos días de mi búsqueda. La respuesta es muy simple :)

establezco el valor de mi idioma en UICulture

protected override void InitializeCulture() { if (Request.Form["ctl00$contentplaceholder1$language_drp"] != null) { UICulture = Request.Form["ctl00$contentplaceholder1$language_drp"]; } if (Request.QueryString["HotelID"] != null) { this.UICulture = "es"; } base.InitializeCulture(); }

y está funcionando bien :)

Estoy aplicando la globalización en el portal web de mi sistema de gestión hotelera y estoy atascado con un problema. Mi problema es que tengo una lista desplegable de dos idiomas, inglés y español, y configuré autopostback = "verdadero", así que de menú desplegable selecciono español y mi página web convierte con éxito el idioma inglés al español llamando al siguiente método

protected override void InitializeCulture() { if (Request.Form["ctl00$contentplaceholder1$language_drp"] != null) { UICulture = Request.Form["ctl00$contentplaceholder1$language_drp"]; } base.InitializeCulture(); }

Como he configurado la propiedad autopostback como verdadera, esta función se llama successfull. y también tengo control de edición desde el cual puedo editar los detalles de mi hotel en español o en inglés y he usado el contenedor de pestañas para toda la información de los hoteles. pero cuando hago clic en editar mi página no se vuelve a publicar como verdadera, es por eso que no puedo llamar al método iniliaze culture y es por eso que el idioma de mi página no es convertible. Apliqué la propiedad autopostback true en tabcontainer pero fallé. en el contenedor de pestañas tengo paneles de pestañas. aquí está mi código

<asp:TabContainer ID="TabContainerHotelDetails" runat="server" AutoPostBack="true" Width="100%" OnLoad="TabContainerHotelDetails_Load"> <asp:TabPanel runat="server" HeaderText="General" ID="TabGeneral" > <ContentTemplate> <asp:Panel ID="PanelInfo" runat="server" Width="100%" GroupingText="<%$ Resources:Resource, LocalizedInformation %>"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaHotelName" runat="server" Text="<%$ Resources:Resource, LocalizedHotelName %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaHotelStatus" runat="server" Text="<%$ Resources:Resource, LocalizedStatus %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaMemberShip" runat="server" Text="<%$ Resources:Resource, LocalizedMemberShipType %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaUserName" runat="server" Text="<%$ Resources:Resource, LocalizedUserName %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaEmail" runat="server" Text="<%$ Resources:Resource, LocalizedEmail %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaTotalPoint" runat="server" Text="<%$ Resources:Resource, LocalizedTotalPoint %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaRegistrationDate" runat="server" Text="<%$ Resources:Resource, LocalizedRegisteredDate %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaLastLogin" runat="server" Text="<%$ Resources:Resource, LocalizedLastLogin %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaEmailActivated" runat="server" Text="<%$ Resources:Resource, LocalizedEmailActivated %>"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="metaLockedOut" runat="server" Text="<%$ Resources:Resource, LocalizedLockedOut %>"></asp:Label> </td> </tr> </table> </td> <td width="5%" style="border-right: 1px dotted black;"> </td> <td> <table border="0" cellpadding="0" cellspacing="0" style="padding-left: 10px;"> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblHotelName" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblStatus" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblMembershipType" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblUserName" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblEmail" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblTotalPoints" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblRegisteredDate" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:Label ID="lblLastLogin" runat="server"></asp:Label> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:CheckBox ID="chkEmailActivated" runat="server" OnCheckedChanged="chkEmailActivated_CheckedChanged" AutoPostBack="True" /> </td> </tr> <tr> <td style="padding-top: 10px; height: 30px;"> <asp:CheckBox ID="chkLockedOut" runat="server" OnCheckedChanged="chkLockedOut_CheckedChanged" AutoPostBack="True" /> </td> </tr> </table> </td> </tr> </table> </asp:Panel>

¿Hay alguna forma en que pueda hacer esto o alternativas fácilmente para que se llame a mi método iniliazeculture después de hacer clic en editar? Por favor, ayuda ya que soy muy nuevo en el desbordamiento de la pila. En realidad, no sé cómo publicar las preguntas.


puedes usar el método web para inicializar la cultura. para eso tienes que crear inicialmente el método javascript que llamará cuando hagas clic en la pestaña de edición y desde ese script puedes llamar al método web de nivel de página para inicializar la cultura. Espero que esto te ayude.