473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

IField or IWebPartField How to

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;

}

}
May 22 '07 #1
1 1791
Yes, IField is deprecated. You don't really need IWebPartField to move data
between web parts either strictly speaking but it is a good approach as
well.

Here's a link that i refer to often, it will help you sort out your issues.
http://msdn2.microsoft.com/en-us/lib...ld(VS.80).aspx

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"rote" <na********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
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;

}

}


May 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mr_burns | last post by:
Hi there, I am using the following code to enter text into text box when it is empty: <input name="txt_url" type="text" class="form_text_300" id="txt_url" onClick="if(this.value ==...
0
by: clivegisworkuk | last post by:
I am running this on a Pocket PC NOT on a PC. I want to select a row of data, then insert the row of data from tableA into tableB. Is this possible??? Any assistance would be appreciated as I...
1
by: clivegisworkuk | last post by:
I am running this on a Pocket PC NOT on a PC. I am trying to add a row from Table A into table B. This must be possible!!!!! Any assistance appreciated. Cheers Clive ...
6
by: Lionel Slade | last post by:
Hi, I've bound some drop down lists to a dataset, but if the iexplorer window is resized the contents of the lists are lost? Why is this happening? AutoPostback is set to true.
8
by: Steven Cummings | last post by:
Hello, I've scoured this usenet group and didn't find anything specific to my problem, so hopefully this won't be a repeated question. I'm all but certain it's not. I would like to *declare*...
1
by: Stu | last post by:
Hi, I am trying to write a detailed logging system for a site. The client basically wants us to save the values of the properties on the page every time someone presses a save button. I have...
6
by: rote | last post by:
I was looking at this article at http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebpartfield(VS.80).aspx regarding IWebPartField Interface But the C# code is jsut...
0
by: rote | last post by:
I can get my webpart working :) When i uncomment the below but it doesn't pass parameter values btw webparts :( But still got some question though below: I get error...
0
by: rote | last post by:
My goal is to have 2 webparts connected which will have Gridviews in it. I have tried the following sample at: http://www.carlosag.net/Articles/WebParts/moreRealSample.aspx But i can't get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.