?
Solved

disable a formview

Posted on 2006-06-19
2
Medium Priority
?
576 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

777 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