开发者

Filling asp controls using Client Side C#

It's been a long time since I've used classic asp.net and asp: controls.

I have this textbox;

<asp:TextBox ID="txtTitle" runat="server" CssClass="fieldLge" Text='<%= t开发者_C百科his.Title %>'/>

In my cs I have;

 public string Title { get; set; }

The property is being set from a presenter.

However when I see my field on screen I see "<%= this.Title %>" as it's text and not the value of the property.

I know this is a mind numbingly silly question to ask but I can't figure it out. Love MVC!


Using MVP with Webforms you would normally set properties on controls directly from the property in the view interface.

change:

public string Title { get; set; }

to:

public string Title 
{ 
    get { return txtTitle.Text } 
    set { txtTitle.Text = value }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜