这段代码中“this”的目的是什么?
问题描述:
ClientScript.RegisterStartupScript(this.GetType(),"key","<script>alert('First:"+firstDate.ToShortDateString()+"')</script>");
答
''此
''是对象的引用这是调用GetType()
方法。在你的情况下,它是不需要的。
''this
'' is a reference to the object that is calling theGetType()
method. In your case it is not needed.