小编use*_*069的帖子

MVC从不同的控制器调用视图

我的项目结构如下:

  • 控制器/ ArticlesController.cs
  • 控制器/ CommentsController.cs
  • 查看/用品/ Read.aspx

Read.aspx采用一个参数说"输出",这是由id及其注释传递的文章的细节 ArticlesController.cs

现在我想写,然后阅读评论:: write()&Read()funct inCommentsController.cs

对于读其评论文章中,我想打电话Views/Articles/Read.aspxCommentsController.cs通过从通过输出参数CommentsController.cs

我怎样才能做到这一点?

UPDATE

代码在这里:

public class CommentsController : AppController
{
    public ActionResult write()
    {
        //some code
        commentRepository.Add(comment);
        commentRepository.Save();

        //works fine till here, Data saved in db
        return RedirectToAction("Read", new { article = comment.article_id });
    }

    public ActionResult Read(int article)
    {   
        ArticleRepository ar = new ArticleRepository();
        var output = ar.Find(article);

        //Now I want to redirect to Articles/Read.aspx with output parameter. …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc

19
推荐指数
1
解决办法
9万
查看次数

如何使用HMAC SHA256?

根据我使用HMAC SHA256阅读的各种文档,我已经理解:

H(K XOR opad,H(K XOR ipad,text))其中H在我的情况下是SHA256.

但是,SHA256输入只有一个参数,即消息.而H(K,text)有两个输入.那么如何计算H(k,文本)?

我应首先使用k对文本进行编码,然后使用H(encoded_text),其中encoded_text将用作消息?

谢谢

sha256 hmac

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

asp.net-mvc ×1

c# ×1

hmac ×1

sha256 ×1