tailieunhanh - ASP.NET 1.1 Insider Solutions- P5

Tham khảo tài liệu ' insider solutions- p5', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 188 5 Creating Reusable Content LISTING Continued End If onclick selectList sCID dropbox1 textbox2 onkeyup scrollList sCID dropbox1 textbox2 onclick return openList _ sCID DataSource DataTextField DataTextFormatString Else True If CssClass Then CssClass CssClass End If onclick selectList sCID listbox textbox onkeyup scrollList sCID listbox textbox DataSource DataTextField DataTextFormatString End If SetWidth SetRows End Sub Now you can apply any CSS classname that may have been specified for the CssClass property to both the list and text box. Then you add the attributes to the text box and list that attach the client-side script functions. You use the complete ID of this instance of the user control which you generated earlier and specify the appropriate text box and list control IDs. If you re creating a drop-down combo box you also have to connect the openList function to the list control. Next you set the data binding properties of the list within the user control to the values specified for the matching properties of the user control and call the DataBind method. In fact you could check whether the DataSource property has been set first before setting the properties and Using the ComboBox Control 189 calling DataBind. This would probably be marginally more efficient although the DataBind method does nothing if the DatSource property is empty. Finally you call the SetWidth and SetRows routines again to ensure that any conflicting CSS styles are removed from the constituent controls. And that s it the ComboBox control is complete and ready to go. You

TỪ KHÓA LIÊN QUAN