R
rote
THis code below was using the IField interface but apparently its deprecated
i changed it to use IWebpartField
but can't get it to work>
I'm havinfg a problem on this line at:- object fieldValue =
_data.GetFieldValue
Sample code below ans thanks in Adv
private IWebPartField _data;
private string _zipCode = String.Empty;
[Personalizable]
[WebBrowsable]
public string ZipCode {
get {
return _zipCode;
}
set {
_zipCode = value;
}
}
protected override void RenderContents(HtmlTextWriter writer) {
if (_data != null) {
object fieldValue = _data.GetFieldValue
if (fieldValue != null) {
_zipCode = fieldValue.ToString();
}
}
if ((_zipCode == null) || (_zipCode.Length == 0)) {
writer.Write("Select a zip code by personalizing this WebPart, or connecting
this WebPart to a Zip Code Provider.");
}
else {
writer.Write(String.Format(HtmlFormat, _zipCode));
}
}
[ConnectionConsumer("ZipCode")]
private void SetFieldConnectionData(IWebPartField data)
{
_data = data;
}
}
i changed it to use IWebpartField
but can't get it to work>
I'm havinfg a problem on this line at:- object fieldValue =
_data.GetFieldValue
Sample code below ans thanks in Adv
private IWebPartField _data;
private string _zipCode = String.Empty;
[Personalizable]
[WebBrowsable]
public string ZipCode {
get {
return _zipCode;
}
set {
_zipCode = value;
}
}
protected override void RenderContents(HtmlTextWriter writer) {
if (_data != null) {
object fieldValue = _data.GetFieldValue
if (fieldValue != null) {
_zipCode = fieldValue.ToString();
}
}
if ((_zipCode == null) || (_zipCode.Length == 0)) {
writer.Write("Select a zip code by personalizing this WebPart, or connecting
this WebPart to a Zip Code Provider.");
}
else {
writer.Write(String.Format(HtmlFormat, _zipCode));
}
}
[ConnectionConsumer("ZipCode")]
private void SetFieldConnectionData(IWebPartField data)
{
_data = data;
}
}