EDN Admin
Well-known member
<pre style="font-family:Consolas; font-size:10pt; color:black; background:none repeat scroll 0% 0% white <span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @{<br/> <span style="color:#222222 Layout <span style="color:#222222 = <span style="color:#823125 "~/_Layout.cshtml"<span style="color:#222222 ;<br/> <span style="color:#222222 Page<span style="color:#222222 .<span style="color:#222222 Title <span style="color:#222222 = <span style="color:#823125 "Delete an Applicant"<span style="color:#222222 ; <br/> <br/> <span style="color:#4f76ac var <span style="color:#222222 LastName <span style="color:#222222 = <span style="color:#823125 ""<span style="color:#222222 ;<br/> <span style="color:#4f76ac var <span style="color:#222222 FirstName <span style="color:#222222 = <span style="color:#823125 ""<span style="color:#222222 ;<br/> <span style="color:#4f76ac var <span style="color:#222222 DateOfBirth <span style="color:#222222 = <span style="color:#823125 ""<span style="color:#222222 ;<br/> <span style="color:#4f76ac var <span style="color:#222222 Address <span style="color:#222222 = <span style="color:#823125 ""<span style="color:#222222 ;<br/> <span style="color:#4f76ac var <span style="color:#222222 EmailAddress <span style="color:#222222 = <span style="color:#823125 ""<span style="color:#222222 ;<br/> <span style="color:#4f76ac var <span style="color:#222222 ApplicantID <span style="color:#222222 = <span style="color:#823125 ""<span style="color:#222222 ;<br/> <br/> <span style="color:#4f76ac if<span style="color:#222222 (<span style="color:#222222 !<span style="color:#222222 IsPost<span style="color:#222222 ){<br/> <span style="color:#4f76ac if<span style="color:#222222 (<span style="color:#222222 !<span style="color:#222222 Request<span style="color:#222222 .<span style="color:#222222 QueryString<span style="color:#222222 [<span style="color:#823125 "AplicantID"<span style="color:#222222 ]<span style="color:#222222 .<span style="color:#222222 IsEmpty<span style="color:#222222 () <span style="color:#222222 && <span style="color:#222222 Request<span style="color:#222222 .<span style="color:#222222 QueryString<span style="color:#222222 [<span style="color:#823125 "ApplicantID"<span style="color:#222222 ]<span style="color:#222222 .<span style="color:#222222 IsInt<span style="color:#222222 ()){<br/> <span style="color:#222222 ApplicantID <span style="color:#222222 = <span style="color:#222222 Request<span style="color:#222222 .<span style="color:#222222 QueryString<span style="color:#222222 [<span style="color:#823125 "ApplicantID"<span style="color:#222222 ];<br/> <span style="color:#4f76ac var <span style="color:#222222 db <span style="color:#222222 = <span style="color:#1e7c70 Database<span style="color:#222222 .<span style="color:#222222 Open<span style="color:#222222 (<span style="color:#823125 "Applicant List"<span style="color:#222222 );<br/> <span style="color:#4f76ac var <span style="color:#222222 dbCommand <span style="color:#222222 = <span style="color:#823125 "SELECT * FROM List WHERE ApplicantID = @0"<span style="color:#222222 ;<br/> <span style="color:#4f76ac var <span style="color:#222222 row <span style="color:#222222 = <span style="color:#222222 db<span style="color:#222222 .<span style="color:#222222 QuerySingle<span style="color:#222222 (<span style="color:#222222 dbCommand<span style="color:#222222 , <span style="color:#222222 ApplicantID<span style="color:#222222 );<br/> <span style="color:#4f76ac if<span style="color:#222222 (<span style="color:#222222 row <span style="color:#222222 != <span style="color:#4f76ac null<span style="color:#222222 ) <span style="color:#222222 {<br/> <span style="color:#222222 LastName <span style="color:#222222 = <span style="color:#222222 row<span style="color:#222222 .<span style="color:#222222 LastName<span style="color:#222222 ;<br/> <span style="color:#222222 FirstName <span style="color:#222222 = <span style="color:#222222 row<span style="color:#222222 .<span style="color:#222222 FirstName<span style="color:#222222 ;<br/> <span style="color:#222222 DateOfBirth <span style="color:#222222 = <span style="color:#222222 row<span style="color:#222222 .<span style="color:#222222 DateOfBirth<span style="color:#222222 ;<br/> <span style="color:#222222 Address <span style="color:#222222 = <span style="color:#222222 row<span style="color:#222222 .<span style="color:#222222 Address<span style="color:#222222 ;<br/> <span style="color:#222222 EmailAddress <span style="color:#222222 = <span style="color:#222222 row<span style="color:#222222 .<span style="color:#222222 EmailAddress<span style="color:#222222 ;<br/> <span style="color:#222222 }<br/> <span style="color:#4f76ac else<span style="color:#222222 {<br/> <span style="color:#222222 Validation<span style="color:#222222 .<span style="color:#222222 AddFormError<span style="color:#222222 (<span style="color:#823125 "No Applicant was found for that ID."<span style="color:#222222 );<br/> <span style="color:#46830d // If you are using a version of ASP.NET Web Pages 2 thats<br/> <span style="color:#46830d // earlier than the RC release, comment out the preceding<br/> <span style="color:#46830d // statement and uncomment the following one.<br/> <span style="color:#46830d //ModelState.AddFormError("No Applicant was found for that ID.");<br/> <span style="color:#222222 }<br/> <span style="color:#222222 }<br/> <span style="color:#4f76ac else<span style="color:#222222 {<br/> <span style="color:#222222 Validation<span style="color:#222222 .<span style="color:#222222 AddFormError<span style="color:#222222 (<span style="color:#823125 "No Applicant was found for that ID."<span style="color:#222222 );<br/> <span style="color:#46830d // If you are using a version of ASP.NET Web Pages 2 thats<br/> <span style="color:#46830d // earlier than the RC release, comment out the preceding<br/> <span style="color:#46830d // statement and uncomment the following one.<br/> <span style="color:#46830d //ModelState.AddFormError("No Applicant was found for that ID.");<br/> <span style="color:#222222 }<br/> <span style="color:#222222 }<br/> <br/> <span style="color:#4f76ac if<span style="color:#222222 (<span style="color:#222222 IsPost <span style="color:#222222 && <span style="color:#222222 !<span style="color:#222222 Request<span style="color:#222222 [<span style="color:#823125 "buttonDelete"<span style="color:#222222 ]<span style="color:#222222 .<span style="color:#222222 IsEmpty<span style="color:#222222 ()){<br/> <span style="color:#222222 ApplicantID <span style="color:#222222 = <span style="color:#222222 Request<span style="color:#222222 .<span style="color:#222222 Form<span style="color:#222222 [<span style="color:#823125 "ApplicantID"<span style="color:#222222 ];<br/> <span style="color:#4f76ac var <span style="color:#222222 db <span style="color:#222222 = <span style="color:#1e7c70 Database<span style="color:#222222 .<span style="color:#222222 Open<span style="color:#222222 (<span style="color:#823125 "Applicant List"<span style="color:#222222 );<br/> <span style="color:#4f76ac; text-decoration:underline var <span style="color:#222222; text-decoration:underline deleteCommand <span style="color:#222222; text-decoration:underline = <span style="color:#823125; text-decoration:underline "DELETE FROM List WHERE ApplicantID = @0" <span style="color:#222222; text-decoration:underline ; <br/> <span style="color:#222222 db<span style="color:#222222 .<span style="color:#222222 Execute<span style="color:#222222 (<span style="color:#222222 deleteCommand<span style="color:#222222 , <span style="color:#222222 ApplicantID<span style="color:#222222 );<br/> <span style="color:#222222 Response<span style="color:#222222 .<span style="color:#222222 Redirect<span style="color:#222222 (<span style="color:#823125 "~/ApplicantList"<span style="color:#222222 );<br/> <span style="color:#222222 }<br/><span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) }<br/><span style="color:#4f76ac <<span style="color:#823125 html<span style="color:#4f76ac ><br/><span style="color:#4f76ac <<span style="color:#823125 head<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 title<span style="color:#4f76ac >Delete an Applicant<span style="color:#4f76ac </<span style="color:#823125 title<span style="color:#4f76ac ><br/><span style="color:#4f76ac </<span style="color:#823125 head<span style="color:#4f76ac ><br/><span style="color:#4f76ac <<span style="color:#823125 body<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 h1<span style="color:#4f76ac >Delete an Applicant<span style="color:#4f76ac </<span style="color:#823125 h1<span style="color:#4f76ac ><br/> <span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 Html<span style="color:#222222 .<span style="color:#222222 ValidationSummary<span style="color:#222222 ()<br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 form <span style="color:#cf4820 method<span style="color:#4f76ac =<span style="color:#4f76ac "post"<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 fieldset<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 legend<span style="color:#4f76ac >Applicant Information<span style="color:#4f76ac </<span style="color:#823125 legend<span style="color:#4f76ac ><br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 span<span style="color:#4f76ac >Last Name:<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 span<span style="color:#4f76ac ><span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 LastName<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 span<span style="color:#4f76ac >First Name:<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 span<span style="color:#4f76ac ><span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 FirstName<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 span<span style="color:#4f76ac >Date Of Birth:<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 span<span style="color:#4f76ac ><span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 DateOfBirth<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 span<span style="color:#4f76ac >Address:<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 span<span style="color:#4f76ac ><span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 Address<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 span<span style="color:#4f76ac >Email Address:<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 span<span style="color:#4f76ac ><span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 EmailAddress<span style="color:#4f76ac </<span style="color:#823125 span<span style="color:#4f76ac ></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <br/> <span style="color:#4f76ac <<span style="color:#823125 input <span style="color:#cf4820 type<span style="color:#4f76ac =<span style="color:#4f76ac "hidden" <span style="color:#cf4820 name<span style="color:#4f76ac =<span style="color:#4f76ac "ApplicantID" <span style="color:#cf4820 value<span style="color:#4f76ac =<span style="color:#4f76ac "<span style="color:#222222; background:none repeat scroll 0% 0% rgb(215,191,73) @<span style="color:#222222 ApplicantID<span style="color:#4f76ac " <span style="color:#4f76ac /><br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 input <span style="color:#cf4820 type<span style="color:#4f76ac =<span style="color:#4f76ac "submit" <span style="color:#cf4820 name<span style="color:#4f76ac =<span style="color:#4f76ac "buttonDelete" <span style="color:#cf4820 value<span style="color:#4f76ac =<span style="color:#4f76ac "Delete List" <span style="color:#4f76ac /></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <span style="color:#4f76ac </<span style="color:#823125 fieldset<span style="color:#4f76ac ><br/> <span style="color:#4f76ac <<span style="color:#823125 p<span style="color:#4f76ac ><<span style="color:#823125 a <span style="color:#cf4820 href<span style="color:#4f76ac =<span style="color:#4f76ac "~/ApplicantList"<span style="color:#4f76ac >Return to Applicant listing<span style="color:#4f76ac </<span style="color:#823125 a<span style="color:#4f76ac ></<span style="color:#823125 p<span style="color:#4f76ac ><br/> <span style="color:#4f76ac </<span style="color:#823125 form<span style="color:#4f76ac ><br/> <span style="color:#4f76ac </<span style="color:#823125 body<span style="color:#4f76ac ><br/><span style="color:#4f76ac </<span style="color:#823125 html<span style="color:#4f76ac >[/code]
View the full article
View the full article