Ich habe ein Webcontol gebaut in dem ich über eine Methode auf einen Wert zugreife.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="InfoControl.ascx.cs" Inherits="App_Include_Controls_PreistippControl" %>
<table>
<tr>
<td>
<img src="~/App_Themes/Master/images/icon/tipp.png" runat="server" width="23" height="23" alt="" />
</td>
<td style="padding-left: 5px;">
<strong>Info:</strong>
<a href="<%# this.Url %>"><%# this.Text %></a>
</td>
</tr>
</table>
Die URL und der Text wird über diese Methoden gesetzt.
protected void Page_Load(object sender, EventArgs e)
{
this.Text = oDataTable.Rows[0]["ueberschrift"].ToString();
this.Url = "~/News/Aktuelles/d_default.aspx?NewsId=" + oDataTable.Rows[0]["id"].ToString();
}
protected string sUrl;
public string Url
{
get { return this.sUrl; }
set { this.sUrl = value; }
}
protected string sText;
public string Text
{
get { return this.sText; }
set { this.sText = value; }
}
Beim debuggen setzt er auch die Werte z.B. set { this.sText = value; }
nur die Getter z.B. get { return this.sText; } geht er garnicht erst rein ...
Was mach ich falsch?