网友您好, 请在下方输入框内输入要搜索的题目:
YoucreateaWebpagenamedTestPage.aspxandausercontrolnamedTestUserControl.ascx.TestPage.aspxusesTestUserControl.ascxasshowninthefollowinglineofcode.OnTestUserControl.ascx,youneedtoaddaread-onlymembernamedCityNametoreturnthevalue"NewYork".YoualsomustaddcodetoTestPage.aspxtoreadthisvalue.Whichtwoactionsshouldyouperform?()
A.AddthefollowinglineofcodetotheTestUserControl.ascx.cscode-behindfile.publicstringCityName{get{return"NewYork";}}
B.AddthefollowinglineofcodetotheTestUserControl.ascx.cscode-behindfile.protectedreadonlystringCityName="NewYork";
C.AddthefollowingcodesegmenttotheTestPage.aspx.cscode-behindfile.protectedvoidPage_Load(objectsender,EventArgse){strings=testControl.CityName;}
D.AddthefollowingcodesegmenttotheTestPage.aspx.cscode-behindfile.protectedvoidPage_Load(objectsender,EventArgse){strings=testControl.Attributes["CityName"];}
参考答案