Solved

How do I change formview mode to insert, if on page load, there’s no data to bind (ASP.NET C#)

Posted on 2010-11-18
3
686 Views
Last Modified: 2013-12-17
In pseudo code this is what I’m trying to do, but can’t get it to work.

Pseudo code:
If (formview1 = null)
{
formview1.mode = insertMode;
}

Can someone help me with this?

Thanks!
0
Comment
Question by:bmanmike39
  • 2
3 Comments
 
LVL 12

Expert Comment

by:CmdoProg2
ID: 34165269
formview1.ChangeMode(FormViewMode.Insert);
0
 
LVL 12

Accepted Solution

by:
CmdoProg2 earned 500 total points
ID: 34165308
Opps,  didn't include the condition
if (formview1.DataItemCount == 0)

      {

        formview1.ChangeMode(FormViewMode.Insert);

      }

Open in new window

0
 

Author Closing Comment

by:bmanmike39
ID: 34166039
Thanks!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

943 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

10 Experts available now in Live!

Get 1:1 Help Now