c# - Is there anyway to call a function in a class that inherits from system.web.ui.page from a mvc3 controller? -


i have cs file delivered vendor structure following:

public partial class test : system.web.ui.page  {      public void insertsignature()     {          response.write("asdfasdfaf#wrrasdfcaerasdcdsaf");     }  }  

i attempting use insertsignature function in mvc 3 application using following code

mysample sample = new test();  sample.insertsignature(); 

i'm getting following httpexception: "response not available in context." there anyway can work out modifying vendor delivered product. know there ways make work modifying file if @ possible great avoid doing this.

thanks in advance.

it seems known issue (response not available in context)

just replace

response.write("asdfasdfaf#wrrasdfcaerasdcdsaf");  

with

httpcontext.current.response.write("asdfasdfaf#wrrasdfcaerasdcdsaf");  

and trick. doesn't seem big change.

update: if wish prevent code rewriting future updates, rename method - e.g. insertsignature() insertsig(). if file being updated vendor's version, not compile, , clear reason is.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -