Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 10th, 2011, 02:54 PM
Registered User
Join Date: Oct 2009
Location: Ahmedabad, India
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ritesh7 Send a message via Yahoo to ritesh7
Default exit sub in C#

i have the following code

protected void btnSelect_Click(object sender, EventArgs e)
int count = 0;
foreach (GridViewRow i in gvDetails.Rows)
CheckBox chk = new CheckBox();
chk = (CheckBox)i.FindControl("chkSelect");
if (chk.Checked == true)
count = count + 1;

if (count ==0)
lblMessage.Text = "Please select a student First";


in the above c# code I want to exit from the event if count ==0 so what statement should I give next. In vb I can give exit sub what in case of C# pls help me asap
  #2 (permalink)  
Old January 10th, 2011, 06:41 PM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts

Your biggest tool as a developer is the ability to learn for yourself.

In this instance what you need to learn is how to use Google (or any other popular search engine).
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to exit from for-each vijay_bablani XSLT 3 April 26th, 2010 07:33 AM
on exit mohiddin52 Access VBA 2 July 10th, 2007 09:28 AM
exit from for-each preethi.s XSLT 1 September 8th, 2006 05:37 AM
Exit Application King_ General .NET 0 February 23rd, 2006 10:30 AM
session_destroy on exit?? harmen_wessels PHP How-To 2 July 5th, 2003 09:41 PM

All times are GMT -4. The time now is 05:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.