-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: subu78
Message 1 in Discussion
Hi Guys, I found a question from dumps for mCAD. Can anyone help me out,
26. You are creating an ASP.NET application to keep track of your company's employees.
Employees will use the application to indicate whether they are currently in the
office or out of the office.
The main page of the application is named ShowBoard.aspx. This page contains a
Repeater control named employeeStatus that is bound to the results of a stored
procedure in the backend database. The stored procedure provided all employee
identification numbers (IDs), all employee names, and each employee's current status
of either In if the employee is in the office or Out if the employee is out of the
office.
The HTML code for employeeStatus is as follows:
<asp:repeater id="employeeStatus" runat="server">
<ItemTemplate>
<%# Container.DataItem("EmployeeName")%>
(<%# Container.DataItem("Status")%>)<br>
</ItemTemplate>
</asp:repeater>
The code-behind file for ShowBoard.aspx contains a private procedure named
ChangeInOutStatus that toggles the status for an employee by using the employee's ID.
You need to add a button for each employee listed by employeeStatus. When an employee
clicks the button, you want the button to call ChangeInOutStatus and pass the employee
ID to toggle the status of the employee.
What are two possible ways to achieve this goal? (Each Ans: presents a complete
solution. Choose two)
a. Add the following HTML code to the ItemTemplate element of employeeStatus:
<input type="button" id="changeStatusButton"
alt=
OnClick="changeStatusButton" Runat="server"
Value="Change Status"/>
Add the following subroutine to the code-behind file for ShowBoard.aspx:
Public Sun changeStatusButton("
ByVal sender As System.Object,"
ByVal e As System.EventArgs)
ChangeInOutStatus(CInt(sender.Attributes("alt")))
End Sub
b. Add the following HTML code to the ItemTemplate element of employeeStatus:
<input type="button" id="changeStatusButton"
alt=<%# Container.DataItem("EmployeeID")%>
OnServerClick="changeStatusButton" Runat="server"
Value="Change Status"/>
Add the following subroutine to the code-behind file for ShowBoard.aspx:
Public Sub changeStatusButton("
ByVal sender As System.Object,"
ByVal e As System.EventArgs)
ChangeInOutStatus(CInt(sender.Attributes("alt")))
End Sub
c. Add the following HTML code to the ItemTemplate element of employeeStatus:
Text="Change Status"
CommandArgument=<%# Container.DataItem("EmployeeID")%>
/>
Add the following code to the ItemCommand event of employeeStatus:
If source.id = "changeStatusButton" Then
ChangeInOutStatus(CInt(e.CommandSource.CommandArgument)))
End If
d. Add the following HTML code to the ItemTemplate element of employeeStatus:
Text="Change Status"
CommandArgument=<%#Container.DataItem("EmployeeID")%>
/>
Add the following code to the ItemCommand event of employeeStatus:
If e.CommandSource.id = "changeStatusButton" Then
ChangeInOutStatus(CInt(e.CommandArgument))
End If
Thanx in advance
Subramanian Doraiswamy
Nexgenix
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]