Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

disable a formview

Posted on 2006-06-19
2
Medium Priority
?
581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
e1v earned 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

610 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