griegs
griegs

Reputation: 22760

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='<%= this.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!

Upvotes: 1

Views: 82

Answers (1)

rabs
rabs

Reputation: 1827

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 }
}

Upvotes: 2

Related Questions