Solved

disable a formview

Posted on 2006-06-19
2
528 Views
Last Modified: 2008-02-01
In ASP.Net 2.0 I have  a page with a formview .
Its default mode is readonly and there there is a button of new and when it is pressed the fromview in
insert mode is shown.
I want to make a check while pressing the New and in a certain case not to enable the insert view.
I thought to do it in the event itemcommand.
My question is how to disable the insert show in a certain case.
Thankyou
Anat.
0
Comment
Question by:ANAT2403
2 Comments
 
LVL 6

Accepted Solution

by:
e1v earned 500 total points
ID: 16933449
Add a ModeChanging event handler like this to your FormView: (shown in c#)

protected void FormView1_ModeChanging(object sender, FormViewModeEventArgs e)
{
    bool yourCheckHere = true;
    if (e.NewMode == FormViewMode.Insert && yourCheckHere) e.Cancel = true;
}



0
 
LVL 7

Expert Comment

by:kGenius
ID: 16933496

If YOUR CONDITION = true Then
  FormView1.ChangeMode(FormViewMode.ReadOnly)
Else
  FormView1.ChangeMode(FormViewMode.Insert)
End If
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now