刷新视图组件.net core RC2 [英] Refresh view component .net core RC2

查看:57
本文介绍了刷新视图组件.net core RC2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个普通视图,里面有两个视图组件.普通视图也有一个按钮,两个视图组件也都有一个按钮.

I have one normal view with two views components inside. Normal view have also a button and the both views components have a button too.

从普通视图中单击按钮后,如何刷新视图组件?在第一个视图组件上单击botton之后,如何刷新第二个视图组件?

How i can refresh the views components after clicking on button from normal view? And how i can refresh second view component after clicking on botton from first view component?

我已经试图找到一种方法,但是没有成功!

I already tryed to find a way, but without success!

最诚挚的问候

推荐答案

我尝试过:


`$("#buttonrefresh").on("click", function () {`
    `$.ajax({`
        `type: "GET",`
        `url: '@Url.Action("VCTest")'`
    `(function (result) {`
        `$("#show").html(result);`
    `});`
`});`

此脚本用于在从普通视图中单击按钮后刷新一个视图组件.VCTest是视图组件的名称.show是调用视图组件的div的名称.

This script is to refresh one view component after clicking on button from normal view. VCTest is the name of the view component. show is the name of the div where the view component is called.

这篇关于刷新视图组件.net core RC2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆