I thought the field length was default long enough since in the database it was listed as Text.
After doing some searches I saw some people creating custom field types in order to have a longer NoteField and they where actually using the type NoteField .
That is when I realized that it is in the control not the field type definition. The validation in the control is the only thing limiting the field length here.
So what I did was simply create a new render control that extends the NoteField type and I then override the "validate" function to stop all validating (in this case it removes limiting of the field to 255 chars).
And then voila all my old NoteFields are now nText length instead of 255 chars. You can create the control simply in a dll and throw it in the GAC or the bin. If you include it as a trusted dll in your web.config you can use it in your masterpages, or add it dynamically however you wish. The code is so simple it is not worth showing but what is interesting is that it is possible with out custom field definitions. Anyways the code is something like this:
class LongNoteField :NoteField
{
/*
my class actually includes overrides for all the functions but they are just call
base.
*/
public override void Validate()
{
//notics the comments here
//base.Validate();
}
public override void UpdateFieldValueInItem()
{
// base.UpdateFieldValueInItem();
// this may not be necessary but i am not really sure what this funcitons is doi
// the base.UpdateFIeldValueIntItem may trim the string or something so i just ignored it.
// simple setting the field item value manually workds as update() is called later.
this.ListItemFieldValue = this.Value.ToString();
}
}
I do this same things with the RichtHtmlFields in which case I then run this.value through an HTML cleaner (Tidy) to make it render valid XHTML. It is easier then paying for a 3rd controls and you can implement it on sites that already have data without having to migrate anything.
So there you go, more than 255 chars anywhere with MOSS 2007.
最豐滿最好之稻穗,便最貼近地面..................................................
BeantwoordenVerwijderen很喜歡你的blog哦...加油唷 ........................................
BeantwoordenVerwijderengreat msg for me, thanks a lot dude˙﹏˙
BeantwoordenVerwijderenthank for share, it is very important . ̄︿ ̄
BeantwoordenVerwijderenHello~Nice to meet you~..................................................
BeantwoordenVerwijderenTAHNKS FOR YOUR SHARING~~~VERY NICE ........................................
BeantwoordenVerwijderen文章很棒~感謝!!..................................................
BeantwoordenVerwijderen行萬里路勝讀萬卷書 ^^ 羨慕你哦!..................................................
BeantwoordenVerwijderen85cc 色情自拍 情色聊天室 色情視訊 情色文學 視訊聊天室 視訊聊天 正妹牆 成人影片 嘟嘟成人網 微風成人 av99影片 85街 撥打電話視訊 情色聊天 UT聊天室 情色視訊 免費視訊 成人視訊 影音視訊聊天室 露點 性高潮 85st 爆乳 0204 一夜 性愛 18禁 尋夢 火辣
BeantwoordenVerwijderen成熟,就是有能力適應生活中的模糊。..................................................
BeantwoordenVerwijderen要持續更新下去喲!!期待~~........................................
BeantwoordenVerwijderen自然是上帝最偉大的神來之筆。 ............................................................
BeantwoordenVerwijderen來幫推 你個blog影d相真係好靚,係我至愛~.................................................................
BeantwoordenVerwijderen知識可以傳授,智慧卻不行。每個人必須成為他自己。.................................................................
BeantwoordenVerwijderenPoverty is stranger to industry.................................................................
BeantwoordenVerwijderen成熟,就是有能力適應生活中的模糊。.................................................................
BeantwoordenVerwijderenIt takes all kinds to make a world.............................................................
BeantwoordenVerwijderen感謝您費心的分享您的生活!讓我也感同身受!..................................................................
BeantwoordenVerwijderen希望我的支持可以帶給你快樂--加油...................................................
BeantwoordenVerwijderen真是太有道理了~~我支持你~~~............................................................
BeantwoordenVerwijderen朋友是一面鏡子............................................................
BeantwoordenVerwijderen廢話不多,祝你順心~^^............................................................
BeantwoordenVerwijderenNo garden without its weeds.............................................................
BeantwoordenVerwijderen我們能互相給予的最佳禮物是「真心的關懷」。..................................................
BeantwoordenVerwijderen找一個懂妳的人也期許自己做一個人懂別人的人~.........................................
BeantwoordenVerwijderen人不能像動物一樣活著,而應該追求知識和美德............................................................
BeantwoordenVerwijderen要求適合自己的愛情方式,是會得到更多,還是會錯過一個真正愛你的人。.................................................................
BeantwoordenVerwijderen第一忠誠,第二勤奮,第三專心工作。..................................................
BeantwoordenVerwijderen人生最重要的一件事,就是從生活中認識你自己。.......................................................
BeantwoordenVerwijderenLets cross the bridge when we come to it............................................................
BeantwoordenVerwijderenthanks god for the chance to enjoy so many good artical...................................................................
BeantwoordenVerwijderen很精彩的部落格 期待你的繼續加油............................................................
BeantwoordenVerwijderen開心不開心都是一天,祝您能夠笑著面對一切!...............................................................
BeantwoordenVerwijderen做好事,不需要給人知道,雖然只是一件微不足道的事,但我相信,這會帶給我快樂。..................................................
BeantwoordenVerwijderen臨淵羨魚,不如退而結網。.. ... ............................................................
BeantwoordenVerwijderen河水永遠是相同的,可是每一剎那又都是新的。........................................
BeantwoordenVerwijderen