我如何让我的日期和时间控件兼容Internet Explorer,Google Chrome和Firefox? [英] How I get my date and time controls compatible to internet explorer, Google chrome and firefox?
本文介绍了我如何让我的日期和时间控件兼容Internet Explorer,Google Chrome和Firefox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用c#和Asp.net版本4.6.1开发了一个应用程序,当我在visual studio上运行时,一切运行顺畅。
然而,当我在Internet Explorer上运行应用程序时,我的日期和时间控件显示空字段;但是当在Chrome和Firefox上运行它时,日期/时间控件显示时间和日历但无法提交。
什么问题我面对吗?
我需要你们帮助的人
我尝试过:
I have developed an app using c# and Asp.net version 4.6.1, when I run it on visual studio everything runs smooth.
However when I run the app on Internet Explorer my date and time controls displays empty fields; however when running it on Chrome and Firefox, the date/time controls display the times and calendar but fail to submit.
What problem am I facing?
I need your guys's assistance asap
What I have tried:
<div class="form-group">
<label for="arrivalTime" class="control-label col-md-12">Arrival Time</label>
<div class="col-md-12">
<input type="time" runat="server" id="arrivalTime" class="form-control input-sm" required />
</div>
</div>
<div class="form-group">
<label for="deliveryDate" class="control-label col-md-12">Delivery Date</label>
<div class="col-md-9">
<input type="date" runat="server" id="deliveryDate" onserverclick="Load_AvailableTimes" class="form-control input-sm" required />
<input type="button" value="Set" runat="server" id="setDate" onserverclick="Load_AvailableTimes" />
</div>
</div>
<div class="form-group">
<label for="carrierType" class="control-label col-md-12">CarrierType:</label>
<div class="col-md-12 form-inline">
<asp:DropDownList ID="CarrierType" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="Carrier_Type_Click" class="form-control input-sm col-md-12">
<asp:ListItem Enabled="true" Text="Select Carrier Type" Value="Select Carrier Type"></asp:ListItem>
<asp:ListItem Text="Truck" Value="truck"></asp:ListItem>
<asp:ListItem Text="Container" Value="container"></asp:ListItem>
<asp:ListItem Text="Bakkie" Value="bakkie"></asp:ListItem>
<asp:ListItem Text="Other" Value="other"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="LoadType" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="ClearCarrierSize" class="form-control input-sm col-md-6">
<asp:ListItem Enabled="true" Text="Select Load Type" Value="-1"></asp:ListItem>
<asp:ListItem Text="Palletized" Value="palletized"></asp:ListItem>
<asp:ListItem Text="Packed Loose" Value="packedloose"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="LogCarrierSize" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="Carrier_Size_Click" class="form-control input-sm col-md-6">
<asp:ListItem Enabled="true" Text="Select Load Size" Value=""></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="courierCompanyName" class="control-label col-md-12">Courier Company Name</label>
<div class="col-md-12">
<input type="text" runat="server" id="courierCompanyName" value="" class="form-control input-sm" placeholder="Courier Company Name" required />
</div>
</div>
<div class="form-group">
<label for="driverContactNumber" class="control-label col-md-12">Driver Contact Number</label>
<div class="col-md-12">
<input type="text" runat="server" id="driverContantNumber" value="" class="form-control input-sm" placeholder="Driver Contact Number" required />
</div>
</div>
<div class="form-group">
<label for="deliveryTime" class="control-label col-md-12">Delivery Time(Input your selected Available Booking Time here)</label>
<div class="col-md-12">
<input type="time" runat="server" id="deliveryTime" class="form-control input-sm" required="required" />
</div>
推荐答案
在Internet Explorer中检查您的页面模拟。默认情况下,Internet Explorer在兼容模式下显示Intranet站点 - 除非关闭。
在IE&中打开页面检查开发人员工具(F12键盘快捷键)&然后转到仿真选项卡。
如果文档模式是边缘(默认),则兼容模式开启&你可能会看到这种行为。
要强制IE使用边缘模式,请将以下内容添加到页面/母版页的html head部分;
< ; meta http-equiv =X-UA-Compatiblecontent =IE = Edge/>
这为我解决了很多问题内联网网站上的控件
亲切的问候
Check your page emulation in Internet Explorer. Internet Explorer displays Intranet sites in Compatibility Mode by default - unless switched off.
Open the page in IE & check the Developer Tools (F12 keyboard shortcut) & then go to the Emulation tab.
If the Document mode is other that "Edge (Default)" then Compatibility mode is on & you may see this type of behavior.
To force IE to use Edge mode add the following to the html head section of the page/master page;
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
This has resolved many issues for me with controls on Intranet sites
Kind Regards
这篇关于我如何让我的日期和时间控件兼容Internet Explorer,Google Chrome和Firefox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文