重用旧文章中的代码。 [英] Reuse of code from an old article.

查看:81
本文介绍了重用旧文章中的代码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hej,

我正在尝试重用2010年增强TextBox和Button的代码示例。

示例和代码下载适用于拿起网站上的代码。因此很容易测试。



文章位于以下位置:

https://www.codeproject.com/Articles/ 68834 /增强型文本框控制

我在那里留下了一个问题,但有人看看旧文章吗?



现在,我想要重用母版页上的Web项目中的控件,以创建站点搜索的UI。所以我创建了一个新的Web项目,选择asp.net Web应用程序并尝试将MyTextBox添加到Site.Master。我只是无法让它运行起来。



注册控制权的巨大问题,事实上 - 我即将放弃。



任何人都有任何想法吗?



或许你可以指引我在一个主页上运行的代码并给我一个带水印的输入框可以工作并可以转换成网站搜索的用户界面吗?



我尝试了什么:



我没试过什么?我用Google搜索并尝试了我的所有想法。

我可以说我使用的是VS2010

Hej,
I am trying to reuse an example of code from 2010 enhancing a TextBox and Button.
The example, and downloading of the code, works well when picking up the code in a Web Site. So it is easy to test.

The article is on this location:
https://www.codeproject.com/Articles/68834/Enhanced-Textbox-Control
and I have left a question there but do anybody look at old articles?

Now, I want to reuse the controls in a web project on the masterpage, to create a UI for a Site Search. So I create a new web project, select the asp.net web application and tries to add the "MyTextBox" to the Site.Master. I just can't get it up running.

Huge problems with registrering of the control, in fact - I am about to give up.

Anyone have any ideas?

Or maybe you can direct me to a piece of code that run on a masterpage and give me an input box with watermark that works and could be turned into UI for a Site Search?

What I have tried:

What have I not tried? I have googled and tried all my ideas.
I can however say that I am using VS2010

推荐答案

Quote:

或者你可以指引我在一个母版页上运行的代码片段给我一个带水印的输入框,可以将其转换为网站的UI搜索?

Or maybe you can direct me to a piece of code that run on a masterpage and give me an input box with watermark that works and could be turned into UI for a Site Search?



听起来你正在寻找占位符属性:

占位符属性 - < input>:输入(表单输入)元素 - HTML:超文本标记语言| MDN [ ^ ]

asp.net - 如何在asp:textbox中添加提示 - Stack Overflow [ ^ ]



注意:如果你使用的是in而不是标签,那么你应该知道可用性问题:

不要使用占位符属性 - 粉碎杂志 [ ^ ]


Sounds like you're looking for the placeholder attribute:
The placeholder attribute - <input>: The Input (Form Input) element - HTML: HyperText Markup Language | MDN[^]
asp.net - How do I put hint in a asp:textbox - Stack Overflow[^]

NB: If you're using in instead of a label, then you should be aware of the usability issues:
Don’t Use The Placeholder Attribute — Smashing Magazine[^]


这篇关于重用旧文章中的代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆