2014-09-01 129 views
-4

我在面试中被问到以下情况。将数据从一个页面传递到另一个页面.net

我需要在.net web窗体或MVC中将数据从一个页面传递到另一个页面。但我不能使用以下内容。 1.会话 2.隐藏字段 3.饼干 4.视图状态 5.应用程序状态 6.查询字符串

任何另一种方式????

+3

愚蠢的面试问题,何必呢......?有一些方法可以做到,但我不确定它是否适合这个网站来回答它。 – walther 2014-09-01 11:04:05

+1

您可以使用HTTP请求正文或HTTP请求标题。 – Romoku 2014-09-01 11:04:43

+0

@Romoku你能提供一个简单的例子吗? – 2014-09-01 11:15:40

回答

0

您可以试试这个以供参考,此时有多种方法但是这个 记得。

//For saving in cache 
    WebCache.Set("test", "any data comes here", 10, false); // Cache the value for 10 minutes 

    //Retrieving the data 
     string test = WebCache.Get("test"); 
     if(!string.IsNullOrEmpty(test)) 
     { 
     //get test value here 
     } 
     else 
     { 
      //No data msg 
     } 
相关问题