日期:2014-05-18  浏览次数:20787 次

asp.net(c#)中,Response.End()有无存在必要?
以前学C#的时候,都是用"return"
现在弄Web,觉得没必要用Response.End()
它们有什么区别?请指教。

------解决方案--------------------
Response.End()
是停止页面html代码的书写
return
是返回停止该函数操作
------解决方案--------------------
探讨
Response.End()
是停止页面html代码的书写
return
是返回停止该函数操作

------解决方案--------------------
这两个好像没有什么关系的吧。response.end应该表示应答结束的吧。
------解决方案--------------------
例如:
C# code
protected void Page_Load(object sender, EventArgs e)
    {
        Response.End();
       
    }

------解决方案--------------------
return是用在方法中的
 表示跳出方法 
response.end则是停止运行代码,直接输出
------解决方案--------------------
探讨
引用:
Response.End()
是停止页面html代码的书写
return
是返回停止该函数操作

你的意思是:就算用了Response.End(),下面的代码继续执行(除了页面html代码的书写)?

------解决方案--------------------
return是用在方法中的 
 表示跳出方法
response.end则是停止运行代码,直接输出
停止的应该是js代码吧