fallback method wasn't found

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/didi7696/article/details/80389746

目标方法和回退方法参数和返回类型要一致 ##“`

@HystrixCommand(fallbackMethod = “fallbackHi”)
public String getHi(String x) {
String msg = restTemplate.getForObject(“http://jack/hi“, String.class);
return msg;
}

public String fallbackHi(String x){
return “can’t say hi, and get: ” + x;
}
“`

阅读更多
换一批

DetailsView的wasn't handled问题

07-17

郁闷,baidu不到,只好来问了.rn错误提示是The DetailsView 'DetailsView1' fired event ModeChanging which wasn't handledrnrn首先,第一次进入页面没问题,能显示DetailsView ,但是我一点击Edit User Info就出错.rn我DetailsView 没有DataSourceID,直接绑到了一个ArrayList上,难道这就是出错的原因??难道是OnItemUpdating事件有错??首先名字什么的绝对是匹配,然后OnItemUpdating事件里的代码我是直接抄的,原代码都没有问题,怎么抄过来就有问题了?只不过原代码DetailsView 是有DataSourceID 而已.rnrn下面这个是DetailsView 的代码rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rnrncs的代码如下rnpublic partial class xingxi : System.Web.UI.Pagernrn MembershipUser user;rnrn private void Page_Load(object sender, EventArgs e)rn rn user = Membership.GetUser();rn UserUpdateMessage.Text = "";rn if (!IsPostBack)rn rn ArrayList list = new ArrayList(1);rn list.Add(user);rn DetailsView1.DataSource = list;rn DetailsView1.DataBind();rn rn rnrn protected void DetailsView1_ItemUpdating1(object sender, DetailsViewUpdateEventArgs e)rn rn //Need to handle the update manually because MembershipUser does not have arn //parameterless constructor rnrn user.Email = (string)e.NewValues[0];rn user.Comment = (string)e.NewValues[1];rn user.IsApproved = (bool)e.NewValues[2];rnrn tryrn rn // Update user info:rn Membership.UpdateUser(user);rnrn UserUpdateMessage.Text = "更新成功.";rnrn e.Cancel = true;rn DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);rn rn catch (Exception ex)rn rn UserUpdateMessage.Text = "更新失败: " + ex.Message;rnrn e.Cancel = true;rn DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);rn rn rnrnrnrn[HttpException (0x80004005): The DetailsView 'DetailsView1' fired event ModeChanging which wasn't handled.]rn System.Web.UI.WebControls.DetailsView.OnModeChanging(DetailsViewModeEventArgs e) +1511207rn System.Web.UI.WebControls.DetailsView.HandleEdit() +64rn System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +391rn System.Web.UI.WebControls.DetailsView.RaisePostBackEvent(String eventArgument) +194rn System.Web.UI.WebControls.DetailsView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7rn System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11rn System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102rn

没有更多推荐了,返回首页