实际上,我正在使用ASP.NET和C#开发一个Web模板.我有一个listview在usercontrol页面和里面的ItemTemplate我有一个PlaceHolder如下图所示:
<asp:PlaceHolder ID="ph_Lv_EditModule" runat="server"> </asp:PlaceHolder>
Run Code Online (Sandbox Code Playgroud)
我想PlaceHolder从后面的代码访问这个,我使用不同的方法如下,但我无法访问它.
PlaceHolder ph_Lv_EditModule = (PlaceHolder)lv_Uc_Module.FindControl("ph_Lv_EditModule");
Run Code Online (Sandbox Code Playgroud)
要么
PlaceHolder ph_Lv_EditModule = (PlaceHolder)this.lv_Uc_Module.FindControl("ph_Lv_EditModule");
Run Code Online (Sandbox Code Playgroud)
你能帮我找一下如何在我usercontrol页面后面的代码中找到这个控件.感谢您的考虑.
我在XIB中遇到问题.我的占位符颜色的颜色在界面构建器中是默认的灰色,但是当我运行应用程序时,文本的颜色为白色,并且我无法看到它,因为背景是白色的.
有人有解决方案吗?
请任何人都可以帮助我,我在项目中遇到了与占位符相关的问题.它在Mozilla,Chrome,safari等工作.但是它在IE中不起作用.高级谢谢.
说明:
<form class="">
<input type="text" value="Email" id="inviteEmail"/>
<input type="text" value="Password" id="invitePassword">
</form>
var defaultTextEmail = '&{"Email"}';
var defaultTextPassword = '&{"general.password"}';
$(document).ready(function() {
$('#inviteEmail').bind('focus', function() {
$('#inviteEmail').val(defaultTextEmail);
var currentValue = $.trim($(this).val());
if(currentValue == 'Email') $(this).val('');
});
$('#inviteEmail').bind('blur', function() {
var currentValue = $.trim($(this).val());
if(currentValue == '') $(this).val('Email');
});
$('#invitePassword').bind('focus', function() {
$('#invitePassword').val(defaultTextPassword);
var currentValue = $.trim($(this).val());
if(currentValue == 'Password') {
$(this).val('');
$(this).prop('type', 'password');
}
});
$('#invitePassword').bind('blur', function() {
var currentValue = $.trim($(this).val());
if(currentValue == '') {
$(this).val('Password');
$(this).attr('type', 'text');
} …Run Code Online (Sandbox Code Playgroud) 什么是HTML的XHTML等价物placeholder.
有人可以帮助我创建我的自定义Web用户控件,以动态呈现到占位符?
我刚刚创建了一个Web用户控件,它在服务器端没有代码只是在aspx中设计,因为所有的功能都是客户端的.
网络控制
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebControlDemo.ascx.cs" Inherits="Project1.Web.UI.WebControlDemo" %>
<div>
Blah blah blah blah
</div>
Run Code Online (Sandbox Code Playgroud)
在另一页
protected void button1_Click(object sender, EventArgs e)
{
WebControlDemo wcd = new WebControlDemo();
this.placeHolder1.Controls.Add(wcd);
}
Run Code Online (Sandbox Code Playgroud)
但我看不到任何东西.那么我需要添加的内容最终会被渲染出来?
为UITextView创建占位符的最佳方法是什么,占位符将具有不同的颜色和字体.我想要的一个例子是:
_textView = [[UITextView alloc] initWithFrame:CGRectMake(7.0, 35.0, 306.0, 90.0)];
_textView.text = @"This is a variable called foo.";
Run Code Online (Sandbox Code Playgroud)
我希望文中的"foo"更大胆,颜色更深.
怎么做得最好?
我有一个跨浏览器问题,其中嵌套在我的Rails应用程序的搜索栏中的占位符文本不会出现在Mozilla中,尽管在所有其他浏览器中工作都很棒.
我没有成功地四处寻找答案.
<nav class="navbar navbar-static-top navbar-default" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<%= image_tag('nippon.svg', alt: "Nippon Beauty", class: "navbar-brand-icon") %>
</a>
</div>
<input type="text" class="searchTerm" placeholder="What type of Skincare product would you like?">
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse"> …Run Code Online (Sandbox Code Playgroud) 给定字符串:
s = "Why did you foo bar a <b>^f('y')[f('x').get()]^? and ^f('barbar')^</b>"
Run Code Online (Sandbox Code Playgroud)
如何用字符串替换^f('y')[f('x').get()]^和^f('barbar')^,例如PLACEXHOLDER?
所需的输出是:
Why did you foo bar a <b>PLACEXHOLDER? and PLACEXHOLDER</b>
Run Code Online (Sandbox Code Playgroud)
我试过了,re.sub('\^.*\^', 'PLACEXHOLDER', s)但.*贪婪,它匹配,^f('y')[f('x').get()]^? and ^f('barbar')^并输出:
您为什么foo禁止PLACEXHOLDER
可能存在多个未知数字的子字符串,这些子字符串由进行编码,\^因此不希望这样做:
re.sub('(\^.+\^).*(\^.*\^)', 'PLACEXHOLDER', s)
Run Code Online (Sandbox Code Playgroud) 我正在使用jsfiddle中的这段代码来为搜索栏中的占位符文本设置动画。最终结果是看起来像正在键入。现在,它只键入一个短语,而我想让它键入一个短语,然后替换为另一个,依此类推。任何帮助将不胜感激。
// your custom placeholder goes here!
var ph = "Search Website e.g. \"Dancing Cats\"",
searchBar = $('#search'),
// placeholder loop counter
phCount = 0;
// function to return random number between
// with min/max range
function randDelay(min, max) {
return Math.floor(Math.random() * (max-min+1)+min);
}
// function to print placeholder text in a
// 'typing' effect
function printLetter(string, el) {
// split string into character seperated array
var arr = string.split(''),
input = el,
// store full placeholder …Run Code Online (Sandbox Code Playgroud) 我正在寻找建议和反馈,因为我无法确定要走的路.
我正在构建HTML5表单,我希望它们尽可能简单易用.这就是为什么我总是使用label来解释在字段中输入的内容,并使用占位符作为具有良好格式的值的示例.
所以,我的代码总是如下:
<form>
<fieldset>
<p>
<label for="origin-field">Please enter your origin address</label>
<input type="text" name="origin" id="origin-field" placeholder="23th Street, New York City" required />
</p>
<p>
<label for="destination-field">Please enter you destination address</label>
<input type="text" name="destination" id="destination-field" placeholder="Ashbury Street, San Francisco" required />
</p>
</fieldset>
<p>
<input type="submit" />
</p>
</form>
Run Code Online (Sandbox Code Playgroud)
可以访问此代码,使用for属性将标签链接到输入,简而言之,它遵循最佳实践.它具有其他用户体验优势:如果用户单击输入然后分心,标签将始终显示在其旁边,并且可以轻松地提醒他们输入正在等待的信息.
但是,我的产品所有者和我的设计师非常希望我删除标签并使用占位符代替,所以代码就是
<form>
<fieldset>
<p>
<input type="text" name="origin" id="origin-field" placeholder="Origin address" required />
</p>
<p>
<input type="text" name="destination" id="destination-field" placeholder="Destination address" required />
</p>
</fieldset>
<p>
<input type="submit" />
</p>
</form> …Run Code Online (Sandbox Code Playgroud) placeholder ×10
html ×3
asp.net ×2
c# ×2
css ×1
forms ×1
html5 ×1
input ×1
ios ×1
ios5 ×1
ios7 ×1
iphone ×1
javascript ×1
label ×1
non-greedy ×1
python ×1
regex ×1
regex-greedy ×1
render ×1
uitextfield ×1
uitextview ×1
xcode4.3 ×1
xhtml ×1