添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
I am unable to use Response.Write() in class library?
It gives me error that "The name Response does not exist in the current context".
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Default_Construtor public class Class1 public void Show() Response.Write( " Hello World" ); Please suggest.
Thanks & Regards,
Aditya Kumar You don't want to do it in a class library, if you can avoid it. However, you can do it by using the full naming:
System.Web.HttpContext.Current.Response.Write(); // as i recall from memory. It's a bad practice.
Instead you should set one flag in class file and use it later in codebehind.
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •