M
Morris Neuman
Hi,
I have a gridview that has 2 dropdownlists.
DropDownList 4 is bound to AccessDataSource4.
DropDownList2 needs to be bound to a DataSourceID depending on the value of
DropDownList4.
For example, in insert mode, if the user selects value "Mailboxes" in
DropDownList4 then I want DropDownList2 to be bound to AccessDataSource2, if
not then AccessDataSource3.
I don't get any error, however the values in the dropdownlist in
DetailsView1 are not correct.
My code is as follows:
<%@ Page Language="C#" MasterPageFile="~/MasterPage1.master"
Title="Admin-Manage Web Account-Mailboxes" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Label1.DataBind();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
DetailsView1.Visible = true;
}
protected void DetailsView1_ItemInserted(object sender,
DetailsViewInsertedEventArgs e)
{
GridView1.DataBind();
}
protected void DetailsView1_Prerender(object sender, EventArgs e)
{
DetailsView dv = (DetailsView)sender;
DropDownList DL2 = dv.FindControl("DropDownList2") as DropDownList;
DropDownList DL4 = dv.FindControl("DropDownList4") as DropDownList;
if (DL4.Text == "Mailboxes")
{
DL2.DataSourceID = "AccessDataSource2";
DL2.DataTextField = "BoxNumber";
DL2.DataValueField = "Boxnumber";
dv.DataBind();
}
else
{
DL2.DataSourceID = "AccessDataSource3";
DL2.DataTextField = "AttendantID";
DL2.DataValueField = "AttendantID";
dv.DataBind();
}
}
protected void DropDownList4_TableTypeSelectedIndexChanged(object
sender, EventArgs e)
{
DetailsView dv = (DetailsView)sender;
DropDownList DL2 = dv.FindControl("DropDownList2") as DropDownList;
DropDownList DL4 = dv.FindControl("DropDownList4") as DropDownList;
if (DL4.Text.ToString() == "Mailboxes")
{
DL2.DataSourceID = "AccessDataSource2";
DL2.DataTextField = "BoxNumber";
DL2.DataValueField = "Boxnumber";
dv.DataBind();
}
else
{
DL2.DataSourceID = "AccessDataSource3";
DL2.DataTextField = "AttendantID";
DL2.DataValueField = "AttendantID";
dv.DataBind();
}
}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<span style="color: navy; font-family: Verdana"><strong>Mailboxes for
Web Account </strong></span>
<asp:Label ID="Label1" runat="server" Text='<%#
Request.QueryString["User"] %>' Font-Names="Verdana" Font-Size="12pt"
Font-Bold="True" ForeColor="Navy"></asp:Label><br />
<br />
<asp:Menu ID="Menu2" runat="server" BackColor="#FFC080" BorderColor="Navy"
BorderStyle="Inset" BorderWidth="1px" Font-Bold="False"
Font-Strikeout="False"
Font-Underline="False" ForeColor="Navy" Orientation="Horizontal">
<StaticMenuStyle HorizontalPadding="5px" />
<StaticMenuItemStyle BackColor="#FFC080" Font-Names="verdana"
Font-Size="8pt"
HorizontalPadding="15px" />
<StaticHoverStyle Font-Bold="True" />
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Message Center"
Value="Message Center" ToolTip="Review mailboxes for logged in web account">
</asp:MenuItem>
<asp:MenuItem
NavigateUrl="~/systemadminOnly/ManageCALLMaster.aspx" Text="Manage CALLMaster"
Value="Manage CALLMaster" ToolTip="Manage CALLMaster
databases"></asp:MenuItem>
<asp:MenuItem
NavigateUrl="~/systemadminOnly/ManageWebAccounts.aspx" Text="Manage Web
Accounts"
Value="Manage Web Accounts" ToolTip="Manage Web
Accounts"></asp:MenuItem>
<asp:MenuItem
NavigateUrl="http://localhost/aspnetadmin/defaul...MWebManager\&applicationUrl=/TestAspnetConfig"
Text="Manage Roles/Web Account via ASP.Net" Value="Manage
via ASP.Net" ToolTip="Must be locally connected to web server"></asp:MenuItem>
</Items>
</asp:Menu>
<!--</strong></span>-->
<br />
<span style="font-size: 10pt; font-family: Verdana; color:
navy;">Mailboxes</span>
<!--<asp:Label ID="Label10" runat="server" Text='<%#
Request.QueryString["User"] %>' Font-Names="Verdana" Font-Size="10pt"
Font-Bold="True" ForeColor="Navy"></asp:Label><br />-->
<br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="WebAccountName,WebAccountID" DataSourceID="AccessDataSource1"
Font-Names="Verdana" Font-Size="8pt" BorderColor="#FFC080"
BorderStyle="Solid" BorderWidth="1px" CellPadding="5" CellSpacing="1"
ForeColor="Navy" ToolTip="Are you sure you want to delete this Mailbox for
this Web Account?">
<Columns>
<asp:TemplateField AccessibleHeaderText="Will Delete"
ShowHeader="False">
<ControlStyle ForeColor="DarkSlateGray" />
<ItemStyle BackColor="Lavender" BorderColor="SlateGray"
BorderStyle="Inset" BorderWidth="2px" />
<HeaderStyle BackColor="Lavender" />
<ItemTemplate>
<asp:LinkButton ID="LinkButton2" runat="server"
CommandName="Delete" OnClientClick="return confirm('Are you sure you want to
delete this Mailbox from this Web Account?');">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TableType"
SortExpression="TableType">
<EditItemTemplate>
<aspropDownList ID="DropDownList3" runat="server"
AutoPostBack="True"
DataSourceID="AccessDataSource4"
DataTextField="TableType"
DataValueField="TableType" SelectedValue='<%#
Bind("TableType") %>' >
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("TableType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Type ID" SortExpression="TypeID">
<EditItemTemplate>
<aspropDownList ID="DropDownList1" runat="server"
SelectedValue='<%# Bind("TypeID") %>'
Width="109px">
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("TypeID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="WebAccountID"
SortExpression="WebAccountID">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("WebAccountID") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("WebAccountID") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="0px" />
<HeaderStyle Width="0px" />
</asp:TemplateField>
<asp:BoundField DataField="WebAccountName"
HeaderText="WebAccountName"
SortExpression="WebAccountName" InsertVisible="False"
Visible="False" />
</Columns>
<EmptyDataTemplate>
There are no mailboxes associated with this user.
</EmptyDataTemplate>
<RowStyle BackColor="BlanchedAlmond" />
<HeaderStyle BackColor="#FFC080" BorderColor="#FFC080" />
<AlternatingRowStyle BackColor="SeaShell" />
<PagerSettings Mode="NumericFirstLast" Position="TopAndBottom" />
</asp:GridView>
<br />
<br />
<br />
<asp:LinkButton ID="LinkButton1" runat="server"
OnClick="LinkButton1_Click" Font-Names="verdana" Font-Size="8pt"
BackColor="Lavender" BorderColor="SlateGray" BorderStyle="Inset"
BorderWidth="1px" ForeColor="DarkSlateGray">Add Mailboxes</asp:LinkButton><br
/>
<br />
<aspetailsView ID="DetailsView1" runat="server"
AutoGenerateInsertButton="True"
AutoGenerateRows="False" DataSourceID="AccessDataSource1"
DefaultMode="Insert"
Height="50px" Visible="False" Width="276px" Font-Names="Verdana"
Font-Size="8pt" OnPreRender="DetailsView1_Prerender"
BorderStyle="Solid" BorderWidth="1px" ForeColor="Navy"
BorderColor="#FFC080" ToolTip="Correct Mailbox Selected?">
<Fields>
<asp:BoundField DataField="WebAccountID"
HeaderText="WebAccountID"
InsertVisible="False" SortExpression="WebAccountID" />
<asp:BoundField DataField="WebAccountName"
HeaderText="WebAccountName" InsertVisible="False"
SortExpression="WebAccountName" />
<asp:TemplateField HeaderText="TableType"
SortExpression="TableType">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%#
Bind("TableType") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<aspropDownList ID="DropDownList4" runat="server"
DataSourceID="AccessDataSource4"
DataTextField="TableType"
DataValueField="TableType" SelectedValue='<%#
Bind("TableType") %>'
OnSelectedIndexChanged="DropDownList4_TableTypeSelectedIndexChanged">
</aspropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("TableType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TypeID" SortExpression="TypeID">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("BoxNumber") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<aspropDownList ID="DropDownList2" runat="server"
DataSourceID="AccessDataSource2"
DataTextField="BoxNumber"
DataValueField="BoxNumber" SelectedValue='<%#
Bind("BoxNumber") %>'
Width="150px">
</aspropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("TypeID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField InsertVisible="False" ShowInsertButton="True" >
<ControlStyle Font-Names="Verdana" />
</asp:CommandField>
</Fields>
<CommandRowStyle BackColor="Lavender" BorderColor="SlateGray"
BorderStyle="Inset"
BorderWidth="2px" ForeColor="DarkSlateGray" />
<HeaderStyle BackColor="#FFC080" BorderColor="#FFC080" />
<FieldHeaderStyle BackColor="#FFC080" />
<InsertRowStyle Width="100px" />
</aspetailsView>
<br />
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="<%$ ConnectionStrings:CALLMasterMDB %>"
SelectCommand="SELECT [WebAccountID], [WebAccountName], [TableType],
[TypeID] FROM [WebAccount] WHERE ([WebAccountName] = ?) ORDER BY
[WebAccountName], [TableType], [TypeID]"
DeleteCommand="DELETE FROM [WebAccount] WHERE [WebAccountID] = ?"
InsertCommand="INSERT INTO [WebAccount] ([WebAccountName], [TypeID],
[TableType]) VALUES (?, ?, ?)"
UpdateCommand="UPDATE WebAccount SET TypeID = ?, TableType = ? WHERE
(WebAccountID = ?)">
<SelectParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
</SelectParameters>
<DeleteParameters>
<asparameter Name="WebAccountID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="TypeID" Type="String" />
<asparameter Name="TableType" Type="String" />
<asparameter Name="WebAccountID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
<asparameter Name="TypeID" Type="String" />
<asparameter Name="TableType" />
</InsertParameters>
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
DeleteCommand="DELETE FROM [WebAccount] WHERE [WebAccountID] =
@WebAccountID" InsertCommand="INSERT INTO [WebAccount] ([WebAccountName],
[TypeID], [TableType]) VALUES (@WebAccountName, @TypeID, @TableType)"
SelectCommand="SELECT [WebAccountID], [WebAccountName], [TableType],
[TypeID] FROM [WebAccount] WHERE ([WebAccountName] = @WebAccountName) ORDER
BY [WebAccountName], [TableType], [TypeID]"
UpdateCommand="UPDATE WebAccount SET TypeID = @TypeID, TableType =
@TableType WHERE (WebAccountID = @WebAccountID)">
<DeleteParameters>
<asparameter Name="WebAccountID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="TypeID" Type="String" />
<asparameter Name="WebAccountID" Type="Int32" />
<asparameter Name="TableType" />
</UpdateParameters>
<SelectParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
</SelectParameters>
<InsertParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
<asparameter Name="TypeID" Type="String" />
<asparameter Name="TableType" />
</InsertParameters>
</asp:SqlDataSource>
<asp:AccessDataSource ID="AccessDataSource2" runat="server"
DataFile="C:\Program Files\CallMaster\Data\Callmaster.mdb"
SelectCommand="SELECT BoxNumber FROM Mailboxes ORDER BY BoxNumber">
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
SelectCommand="SELECT [BoxNumber] FROM [Mailboxes] ORDER BY
[BoxNumber]">
</asp:SqlDataSource>
<asp:AccessDataSource ID="AccessDataSource3" runat="server"
DataFile="C:\Program Files\CallMaster\Data\Callmaster.mdb"
SelectCommand="SELECT AttendantID FROM Attendant GROUP BY
AttendantID ORDER BY AttendantID">
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
SelectCommand="SELECT AttendantID FROM Attendant GROUP BY
AttendantID ORDER BY AttendantID">
</asp:SqlDataSource>
<asp:AccessDataSource ID="AccessDataSource4" runat="server"
DataFile="C:\Program Files\CallMaster\Data\Callmaster.mdb"
SelectCommand="SELECT TableType FROM WebAccountTableType ORDER BY
TableType">
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
SelectCommand="SELECT TableType FROM WebAccountTableType ORDER BY
TableType">
</asp:SqlDataSource>
<asp:HyperLink ID="HyperLink2" runat="server" Font-Names="Verdana"
Font-Size="8pt"
NavigateUrl="~/systemadminOnly/Registration.aspx" ToolTip="Quick Add
Users for Website Access"
Width="131px">Add Web Account</asp:HyperLink>
<br />
<br />
<asp:HyperLink ID="HyperLink7" runat="server"
Font-Names="Verdana" Font-Size="8pt"
NavigateUrl="~/Default.aspx" ToolTip="Review Account Mailboxes, Messages,
Notifications"
Width="145px">Message Center</asp:HyperLink><asp:HyperLink
ID="HyperLink6" runat="server"
Font-Names="Verdana" Font-Size="8pt"
NavigateUrl="~/systemadminOnly/ManageCALLMaster.aspx"
ToolTip="Maintain CALLMaster Database" Visible='<%#
User.IsInRole("systemadmin") %>'
Width="156px">Manage CALLMaster</asp:HyperLink>
<asp:HyperLink ID="HyperLink9" runat="server"
Font-Names="Verdana" Font-Size="8pt"
NavigateUrl="~/SystemAdminOnly/ManageWebAccounts.aspx"
ToolTip="Manage Web Accounts" Visible='<%#
User.IsInRole("systemadmin") %>'
Width="156px">Manage Web Accounts</asp:HyperLink>
<asp:HyperLink ID="HyperLink8" runat="server" Font-Names="Verdana"
Font-Size="8pt"
NavigateUrl="http://localhost/aspnetadmin/defaul...MWebManager\&applicationUrl=/TestAspnetConfig"
ToolTip="From Local Machine ONLY" Width="242px">Manage Roles/Web
Account via ASP.Net</asp:HyperLink><br />
<br />
</asp:Content>
I have a gridview that has 2 dropdownlists.
DropDownList 4 is bound to AccessDataSource4.
DropDownList2 needs to be bound to a DataSourceID depending on the value of
DropDownList4.
For example, in insert mode, if the user selects value "Mailboxes" in
DropDownList4 then I want DropDownList2 to be bound to AccessDataSource2, if
not then AccessDataSource3.
I don't get any error, however the values in the dropdownlist in
DetailsView1 are not correct.
My code is as follows:
<%@ Page Language="C#" MasterPageFile="~/MasterPage1.master"
Title="Admin-Manage Web Account-Mailboxes" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Label1.DataBind();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
DetailsView1.Visible = true;
}
protected void DetailsView1_ItemInserted(object sender,
DetailsViewInsertedEventArgs e)
{
GridView1.DataBind();
}
protected void DetailsView1_Prerender(object sender, EventArgs e)
{
DetailsView dv = (DetailsView)sender;
DropDownList DL2 = dv.FindControl("DropDownList2") as DropDownList;
DropDownList DL4 = dv.FindControl("DropDownList4") as DropDownList;
if (DL4.Text == "Mailboxes")
{
DL2.DataSourceID = "AccessDataSource2";
DL2.DataTextField = "BoxNumber";
DL2.DataValueField = "Boxnumber";
dv.DataBind();
}
else
{
DL2.DataSourceID = "AccessDataSource3";
DL2.DataTextField = "AttendantID";
DL2.DataValueField = "AttendantID";
dv.DataBind();
}
}
protected void DropDownList4_TableTypeSelectedIndexChanged(object
sender, EventArgs e)
{
DetailsView dv = (DetailsView)sender;
DropDownList DL2 = dv.FindControl("DropDownList2") as DropDownList;
DropDownList DL4 = dv.FindControl("DropDownList4") as DropDownList;
if (DL4.Text.ToString() == "Mailboxes")
{
DL2.DataSourceID = "AccessDataSource2";
DL2.DataTextField = "BoxNumber";
DL2.DataValueField = "Boxnumber";
dv.DataBind();
}
else
{
DL2.DataSourceID = "AccessDataSource3";
DL2.DataTextField = "AttendantID";
DL2.DataValueField = "AttendantID";
dv.DataBind();
}
}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<span style="color: navy; font-family: Verdana"><strong>Mailboxes for
Web Account </strong></span>
<asp:Label ID="Label1" runat="server" Text='<%#
Request.QueryString["User"] %>' Font-Names="Verdana" Font-Size="12pt"
Font-Bold="True" ForeColor="Navy"></asp:Label><br />
<br />
<asp:Menu ID="Menu2" runat="server" BackColor="#FFC080" BorderColor="Navy"
BorderStyle="Inset" BorderWidth="1px" Font-Bold="False"
Font-Strikeout="False"
Font-Underline="False" ForeColor="Navy" Orientation="Horizontal">
<StaticMenuStyle HorizontalPadding="5px" />
<StaticMenuItemStyle BackColor="#FFC080" Font-Names="verdana"
Font-Size="8pt"
HorizontalPadding="15px" />
<StaticHoverStyle Font-Bold="True" />
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Message Center"
Value="Message Center" ToolTip="Review mailboxes for logged in web account">
</asp:MenuItem>
<asp:MenuItem
NavigateUrl="~/systemadminOnly/ManageCALLMaster.aspx" Text="Manage CALLMaster"
Value="Manage CALLMaster" ToolTip="Manage CALLMaster
databases"></asp:MenuItem>
<asp:MenuItem
NavigateUrl="~/systemadminOnly/ManageWebAccounts.aspx" Text="Manage Web
Accounts"
Value="Manage Web Accounts" ToolTip="Manage Web
Accounts"></asp:MenuItem>
<asp:MenuItem
NavigateUrl="http://localhost/aspnetadmin/defaul...MWebManager\&applicationUrl=/TestAspnetConfig"
Text="Manage Roles/Web Account via ASP.Net" Value="Manage
via ASP.Net" ToolTip="Must be locally connected to web server"></asp:MenuItem>
</Items>
</asp:Menu>
<!--</strong></span>-->
<br />
<span style="font-size: 10pt; font-family: Verdana; color:
navy;">Mailboxes</span>
<!--<asp:Label ID="Label10" runat="server" Text='<%#
Request.QueryString["User"] %>' Font-Names="Verdana" Font-Size="10pt"
Font-Bold="True" ForeColor="Navy"></asp:Label><br />-->
<br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="WebAccountName,WebAccountID" DataSourceID="AccessDataSource1"
Font-Names="Verdana" Font-Size="8pt" BorderColor="#FFC080"
BorderStyle="Solid" BorderWidth="1px" CellPadding="5" CellSpacing="1"
ForeColor="Navy" ToolTip="Are you sure you want to delete this Mailbox for
this Web Account?">
<Columns>
<asp:TemplateField AccessibleHeaderText="Will Delete"
ShowHeader="False">
<ControlStyle ForeColor="DarkSlateGray" />
<ItemStyle BackColor="Lavender" BorderColor="SlateGray"
BorderStyle="Inset" BorderWidth="2px" />
<HeaderStyle BackColor="Lavender" />
<ItemTemplate>
<asp:LinkButton ID="LinkButton2" runat="server"
CommandName="Delete" OnClientClick="return confirm('Are you sure you want to
delete this Mailbox from this Web Account?');">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TableType"
SortExpression="TableType">
<EditItemTemplate>
<aspropDownList ID="DropDownList3" runat="server"
AutoPostBack="True"
DataSourceID="AccessDataSource4"
DataTextField="TableType"
DataValueField="TableType" SelectedValue='<%#
Bind("TableType") %>' >
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("TableType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Type ID" SortExpression="TypeID">
<EditItemTemplate>
<aspropDownList ID="DropDownList1" runat="server"
SelectedValue='<%# Bind("TypeID") %>'
Width="109px">
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("TypeID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="WebAccountID"
SortExpression="WebAccountID">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("WebAccountID") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("WebAccountID") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="0px" />
<HeaderStyle Width="0px" />
</asp:TemplateField>
<asp:BoundField DataField="WebAccountName"
HeaderText="WebAccountName"
SortExpression="WebAccountName" InsertVisible="False"
Visible="False" />
</Columns>
<EmptyDataTemplate>
There are no mailboxes associated with this user.
</EmptyDataTemplate>
<RowStyle BackColor="BlanchedAlmond" />
<HeaderStyle BackColor="#FFC080" BorderColor="#FFC080" />
<AlternatingRowStyle BackColor="SeaShell" />
<PagerSettings Mode="NumericFirstLast" Position="TopAndBottom" />
</asp:GridView>
<br />
<br />
<br />
<asp:LinkButton ID="LinkButton1" runat="server"
OnClick="LinkButton1_Click" Font-Names="verdana" Font-Size="8pt"
BackColor="Lavender" BorderColor="SlateGray" BorderStyle="Inset"
BorderWidth="1px" ForeColor="DarkSlateGray">Add Mailboxes</asp:LinkButton><br
/>
<br />
<aspetailsView ID="DetailsView1" runat="server"
AutoGenerateInsertButton="True"
AutoGenerateRows="False" DataSourceID="AccessDataSource1"
DefaultMode="Insert"
Height="50px" Visible="False" Width="276px" Font-Names="Verdana"
Font-Size="8pt" OnPreRender="DetailsView1_Prerender"
BorderStyle="Solid" BorderWidth="1px" ForeColor="Navy"
BorderColor="#FFC080" ToolTip="Correct Mailbox Selected?">
<Fields>
<asp:BoundField DataField="WebAccountID"
HeaderText="WebAccountID"
InsertVisible="False" SortExpression="WebAccountID" />
<asp:BoundField DataField="WebAccountName"
HeaderText="WebAccountName" InsertVisible="False"
SortExpression="WebAccountName" />
<asp:TemplateField HeaderText="TableType"
SortExpression="TableType">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%#
Bind("TableType") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<aspropDownList ID="DropDownList4" runat="server"
DataSourceID="AccessDataSource4"
DataTextField="TableType"
DataValueField="TableType" SelectedValue='<%#
Bind("TableType") %>'
OnSelectedIndexChanged="DropDownList4_TableTypeSelectedIndexChanged">
</aspropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("TableType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TypeID" SortExpression="TypeID">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("BoxNumber") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<aspropDownList ID="DropDownList2" runat="server"
DataSourceID="AccessDataSource2"
DataTextField="BoxNumber"
DataValueField="BoxNumber" SelectedValue='<%#
Bind("BoxNumber") %>'
Width="150px">
</aspropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("TypeID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField InsertVisible="False" ShowInsertButton="True" >
<ControlStyle Font-Names="Verdana" />
</asp:CommandField>
</Fields>
<CommandRowStyle BackColor="Lavender" BorderColor="SlateGray"
BorderStyle="Inset"
BorderWidth="2px" ForeColor="DarkSlateGray" />
<HeaderStyle BackColor="#FFC080" BorderColor="#FFC080" />
<FieldHeaderStyle BackColor="#FFC080" />
<InsertRowStyle Width="100px" />
</aspetailsView>
<br />
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="<%$ ConnectionStrings:CALLMasterMDB %>"
SelectCommand="SELECT [WebAccountID], [WebAccountName], [TableType],
[TypeID] FROM [WebAccount] WHERE ([WebAccountName] = ?) ORDER BY
[WebAccountName], [TableType], [TypeID]"
DeleteCommand="DELETE FROM [WebAccount] WHERE [WebAccountID] = ?"
InsertCommand="INSERT INTO [WebAccount] ([WebAccountName], [TypeID],
[TableType]) VALUES (?, ?, ?)"
UpdateCommand="UPDATE WebAccount SET TypeID = ?, TableType = ? WHERE
(WebAccountID = ?)">
<SelectParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
</SelectParameters>
<DeleteParameters>
<asparameter Name="WebAccountID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="TypeID" Type="String" />
<asparameter Name="TableType" Type="String" />
<asparameter Name="WebAccountID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
<asparameter Name="TypeID" Type="String" />
<asparameter Name="TableType" />
</InsertParameters>
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
DeleteCommand="DELETE FROM [WebAccount] WHERE [WebAccountID] =
@WebAccountID" InsertCommand="INSERT INTO [WebAccount] ([WebAccountName],
[TypeID], [TableType]) VALUES (@WebAccountName, @TypeID, @TableType)"
SelectCommand="SELECT [WebAccountID], [WebAccountName], [TableType],
[TypeID] FROM [WebAccount] WHERE ([WebAccountName] = @WebAccountName) ORDER
BY [WebAccountName], [TableType], [TypeID]"
UpdateCommand="UPDATE WebAccount SET TypeID = @TypeID, TableType =
@TableType WHERE (WebAccountID = @WebAccountID)">
<DeleteParameters>
<asparameter Name="WebAccountID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="TypeID" Type="String" />
<asparameter Name="WebAccountID" Type="Int32" />
<asparameter Name="TableType" />
</UpdateParameters>
<SelectParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
</SelectParameters>
<InsertParameters>
<asp:QueryStringParameter Name="WebAccountName"
QueryStringField="User"
Type="String" />
<asparameter Name="TypeID" Type="String" />
<asparameter Name="TableType" />
</InsertParameters>
</asp:SqlDataSource>
<asp:AccessDataSource ID="AccessDataSource2" runat="server"
DataFile="C:\Program Files\CallMaster\Data\Callmaster.mdb"
SelectCommand="SELECT BoxNumber FROM Mailboxes ORDER BY BoxNumber">
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
SelectCommand="SELECT [BoxNumber] FROM [Mailboxes] ORDER BY
[BoxNumber]">
</asp:SqlDataSource>
<asp:AccessDataSource ID="AccessDataSource3" runat="server"
DataFile="C:\Program Files\CallMaster\Data\Callmaster.mdb"
SelectCommand="SELECT AttendantID FROM Attendant GROUP BY
AttendantID ORDER BY AttendantID">
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
SelectCommand="SELECT AttendantID FROM Attendant GROUP BY
AttendantID ORDER BY AttendantID">
</asp:SqlDataSource>
<asp:AccessDataSource ID="AccessDataSource4" runat="server"
DataFile="C:\Program Files\CallMaster\Data\Callmaster.mdb"
SelectCommand="SELECT TableType FROM WebAccountTableType ORDER BY
TableType">
</asp:AccessDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:CallMasterSQLConnectionString %>"
SelectCommand="SELECT TableType FROM WebAccountTableType ORDER BY
TableType">
</asp:SqlDataSource>
<asp:HyperLink ID="HyperLink2" runat="server" Font-Names="Verdana"
Font-Size="8pt"
NavigateUrl="~/systemadminOnly/Registration.aspx" ToolTip="Quick Add
Users for Website Access"
Width="131px">Add Web Account</asp:HyperLink>
<br />
<br />
<asp:HyperLink ID="HyperLink7" runat="server"
Font-Names="Verdana" Font-Size="8pt"
NavigateUrl="~/Default.aspx" ToolTip="Review Account Mailboxes, Messages,
Notifications"
Width="145px">Message Center</asp:HyperLink><asp:HyperLink
ID="HyperLink6" runat="server"
Font-Names="Verdana" Font-Size="8pt"
NavigateUrl="~/systemadminOnly/ManageCALLMaster.aspx"
ToolTip="Maintain CALLMaster Database" Visible='<%#
User.IsInRole("systemadmin") %>'
Width="156px">Manage CALLMaster</asp:HyperLink>
<asp:HyperLink ID="HyperLink9" runat="server"
Font-Names="Verdana" Font-Size="8pt"
NavigateUrl="~/SystemAdminOnly/ManageWebAccounts.aspx"
ToolTip="Manage Web Accounts" Visible='<%#
User.IsInRole("systemadmin") %>'
Width="156px">Manage Web Accounts</asp:HyperLink>
<asp:HyperLink ID="HyperLink8" runat="server" Font-Names="Verdana"
Font-Size="8pt"
NavigateUrl="http://localhost/aspnetadmin/defaul...MWebManager\&applicationUrl=/TestAspnetConfig"
ToolTip="From Local Machine ONLY" Width="242px">Manage Roles/Web
Account via ASP.Net</asp:HyperLink><br />
<br />
</asp:Content>