这段代码中“this”的目的是什么?

问题描述:

ClientScript.RegisterStartupScript(this.GetType(),"key","<script>alert('First:"+firstDate.ToShortDateString()+"')</script>");

''''是对象的引用这是调用 GetType()方法。在你的情况下,它是不需要的。
''this'' is a reference to the object that is calling the GetType() method. In your case it is not needed.