FormView控件和MS的Ajax的UpdatePanel [英] Formview and MS-Ajax UpdatePanel

查看:119
本文介绍了FormView控件和MS的Ajax的UpdatePanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和FormView控件编辑按钮由FormView控件引发了部分回发后,有条件的显示问题。我在ItemTemplate这样定义编辑按钮:

I have an issue with the conditional display of the formview edit button after a partial postback triggered by the formview control. I have an edit button defined in the ItemTemplate like this:

<asp:FormView ID="fvGenericDetails" runat="server">
    <ItemTemplate>
       <asp:Button ID="btnEditGenericDetails" runat="server" Visible="false" CausesValidation="False" CssClass="prepend-top" CommandName="Edit" Text="Edit Generic Details" />
</ItemTemplate>

按钮有条件显示基于在页面加载事件用户的privilages:

The button is conditionally displayed based on user privilages in the page load event:

If CurrentUser.HasAdminStatus and fvGenericDetails.CurrentMode = FormViewMode.ReadOnly Then
    Dim btnEditGenericDetails As Button =  CType(Me.fvGenericDetails.FindControl("btnEditGenericDetails"), Button)
    btnEditGenericDetails.Visible = True
End If

我遇到的问题是,由于FormView控件是一个UpdatePanel,部分回发时不控制返回到只读模式触发页面加载事件,编辑按钮不可见。我应该使用允许该部分回发什么事件?

The problem I'm having is that as the formview control is in an UpdatePanel, the partial postback does not trigger the page load event when the control goes back to read-only mode, and the edit button is not made visible. What event should I be using to allow for this partial postback?

编辑:已经调试的页面,部分回发后,页面确实击中了Page_Load事件,但formview.currentmode =编辑:|

Having debugged the page, after the partial postback, the page does indeed hit the page_load event but the formview.currentmode = edit :|

我已经使用ModeChanged事件没有成功尝试。只是不使用FormView控件的答案吗?

I've tried using the ModeChanged event without success. Is the answer just not to use the formview control?

感谢:)

推荐答案

男人,可能这会有所帮助,但要尽量改变prerender或初始化页面EVNT FormView控件视图

man, may be this will helps,but try to change the formview view on Prerender or Init page evnt

这篇关于FormView控件和MS的Ajax的UpdatePanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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