Twitter Bootstrap - 模态格式的表单 - ASP.NET

2024-02-29

我有一个模式形式的表单,如果主窗口不太宽(标签位于字段上方),则该表单可以完美格式化。但是,如果浏览器最大化或足够大,它会更改模式内内容的布局,以便标签现在位于字段的左侧(这意味着每行一个单词,看起来非常混乱)。

知道我如何克服这种行为,以便类 form-horizo​​ntal 适用于模式的宽度,而不是浏览器窗口的宽度吗?

用代码更新:

这是模态的结构

<div id="CCNewModal" class="modal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button class="close" aria-hidden="true" type="button" data-dismiss="modal">×</button>
                 <h4 id="CCTitle" runat="server" class="modal-title">New Credit Card</h4>

            </div>
            <div class="modal-body">
                <div>
                    <fieldset>
                        <div id="selectCardDiv" class="form-group">
                            <label id="selectCardLabel" class="col-lg-2 control-label" for="selectCard">Card Type</label>
                            <div class="col-lg-10">
                                <select class="form-control" id="selectCard" runat="server">
                                    <option value="0">Select Card</option>
                                    <option value="Amex">Amex</option>
                                    <option value="MasterCard">MasterCard</option>
                                    <option value="Visa">Visa</option>
                                </select>
                            </div>
                        </div>
                        <div id="selectNameDiv" class="form-group">
                            <label id="selectNameLabel" class="col-lg-2 control-label" for="inputCCName">Name</label>
                            <div class="col-lg-10">
                                <input class="form-control" id="inputCCName" runat="server" type="text" placeholder="Name (as on statement)">
                            </div>
                        </div>
                        <div id="selectNumberDiv" class="form-group">
                            <label id="selectNumberLabel" class="col-lg-2 control-label" for="inputCCNumber">Number</label>
                            <div class="col-lg-10">
                                <input class="form-control" id="inputCCNumber" runat="server" type="text" placeholder="Credit Card Number (no spaces)">
                            </div>
                        </div>
                        <div id="selectMonthDiv" class="form-group">
                            <label id="selectMonthLabel" class="col-lg-2 control-label" for="selectMonth">Expiry Month</label>
                            <div class="col-lg-10">
                                <select class="form-control" id="selectMonth" runat="server">
                                    <option value="0">Month</option>
                                    <option value="01">Jan</option>
                                    <option value="02">Feb</option>
                                    <option value="03">Mar</option>
                                    <option value="04">Apr</option>
                                    <option value="05">May</option>
                                    <option value="06">Jun</option>
                                    <option value="07">Jul</option>
                                    <option value="08">Aug</option>
                                    <option value="09">Sep</option>
                                    <option value="10">Oct</option>
                                    <option value="11">Nov</option>
                                    <option value="12">Dec</option>
                                </select>
                            </div>
                        </div>
                        <div id="selectYearDiv" class="form-group">
                            <label id="selectYearLabel" class="col-lg-2 control-label" for="selectYear">Expiry Year</label>
                            <div class="col-lg-10">
                                <select class="form-control" id="selectYear" runat="server"></select>
                            </div>
                        </div>
                        <div id="selectCVVDiv" class="form-group">
                            <label id="selectCVVLabel" class="col-lg-2 control-label" for="inputCVV">CVV</label>
                            <div class="col-lg-10">
                                <input class="form-control" id="inputCVV" runat="server" type="text" placeholder="Security Code (CVV)">
                            </div>
                        </div>
                        <div id="selectBillingAddressDiv" class="form-group">
                            <label id="selectBillingAddressLabel" class="col-lg-2 control-label" for="inputBillingAddress">Billing Address</label>
                            <div class="col-lg-10">
                                <textarea class="form-control" id="inputBillingAddress" runat="server" rows="3" placeholder="Address as on Statement"></textarea>
                            </div>
                        </div>
                        <div id="selectBillingCityDiv" class="form-group">
                            <label id="selectBillingCityLabel" class="col-lg-2 control-label" for="inputCCCity">City</label>
                            <div class="col-lg-10">
                                <input class="form-control" id="inputCCCity" runat="server" type="text" placeholder="City">
                            </div>
                        </div>
                        <div id="selectBillingStateDiv" class="form-group">
                            <label id="selectBillingStateLabel" class="col-lg-2 control-label" for="selectState">State</label>
                            <div class="col-lg-10">
                                <select class="form-control" id="selectState" runat="server">
                                    <option value="0">Select State</option>
                                    <option value="AL">Alabama</option>
                                    <option value="AK">Alaska</option>
                                    <option value="AZ">Arizona</option>
                                    <option value="AR">Arkansas</option>
                                    <option value="CA">California</option>
                                    <option value="CO">Colorado</option>
                                    <option value="CT">Connecticut</option>
                                    <option value="DE">Delaware</option>
                                    <option value="DC">District of Columbia</option>
                                    <option value="FL">Florida</option>
                                    <option value="GA">Georgia</option>
                                    <option value="HI">Hawaii</option>
                                    <option value="ID">Idaho</option>
                                    <option value="IL">Illinois</option>
                                    <option value="IN">Indiana</option>
                                    <option value="IA">Iowa</option>
                                    <option value="KS">Kansas</option>
                                    <option value="KY">Kentucky</option>
                                    <option value="LA">Louisiana</option>
                                    <option value="ME">Maine</option>
                                    <option value="MD">Maryland</option>
                                    <option value="MA">Massachusetts</option>
                                    <option value="MI">Michigan</option>
                                    <option value="MN">Minnesota</option>
                                    <option value="MS">Mississippi</option>
                                    <option value="MO">Missouri</option>
                                    <option value="MT">Montana</option>
                                    <option value="NE">Nebraska</option>
                                    <option value="NV">Nevada</option>
                                    <option value="NH">New Hampshire</option>
                                    <option value="NJ">New Jersey</option>
                                    <option value="NM">New Mexico</option>
                                    <option value="NY">New York</option>
                                    <option value="NC">North Carolina</option>
                                    <option value="ND">North Dakota</option>
                                    <option value="OH">Ohio</option>
                                    <option value="OK">Oklahoma</option>
                                    <option value="OR">Oregon</option>
                                    <option value="PA">Pennsylvania</option>
                                    <option value="RI">Rhode Island</option>
                                    <option value="SC">South Carolina</option>
                                    <option value="SD">South Dakota</option>
                                    <option value="TN">Tennessee</option>
                                    <option value="TX">Texas</option>
                                    <option value="UT">Utah</option>
                                    <option value="VT">Vermont</option>
                                    <option value="VA">Virginia</option>
                                    <option value="WA">Washington</option>
                                    <option value="WV">West Virginia</option>
                                    <option value="WI">Wisconsin</option>
                                    <option value="WY">Wyoming</option>
                                </select>
                            </div>
                        </div>
                        <div id="selectBillingZipDiv" class="form-group">
                            <label id="selectBillingZipLabel" class="col-lg-2 control-label" for="inputCCZip">Zip / Postcode</label>
                            <div class="col-lg-10">
                                <input class="form-control" id="inputCCZip" runat="server" type="text" placeholder="City">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label" for="inputCCCountry">Country</label>
                            <div class="col-lg-10">
                                <input disabled="" value="United States" class="form-control" id="inputCCCountry" runat="server" type="text" placeholder="City">
                            </div>
                        </div>
                        <div id="selectTelephoneDiv" class="form-group">
                            <label id="selectTelephoneLabel" class="col-lg-2 control-label" for="inputCCTelephone">Telephone</label>
                            <div class="col-lg-10">
                                <input class="form-control" id="inputCCTelephone" runat="server" type="text" placeholder="Telephone (format as 123-456-7890)">
                            </div>
                        </div>
                        <div class="checkbox">
                            <label>
                                <input id="selectPrimaryCB" runat="server" type="checkbox" checked>Primary (default) card</label>
                        </div>
                    </fieldset>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
                <button id="CreditCardSaveButton" runat="server" class="btn btn-primary" type="button">Save</button>
            </div>
        </div>
    </div>
</div>

以及以下 CCS 覆盖

#CCNewModal .modal-body {
    max-height: 420px;
    overflow-y: auto;
}

母版页基本上是 - 我正在处理的页面适合 MainContent 占位符

<form runat="server" class="form-horizontal">

<div class="container body-content">

        <asp:ContentPlaceHolder ID="MainContent" runat="server">
        </asp:ContentPlaceHolder>
        <hr />
        <footer>
            <asp:Label ID="FooterLabel" runat="server" Font-Size="Small"></asp:Label>
        </footer>
    </div>

</form>

这就是使用 form-vertical 时表单的样子

..它确实用模态格式做了一些数字

..使用form-horizo​​ntal(宽和窄)


我可以重写此行为,以便类 form-horizo​​ntal 适用于模式的宽度,而不是浏览器窗口的宽度吗?

简而言之,不。form-horizontal基于针对窗口大小运行的媒体查询。媒体查询不能针对其他元素的大小运行。当然,您可以使用 javascript 计算其他元素的大小并相应地更改其他元素,但是您将失去使用普通旧 CSS 并让浏览器完成工作的所有本机性能优势。

如果浏览器最大化或足够大,它会更改模式内内容的布局,以便标签现在位于字段的左侧

但这正是水平形式的作用。如果您不想要这种功能,为什么不将其更改为基本形式呢?听起来,即使这不是模式窗口的空间限制,如果您有很长的标签名称并且没有足够的列宽来将它们显示在单行上,那么这种形式也会遇到麻烦。

这是模态中水平表单的示例

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalHorizontal">
    Launch Horizontal Form
</button>

<!-- Modal -->
<div class="modal fade" id="myModalHorizontal" tabindex="-1" role="dialog" 
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close" 
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    Modal title
                </h4>
            </div>
            
            <!-- Modal Body -->
            <div class="modal-body">
                
                <form class="form-horizontal" role="form">
                  <div class="form-group">
                    <label  class="col-sm-2 control-label"
                              for="inputEmail3">Email</label>
                    <div class="col-sm-10">
                        <input type="email" class="form-control" 
                        id="inputEmail3" placeholder="Email"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label"
                          for="inputPassword3" >Password</label>
                    <div class="col-sm-10">
                        <input type="password" class="form-control"
                            id="inputPassword3" placeholder="Password"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                      <div class="checkbox">
                        <label>
                            <input type="checkbox"/> Remember me
                        </label>
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                      <button type="submit" class="btn btn-default">Sign in</button>
                    </div>
                  </div>
                </form>
                
            </div>
            
            <!-- Modal Footer -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal">
                            Close
                </button>
                <button type="button" class="btn btn-primary">
                    Save changes
                </button>
            </div>
        </div>
    </div>
</div>

下面是一个基本表单的示例,它在所有屏幕尺寸下都保持其结构:

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>


<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalNorm">
    Launch Normal Form
</button>

<!-- Modal -->
<div class="modal fade" id="myModalNorm" tabindex="-1" role="dialog" 
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close" 
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    Modal title
                </h4>
            </div>
            
            <!-- Modal Body -->
            <div class="modal-body">
                
                <form role="form">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Email address</label>
                      <input type="email" class="form-control"
                      id="exampleInputEmail1" placeholder="Enter email"/>
                  </div>
                  <div class="form-group">
                    <label for="exampleInputPassword1">Password</label>
                      <input type="password" class="form-control"
                          id="exampleInputPassword1" placeholder="Password"/>
                  </div>
                  <div class="checkbox">
                    <label>
                        <input type="checkbox"/> Check me out
                    </label>
                  </div>
                  <button type="submit" class="btn btn-default">Submit</button>
                </form>
                
                
            </div>
            
            <!-- Modal Footer -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal">
                            Close
                </button>
                <button type="button" class="btn btn-primary">
                    Save changes
                </button>
            </div>
        </div>
    </div>
</div>

或者,您可以尝试覆盖一些样式.form-horizontal如果您对标记没有太多控制权,则适用。你可以添加一些像这样的CSS(取决于你的水平表单的结构)

.modal-body .form-horizontal .col-sm-2,
.modal-body .form-horizontal .col-sm-10 {
    width: 100%
}

.modal-body .form-horizontal .control-label {
    text-align: left;
}
.modal-body .form-horizontal .col-sm-offset-2 {
    margin-left: 15px;
}

使用 CSS 的水平表单

.modal-body .form-horizontal .col-sm-2,
.modal-body .form-horizontal .col-sm-10 {
  width: 100%
}

.modal-body .form-horizontal .control-label {
  text-align: left;
}
.modal-body .form-horizontal .col-sm-offset-2 {
  margin-left: 15px;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalHorizontal">
    Launch Horizontal Form
</button>

<!-- Modal -->
<div class="modal fade" id="myModalHorizontal" tabindex="-1" role="dialog" 
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close" 
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    Modal title
                </h4>
            </div>
            
            <!-- Modal Body -->
            <div class="modal-body">
                
                <form class="form-horizontal" role="form">
                  <div class="form-group">
                    <label  class="col-sm-2 control-label"
                              for="inputEmail3">Email</label>
                    <div class="col-sm-10">
                        <input type="email" class="form-control" 
                        id="inputEmail3" placeholder="Email"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label"
                          for="inputPassword3" >Password</label>
                    <div class="col-sm-10">
                        <input type="password" class="form-control"
                            id="inputPassword3" placeholder="Password"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                      <div class="checkbox">
                        <label>
                            <input type="checkbox"/> Remember me
                        </label>
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                      <button type="submit" class="btn btn-default">Sign in</button>
                    </div>
                  </div>
                </form>
                
            </div>
            
            <!-- Modal Footer -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal">
                            Close
                </button>
                <button type="button" class="btn btn-primary">
                    Save changes
                </button>
            </div>
        </div>
    </div>
</div>

这是 jsFiddle 中的演示 http://jsfiddle.net/KyleMit/0fscmf3L/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Twitter Bootstrap - 模态格式的表单 - ASP.NET 的相关文章

  • MVC3 OutputCache VaryByHeader=未设置 Cookie

    我有以下操作方法 HttpGet Authorize OutputCache Duration 60 VaryByHeader Cookie Location OutputCacheLocation Any public ActionRes
  • 上下文不是 ASP.NET 用户控件的成员

    我刚刚在 ASP NET Web 应用程序项目中创建了新的用户控件 创建后 源代码如下所示 但是一旦我向其中添加一些额外的代码 第一行就会立即出现错误 上下文不是 CS SSR RAIO SSR Project 的成员 我确实有其他用户控件
  • 使用 C# 和 ADO.NET SET NOCOUNT ON 并读取消息

    SET NOCOUNT ON 会阻止显示受 Transact SQL 语句或存储过程影响的行数的消息作为结果集的一部分返回 a 如何使用 C 和 ADO NET 读取这些消息 我假设读取这些消息的 C 代码是相同的 无论 T SQL 语句是
  • ASMX相当于Page_Init?

    我有一些代码想要在调用 ASMX 函数的生命周期的早期执行 对于我们的 ASPX 页面 此代码位于基类的 Page Init 函数中 我们所有的 ASPX 页面都继承自该基类 ASMX 是否有相当于 ASPX 的 Page Init 函数
  • div 全宽的响应式背景图像

    我正在尝试弄清楚如何在 div 全宽和响应式中制作背景图像 背景图像在页面的宽度上扩展 并且具有响应性 但图像的高度不是其完整高度 似乎它被某种方式切断了 我正在使用引导框架 我尝试这样做的原因是我想在图像上覆盖一些文本 我尝试了很多不同的
  • 如何在 asp.net 文本框中保留前导空格

    我有一个文本框 Web 控件 它会自动修剪其内容中的任何前导空格 因此当我收到文本时 它与用户最初编写的内容不同 如果他输入了前导空格 有没有办法禁用这个功能 好吧 只有一种解决方案可以覆盖默认行为 那就是编写一个 javascript 函
  • 非静态方法需要一个目标

    private PMS USERS currUser private bool validateUserName dbContext new PmsEntities var validateUser dbContext PMS USERS
  • 无法在 Web 服务器上启动调试。远程服务器返回错误:(404) 未找到。在 Visual Studio 中启动调试时出错

    我已经将项目设置为在 IIS 上运行一段时间了 当我按 F5 时 它确实连接没有问题 但最近它停止工作 当我按 F5 press 时确实收到此错误Debug gt Start debugging 无法在 Web 服务器上启动调试 远程服务器
  • 有没有任何工具可以查看针对数据库运行的查询?

    是否有任何工具可以检查 asp net 或 sql server 并报告针对数据库运行的所有查询 我问这个问题的原因是我正在一个项目中使用 Linq 并且想要仔细检查它对每个页面实际执行的操作 理想情况下 我想在浏览器中查看页面并获得为创建
  • WCF 服务支持文件 jsdebug 无法加载

    我有一个从客户端 JavaScript 调用的 WCF 服务 调用失败并出现 Service is null JavaScript 错误 WebDevelopment 帮助程序跟踪显示加载 jsdebug 支持文件的调用会导致 404 文件
  • 有条件地隐藏 Gridview 中的 CommandField 或 ButtonField

    我有一个GridView显示人员记录 我想有条件地显示CommandField or ButtonField基于基础记录的某些属性 这个想法是只允许对特定的人执行命令 做这个的最好方式是什么 我更喜欢声明式解决方案而不是过程式解决方案 首先
  • System.Web.Cache 和 HTTPContext.Current.Cache 之间的区别

    System Web Cache 和 HTTPContext Current Cache 有什么区别 在什么情况下同时使用两者 System Web Caching Cache 这是 NET 缓存的实现 System Web HttpCon
  • ASP.NET - 将所有 https 请求重写为 http

    我的问题正是所提出的问题here https stackoverflow com questions 16276860 iis 7 adding ssl to one site all other sites responds to htt
  • 如何从 Bootstrap CSS 的下拉列表中删除箭头?

    我正在尝试删除 Twitter Bootstrap 框架中下拉菜单中出现的箭头 有没有人想出去除箭头的方法 从链接中删除插入符类会从导航栏中删除箭头 dropdown menu before dropdown menu after bord
  • jQuery 自动完成/Twitter Typeahead 填充多个字段

    我目前正在使用 TypeAhead Bootstrap 但很高兴使用 jQuery Autocomplete 来完成我需要的事情 我有 5 个输入字段 我还有一个结构如下的表 因此我将使用远程数据源 Classification Model
  • RegisterClientScriptCode 在部分回发后不起作用

    以下代码行位于 SharePoint 网站的用户控件中 ScriptManager RegisterClientScriptBlock this this GetType jquery144 false ScriptManager Regi
  • GridView 仅显示第一个检索到的记录

    我成功地从数据库中检索了我需要的所有记录 但是只有一条记录显示在我的数据库中GridView 在过去的几天里我一直在尝试解决这个问题 因为我没有其他选择可以尝试 所以我真的很沮丧 我迫切需要一些帮助 我尝试操作查询 因为我最初认为这是问题所
  • 布局中的模型破坏了其他页面

    由于缺乏 MVC4 经验 我有一个设计缺陷 问题是我的布局中有一个模型 model BasicFinanceUI Models LoginModel Content Site css rel stylesheet type text css
  • 如何避免在 ASP.NET 代码隐藏中编写混乱的 JavaScript?

    我想知道在 ASP NET 中使用 Javascript 的最佳实践是什么 我不知道这是否是最佳实践 但我在代码隐藏中添加了 javascript 客户端事件 它工作正常 但这是最佳实践吗 例如 我有一个单选按钮控件 并在 Page Ini
  • 在引导折叠手风琴中显示部分文本

    我想替换一个允许用户使用 Bootstrap 折叠手风琴 阅读更多内容 的脚本 我的问题是 据我所知 手风琴要么打开 要么关闭 有谁知道在关闭模式下显示一些文本的选项 在我现在使用的脚本中 我可以通过更改文本区域的高度来使一些文本可见 但在

随机推荐

  • Xcode Swift MacOS 应用程序,将文件拖放到 NSTextField 中

    我正在为 MacOS 实现我的第一个应用程序 用户应该输入要处理的文件路径 我的 NSViewController 应用程序上有一个 NSTextField 我想让用户只需将一个文件拖放到那里 这样我就可以获得文件路径 打开它并在 NSTe
  • XNA 框架导入器

    我正在使用 XNA 框架开发游戏 我的游戏有几个级别 我将数据存储在纯旧文本文件中 在 VS 2008 中 当我将关卡文件添加到项目并编译时 我收到以下错误消息 错误 1 无法自动检测用于 Levels 0 txt 的导入程序 没有处理此文
  • Automapper 继承——重用映射

    我正在尝试使用自动映射器为父对象创建单个映射 并在其子对象中重用它 对于子属性 我只想映射额外的字段 这可能吗 我的代码看起来像这样 CreateCalculationMap message This does the BASE paren
  • JavaScript 中的 new 运算符如何工作?

    可能是 JavaScript 中最难理解的部分 位于原型链旁边 所以问题是 如何 new dataObj args 实际上创建一个对象 并定义它的原型链 构造函数 等 最好是展示一个替代方案 以充分理解这个关键字 The new操作员使用内
  • HTML5本地存储VS应用程序缓存离线网站浏览

    看了多篇文章后 我仍然不清楚本地存储和应用程序缓存清单之间的区别 还提到 AppCache 应用程序缓存 Web Storage 的 LocalStorage 吗 https stackoverflow com questions 1098
  • java.lang.LinkageError 类加载错误

    我的系统 Java Eclipse 环境有一些问题 我收到此错误 但我不明白出了什么问题 java lang LinkageError loader constraint violation loader instance of jsyst
  • 如何在 Swift 中获取短格式的当前日期

    在下图中 您可以看到我编写的代码以及所有变量的值 class fun getCurrentShortDate gt String var todaysDate NSDate var dateFormatter NSDateFormatter
  • 如何使用 Windows API 捕获屏幕和鼠标指针?

    我使用下面的代码以位图形式捕获屏幕 屏幕已被捕获 但我无法将鼠标指针放在屏幕上 你能建议一些替代方法来捕获鼠标吗 private Bitmap CaptureScreen Size size is how big an area to ca
  • SQL 增加一个数字

    Problem 我想根据表格增加一个数字 例如 如果一个表包含 排 1 1 2 3 4 4 4 5 mytable 列应在此基础上增加 取上一列中的 max row 1 所以结果应该是这样的 6 6 7 8 9 9 9 10 这是到目前为止
  • 如何获取 PFX 密钥的容器名称?

    不久前 我使用如下命令将 PFX 密钥安装到容器中 sn i mykey pfx VS XXX 但两个月后我忘记了容器名称 VS XXX 所以我的问题是 如何取回比名字 我知道密钥名称 我有这个密钥 我知道密钥密码短语 下载Keypal h
  • 将材料设计与 VueJS 结合使用

    我正在使用 VueJs 构建一个 Web 应用程序 并且需要一个 css 框架来设计一些东西 而不是从头开始 我找到了material design lite www getmdl io 但我无法让它与vue router一起正常工作 我的
  • 跨多个范围的多个条件格式规则?

    我需要执行以下操作 如果单元格 E 包含大于 30 的数字且单元格 L 包含大于 100 的数字 则突出显示一行 此规则需要应用于所有行 你能帮忙吗 你应该使用条件格式 http office microsoft com en us exc
  • Electron:打开默认电子邮件客户端

    我正在使用选举框架来构建 exe 和 dmg 文件 在应用程序中 我有一个按钮 单击该按钮必须打开系统上安装的默认电子邮件应用程序才能发送电子邮件 以下是打开电子邮件客户端的代码 shell openExternal mailto emai
  • 本地硬重置后无法推送到原点

    我最近对本地 git 存储库进行了硬重置 换句话说 我将其重置为较早的时间点 现在当我尝试向上推时origin它告诉我不能 因为origin包含比我的存储库晚的工作 这是有道理的 但我不关心源在我的本地存储库之后所做的工作 如果我先pull
  • @protocol 与类簇

    那些主要是什么pro and contra for protocol and 类簇 http developer apple com library mac documentation Cocoa Conceptual CocoaFunda
  • 将 Jenkins 与 Gitlab 集成

    我需要在 Jenkins 中设置构建配置 以便每当触发构建时 我都会从 Gitlab 获取最新的脚本并将它们复制到目标系统并在目标上运行该脚本 我找不到任何将 Gitlab 集成到 Jenkins 的相关信息 有我可以使用的特定插件吗 我使
  • 检查哪些参数(组合)为空

    假设我有 4 个变量 String a String b String c String d 我想检查单个变量或变量组合是否不为空并采取相应的行动 例如 一种方法是使用 if else 这种方式 if a null b null c nul
  • VM 上的 Azure SQL Server 可以作为生产数据库吗?

    我试图找出 VM 上的 Azure SQL Server 和 Azure SQL Server 数据库之间的区别 我知道一个是 IaaS 另一个是 PaaS 服务 但有一件事我仍然不明白 哪一个可以用于开发 测试 哪一个可以用于生产 或者说
  • 在 python 中读取 csv 文件并将每个行项目作为脚本中的值进行迭代?

    编辑是因为我似乎太模糊或没有进行足够的研究 我很抱歉 这里是新手 我正在尝试读取 csv 文件并将每个新行分配为一个值 以迭代写入 API 的脚本 我的 csv 中没有标题数据 我将添加正则表达式搜索 然后使用正则表达式表达式后面的数据 并
  • Twitter Bootstrap - 模态格式的表单 - ASP.NET

    我有一个模式形式的表单 如果主窗口不太宽 标签位于字段上方 则该表单可以完美格式化 但是 如果浏览器最大化或足够大 它会更改模式内内容的布局 以便标签现在位于字段的左侧 这意味着每行一个单词 看起来非常混乱 知道我如何克服这种行为 以便类