0
다음 시험 : 제어 ID로 "$ ContentPlaceHolder1 $ 컨트롤의 controlid ctl00"찾을 수 없습니다 제어 (ASP.NET, MS TEST)
[TestClass]
public class MyTestClass
{
private TestContext _testContext;
protected TestContext TestContext
{
get { return _testContext; }
set { _testContext = value; }
}
[TestMethod]
[HostType("ASP.NET")]
[UrlToTest("http://localhost/MyPage.aspx")]
public void TestMyPage()
{
TextBox tb = TestContext.RequestedPage.FindControl("ControlId") as TextBox;
Assert.IsNotNull(tb);
}
}
이 실패하고 문자열을 사용은 적절한 제어를 제공합니다 ... ASP.NET에는 웹 컨트롤에 대한 "ClientID"속성이 있지만 테스트 (Under VS 2008)에서 컨트롤의 클라이언트 ID를 미리 알 수있는 가능성이 있습니까?
감사합니다.