简体   繁体   English

使用Web Deploy 3.0在IIS中显示下拉列表

[英]Display a dropdown list in IIS using Web Deploy 3.0

I'm trying to get a drop down list to display using web deploy 3.0. 我正在尝试获取一个下拉列表,以使用Web Deployment 3.0进行显示。 I'm fairly new to the whole web deploy process, but basically here's what I want to be able to do: 对于整个Web部署过程,我还是一个新手,但是基本上,这就是我想要做的事情:

  1. Project -> Build Deployment Package 项目->构建部署包
  2. In IIS, create a new web site and click "Import Application" 在IIS中,创建一个新的网站,然后单击“导入应用程序”
  3. I should see a DropDownList for one of the parameters. 我应该看到其中一个参数的DropDownList。

After reading several articles on the topic, notably this excerpt from this article : 阅读题目的文章,特别是本文节选自以后这篇文章

Enumeration - Enumeration allows you to limit the user's input to a list of discrete possible values. 枚举-枚举使您可以将用户输入限制为离散值的列表。 Most UIs will implement this as a drop-down list box, where [...]. 大多数用户界面会将其实现为下拉列表框,其中[...]。 The syntax for Enumeration is: 枚举的语法为:

<parameter name="Enumeration Parameter"> 
    <parameterValidation type="Enumeration" validationString="value1,value2,value3,value4" /> 
</parameter> 

And, for testing purposes, I copied-and-pasted the code above into my parameters.xml file, which works fine for any other kind of parameter. 并且,出于测试目的,我将上面的代码复制并粘贴到了我的parameters.xml文件中,该文件适用于任何其他类型的参数。 The enumeration parameter shows up, but it's just a text box -- there isn't a drop down list. 显示枚举参数,但这只是一个文本框-没有下拉列表。 Is this just the expected behavior from the IIS import interface or am I missing something here? 这仅仅是IIS导入界面中的预期行为,还是我在这里遗漏了一些东西?

This post might be old. 这篇文章可能很旧。 But if anybody having the same issue please change type="Enumeration" to kind="Enumeration". 但是,如果有人遇到相同的问题,请将type =“ Enumeration”更改为kind =“ Enumeration”。 So your tag should be like 所以你的标签应该像

  <parameter name="Enumeration Parameter">
  <parameterValidation kind="Enumeration" validationString="values1,value2,value3"/>
  </parameter>

After a little investigating, I found that the issue was that Web Deploy isn't adding the parameterValidation node to the deployment package. 经过一番调查后,我发现问题在于Web Deploy没有将parameterValidation节点添加到部署包中。 I was able to get around this issue by unzipping the deployment package, manually adding the XML for validation, and zipping it back up. 通过解压缩部署程序包,手动添加XML进行验证并将其压缩后,我能够解决此问题。 I'd love to find a less hacky way to do this, though. 不过,我很想找到一种不太麻烦的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM