自定义 Web 部件参数-Sharepoint 2007

发布于 2024-10-13 15:45:08 字数 327 浏览 5 评论 0原文

我的 Webpart 需要一个参数,该参数将在页面使用期间提供。参数在文本框中提供,同时在页面中作为 Web 部件使用。

我放置了一个文本框,它应该以*****的格式获取参数作为密码。

我该怎么办呢。

我编辑了问题图表详细解释了

alt text

密码作为外部参数提供,并在部署期间提供Web 部件的。

任何人都可以帮助我吗?

卢克非常感谢您提供的答案,但我正在寻找这种输入。

谢谢哈里

·吉拉拉

My Webpart needs a parameter which will be supplied during the use in a page. The Parameter are supplied in the textbox while its being used in a page as web part.

I have placed a textbox and it should get the parameter as a password in the format of *****.

How can I do that.

I have edited the question The diagram explains in more details

alt text

The Password is supplied as an external parameter and supplied during the deployment of the webpart.

Could any body help me.

Luke many thanks for the answer you have provided but I am looking for this kind of input.

Thank You

Hari Gillala

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静若繁花 2024-10-20 15:45:08

如果我已经理解您想要正确执行的操作,您可能希望在 Web 部件中使用 TextBoc 控件,该控件会像密码输入框一样屏蔽输入。如果这是正确的,您可以按如下方式实现此目的:

public class LukeTestingWebPart : System.Web.UI.WebControls.WebParts.WebPart
{
    TextBox txtBox1; //Declare the TextBox control

    public LukeTestingWebPart()
    {
    }

    protected override void CreateChildControls()
    {
        //Create the child control with th text box mode as Password
        txtBox1 = new TextBox();
        txtBox1.TextMode = TextBoxMode.Password;
        Controls.Add(txtBox1);

        base.CreateChildControls();
    }

    protected override void RenderContents(HtmlTextWriter writer)
    {
        //Render a line of descriptive text and the textbox control 
        writer.Write("Here is a text box control that can be used to hold a password:<br />");
        txtBox1.RenderControl(writer);
    }
}

这是一个版本简单的 Web 部件,呈现一个文本框,其中输入被屏蔽...

我希望这有帮助...

If i have understood what you are wanting to do correctly, you would like to use a TextBoc control in a web part which masks the input like a password input box.. If this is correct you can achieve this as follows:

public class LukeTestingWebPart : System.Web.UI.WebControls.WebParts.WebPart
{
    TextBox txtBox1; //Declare the TextBox control

    public LukeTestingWebPart()
    {
    }

    protected override void CreateChildControls()
    {
        //Create the child control with th text box mode as Password
        txtBox1 = new TextBox();
        txtBox1.TextMode = TextBoxMode.Password;
        Controls.Add(txtBox1);

        base.CreateChildControls();
    }

    protected override void RenderContents(HtmlTextWriter writer)
    {
        //Render a line of descriptive text and the textbox control 
        writer.Write("Here is a text box control that can be used to hold a password:<br />");
        txtBox1.RenderControl(writer);
    }
}

This is a ver simple web part that renders a text box where the input is masked...

I hope this helps...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文