Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
167 views

tabs are not working in IE please verify my code below

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SkinID="RadTabStrip" MultiPageID="RadMultiPage1"
                    SelectedIndex="0" Width="447px" CausesValidation="false">
                    <Tabs>
                        <telerik:RadTab runat="server" TabIndex="0" Text="Active Profile" Selected="true"
                            Style="font-size: 13px;">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" TabIndex="1" Text="InActive Profile" Style="font-size: 13px;">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" BorderWidth="0px">
                    <telerik:RadPageView ID="rdpvSalon" runat="server">

//////// Sample Table and Controls

</telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView1" runat="server">

//////// SampleTable and Controls

</telerik:RadPageView>
                </telerik:RadMultiPage>

Dimitar Terziev
Telerik team
 answered on 22 Dec 2010
2 answers
230 views
Hello,
          I have an UpdatePanel in Ajax, Inside which I have a RadSlider. When I clicked on a button I want to display RadSlider. On Click of the button, I showed RadSlider in javascript but when a postback returns, the RadSlider disappears. does anyone know how to display/hide controls in Ajax??.. I went through this example

http://demos.telerik.com/aspnet-ajax/ajax/examples/common/showingwebcontrols/defaultcs.aspx

But I think it is very complicated. Should it be this complicated?..


Thanks,
Bharani
Georgi Tunev
Telerik team
 answered on 22 Dec 2010
1 answer
93 views
I try to fill a combobox in the  RadListViewItem,but it do twice every time.

protected void RadListView1_ItemCreated(object sender, RadListViewItemEventArgs e)
        {
           
            //if (e.Item is RadListViewEditableItem && e.Item.IsInEditMode)
            {
                RadComboBox combo = e.Item.FindControl("rcmbDept1") as RadComboBox;
                if (combo != null)
                {
                    fillChildExistDept(combo);
                }
            }
        }





<telerik:RadListView ID="RadListView1" runat="server" ItemPlaceholderID="ItemContainer"
            OnNeedDataSource="RadListView1_NeedDataSource" OnItemCreated="RadListView1_ItemCreated"
            OnItemDataBound="RadListView1_ItemDataBound"
            onprerender="RadListView1_PreRender">
            <LayoutTemplate>
                <fieldset style="width: 100%;">
                    <legend>?????</legend>
                    <table cellpadding="0" cellspacing="0" style="width: 100%;">
                        <tr>
                            <td>
                                <asp:Button ID="btnAddRecord" runat="server" CommandName="InitInsert" Visible="<%#Container.InsertItemPosition == RadListViewInsertItemPosition.None %>"
                                    Text="??????" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Panel ID="ItemContainer" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
                                    PageSize="3">
                                    <Fields>
                                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                        <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                        <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                    </Fields>
                                </telerik:RadDataPager>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </LayoutTemplate>
            <ItemTemplate>
                <fieldset style="float: left; width: 280px; height: 140px;">
                    <table cellpadding="2" cellspacing="0" style="height: 100%;">
                        <tr>
                            <td style="width: 20%;">
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <%# Eval("DeptName") %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <%# Eval("CS")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <%# Eval("DS")%>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:ImageButton ID="Button1" runat="server" CommandName="Edit" ImageUrl="~/images/Edit1.gif" />&nbsp;
                                <asp:ImageButton ID="Button2" runat="server" CommandName="Delete" CommandArgument='<%#Eval("ID") %>'
                                    ImageUrl="~/images/Delete1.gif" />
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </ItemTemplate>
            <EditItemTemplate>
                <fieldset style="float: left; width: 280px; height: 140px;">
                    <table cellpadding="0" cellspacing="2" style="height: 100%">
                        <tr>
                            <td style="width: 20%;">
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <asp:TextBox ID="txtCS" runat="server" Text='<%# Bind("CS") %>' Width="75px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <asp:TextBox ID="txtDS" runat="server" Text='<%# Bind("DS") %>' Width="75px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:ImageButton ID="Button1" runat="server" CommandName="Update" Text="Update" ImageUrl="~/ListView/Examples/DefiningStructure/DeclarativeDefinition/Img/Update.gif" />
                                <asp:ImageButton ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" ImageUrl="~/ListView/Examples/DefiningStructure/DeclarativeDefinition/Img/Cancel.gif" />
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </EditItemTemplate>
            <InsertItemTemplate>
                <fieldset style="float: left; width: 280px; height: 140px;">
                    <table cellpadding="0" cellspacing="2" style="height: 100%">
                        <tr>
                            <td style="width: 20%;">
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <asp:TextBox ID="txtCS" runat="server" Width="75px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ????:
                            </td>
                            <td style="width: 80%; padding-left: 5px;">
                                <asp:TextBox ID="txtDS" runat="server" Width="75px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:ImageButton ID="Button1" runat="server" CommandName="PerformInsert" Text="Insert"
                                    ImageUrl="~/images/Update.gif" />
                                <asp:ImageButton ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" ImageUrl="~/images/Cancel.gif" />
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </InsertItemTemplate>
        </telerik:RadListView>
Tsvetoslav
Telerik team
 answered on 22 Dec 2010
2 answers
126 views
Hi,

I have developed my requirement using the asp.net ajax (teleric) triew view for drag and drop functionality over  the datagrids, everything is working fine in my development machine, but it was not working at  assembly environment where we have only framework4.0.(no visual studio)

Triewview drag and drop is not working, below is my aspx design

Can any one provide the solution for the same.


<%

 

@ Page Language="C#" AutoEventWireup="true" CodeBehind="OverrideEmailAddresses.aspx.cs" Inherits="CTLS.iLien.Web.OverrideEmailAddresses" enableEventValidation="false" %>

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

<!

 

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

 

<

 

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

 

head id="Head1" runat="server">

 

 

 

<title></title>

 

 

 

<style type="text/css">

 

 

 

span.label

 

{

 

 

color:Black;

 

 

 

font-family:Arial;

 

 

 

font-weight:bold;

 

 

 

font-size:8pt;

 

 

 

padding: 4px 4px;

 

 

 

display: block;

 

 

 

margin-bottom: 7px;

 

}

 

 

 

#ConfigurationPanel1 ul

 

{

 

 

list-style: none;

 

 

 

margin: 0;

 

 

 

padding: 0;

 

 

 

float: left;

 

}

 

 

 

#ConfigurationPanel1 li

 

{

 

 

float: left;

 

 

 

padding: 0 10px;

 

 

 

border-left: solid 1px #b1d8eb;

 

 

 

line-height: 24px;

 

}

 

 

#ConfigurationPanel1 li input, #ConfigurationPanel1 li label, #ConfigurationPanel1 li span

 

{

 

 

vertical-align: middle;

 

}

 

 

.cssButton

 

{

 

 

background: url("../Common/Images/Add.gif") !important;

 

 

 

margin-left: 7px !important;

 

 

 

height: 22px !important;

 

 

 

width: 65px !important;

 

}

 

 

 

.cssScroll

 

{

 

 

background: url("../Images/delete.gif");

 

}

 

 

 

td.filing_grfbar

 

{

 

 

font-family: Arial;

 

 

 

font-size: 9pt;

 

 

 

font-weight: bold;

 

 

 

color: #FFFFFF;

 

 

 

height: 28px;

 

 

 

text-decoration: none;

 

 

 

background-color: #0076CD;

 

 

 

filter: progid:DXImageTransform.Microsoft.Gradient(endColorstr='#0076CD', startColorstr='#51B4FD', gradientType='0');

 

}

 

 

FONT.style7

 

{

 

 

font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular;

 

 

 

color: White;

 

 

 

font-size: 10pt;

 

}

 

 

Panel.Margin

 

{

 

 

 

font-family:Arial;

 

 

 

margin-top:20px;

 

 

}

.ContentsLeftEndCap

{

 

 

background-image:url('../images/ContentEdgeLeft.gif');

 

 

 

background-repeat:repeat-y;

 

 

 

width: 232px;

 

}

.ContentsRightEndCap

{

 

 

background-image:url('../images/ContentEdgeRight.gif');

 

 

 

background-repeat:repeat-y;

 

 

 

width: 232px;

 

 

}

 

 

td.grfbar

 

{

 

 

font-family: Arial;

 

 

 

font-size: 9pt;

 

 

 

font-weight: bold;

 

 

 

color: #FFFFFF;

 

 

 

text-decoration: none;

 

 

 

background-color: #0076CD;

 

 

 

filter: progid:DXImageTransform.Microsoft.Gradient(endColorstr='#0076CD', startColorstr='#51B4FD', gradientType='0');

 

}

 

 

.style1

 

{

 

 

height: 150px;

 

}

 

 

.style2

 

{

 

 

width: 232px;

 

}

 

 

.style3

 

{

 

 

height: 15px;

 

}

 

 

.style4

 

{

 

 

height: 43px;

 

}

 

 

.style5

 

{

 

 

FONT-SIZE: 9pt;

 

 

 

color:Black;

 

 

 

/*COLOR: #cc6600;*/

 

 

 

FONT-FAMILY: Arial;

 

 

 

height: 30px;

 

}

 

 

.style6

 

{

 

 

height: 15px;

 

 

 

width: 232px;

 

}

 

 

.roundedBlockTopLeft

 

{

 

 

background-repeat: no-repeat;

 

 

 

width: 21px;

 

 

 

height: 36px;

 

 

 

background-image:url('../../Common/images/Order_results_topL1.gif');

 

}

 

 

.roundedBlockTopRight

 

{

 

 

background-repeat: no-repeat;

 

 

 

width: 21px;

 

 

 

height: 36px;

 

 

 

background-image:url('../../Common/images/Order_results_topR1.gif');

 

}

 

 

.roundedBlockTopCenter

 

{

 

 

height: 36px;

 

 

 

font-family: Arial, Helvetica, sans-serif;

 

 

 

font-size:12px;

 

 

 

font-weight: bold;

 

 

 

color:#636469;

 

 

 

background:url(../../Common/images/Order_results_toptile1.gif) repeat-x;

 

}

 

 

</style>

 

</

 

 

head>

 

<

 

 

body class="BODY">

 

 

 

<form runat="server" id="mainForm" method="post">

 

 

 

<telerik:RadScriptManager runat="server" ID="RadScriptManager1">

 

 

 

</telerik:RadScriptManager>

 

 

 

<telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">

 

 

 

<script type="text/javascript">

 

/* <![CDATA[

 

 

*/

 

 

 

var gridId = "<%= RadGrid1.ClientID %>";

 

 

 

var grid2Id="<%= RadGrid3.ClientID %>";

 

 

 

function isMouseOverGrid(target)

 

{

parentNode = target;

 

 

while (parentNode != null)

 

{

 

 

if (parentNode.id == gridId)

 

{

 

 

return parentNode;

 

}

 

 

else if (parentNode.id == grid2Id)

 

{

 

 

return parentNode;

 

}

parentNode = parentNode.parentNode;

}

 

 

 

return null;

 

}

 

 

 

function onNodeDragging(sender, args)

 

{

 

 

var target = args.get_htmlElement();

 

 

 

 

if(!target) return;

 

 

 

 

if (target.tagName == "INPUT")

 

{

target.style.cursor =

 

"hand";

 

}

 

 

var grid = isMouseOverGrid(target)

 

 

 

if (grid)

 

{

grid.style.cursor =

 

"hand";

 

}

}

 

 

 

function dropOnHtmlElement(args)

 

{

 

 

 

if(droppedOnGrid(args))

 

 

 

return;

 

}

 

 

 

function droppedOnGrid(args)

 

{

 

 

var target = args.get_htmlElement();

 

 

 

 

while(target)

 

{

 

 

if(target.id == gridId || target.id ==grid2Id)

 

{

args.set_htmlElement(target);

 

 

return;

 

}

 

target = target.parentNode;

}

args.set_cancel(

 

true);

 

}

 

 

 

 

 

function clientSideEdit(sender, args)

 

{

 

 

var destinationNode = args.get_destNode();

 

 

 

 

if(destinationNode)

 

{

 

 

var firstTreeView = $find('RadTreeView1');

 

 

firstTreeView.trackChanges();

 

 

var sourceNodes = args.get_sourceNodes();

 

 

 

for (var i = 0; i < sourceNodes.length; i++)

 

{

 

 

var sourceNode = sourceNodes[i];

 

sourceNode.get_parent().get_nodes().remove(sourceNode);

 

 

 

if(args.get_dropPosition() == "over") destinationNode.get_nodes().add(sourceNode);

 

 

 

if(args.get_dropPosition() == "above") insertBefore(destinationNode, sourceNode);

 

 

 

if(args.get_dropPosition() == "below") insertAfter(destinationNode, sourceNode);

 

}

destinationNode.set_expanded(

 

true);

 

firstTreeView.commitChanges();

}

}

 

 

 

function insertBefore(destinationNode, sourceNode)

 

{

 

 

var destinationParent = destinationNode.get_parent();

 

 

 

var index = destinationParent.get_nodes().indexOf(destinationNode);

 

destinationParent.get_nodes().insert(index, sourceNode);

}

 

 

 

function insertAfter(destinationNode, sourceNode)

 

{

 

 

var destinationParent = destinationNode.get_parent();

 

 

 

var index = destinationParent.get_nodes().indexOf(destinationNode);

 

destinationParent.get_nodes().insert(index+1, sourceNode);

}

 

 

 

function onNodeDropping(sender, args)

 

{

 

 

var dest = args.get_destNode();

 

 

 

if (dest)

 

{

 

 

var clientSide = document.getElementById('ChbClientSide').checked;

 

 

 

 

if(clientSide)

 

{

clientSideEdit(sender, args);

args.set_cancel(

 

true);

 

 

 

return;

 

}

 

dropOnTree(args);

}

 

 

else

 

{

dropOnHtmlElement(args);

}

}

 

 

 

/* ]]> */

 

 

 

function checkUCCEmail(sender,args)

 

{

 

 

var obj=document.getElementById('RadMaskedTextBox1');

 

 

 

var re = new RegExp(/(^[a-z]([a-z_0-9\.]*)@[a-z0-9]([a-z_\-0-9\.]*)([.][a-z]{2,3})$)/i);

 

 

 

if(obj.value != "")

 

{

 

 

if (!re.test(obj.value)) {

 

alert(

 

"Please enter valid email address!");

 

 

 

return false;

 

};

};

 

 

var radTextBox = sender;

 

sender.raisePostBackEvent();

}

 

 

function checkBEEmail(sender,args)

 

{

 

 

var obj=document.getElementById('RadTextBox2');

 

 

 

var re = new RegExp(/(^[a-z]([a-z_0-9\.]*)@[a-z0-9]([a-z_\-0-9\.]*)([.][a-z]{2,3})$)/i);

 

 

 

if(obj.value != "")

 

{

 

 

if (!re.test(obj.value)) {

 

alert(

 

"Please enter valid email address!");

 

 

 

return false;

 

};

};

 

 

var radTextBox = sender;

 

sender.raisePostBackEvent();

}

 

 

</script>

 

 

 

</telerik:RadScriptBlock>

 

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">

 

 

 

</telerik:RadWindowManager>

 

 

 

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="btnSave">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

<%

 

--<telerik:AjaxSetting AjaxControlID="RadTreeView1">

 

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="RadTreeView1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="RadGrid3" LoadingPanelID="RadAjaxLoadingPanel1" />

</UpdatedControls>

</telerik:AjaxSetting> --

 

 

%>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />

 

 

 

<table width="750" >

 

 

 

<tr>

 

 

 

<td colspan="3" class="style5">

 

To override e-mail notifications,drag and drop organizational users to each receipient

list. You can also add external email addresses using the box provided above each

list.

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td class="style6" colspan="3">

 

 

 

<table border="0" cellpadding="0" cellspacing="0" >

 

 

 

<tr>

 

 

 

<td style="width: 14px" class="grfbar"><img alt="" id="img3" runat="server" style="width: 14px;height: 20;" /> </td>

 

 

 

<td align="left" class="grfbar"><b><font class="style7">Organizational Users</font></b></td>

 

 

 

<td style="width: 14px" class="grfbar"><img alt="" id="img4" runat="server" style="width: 14px;height: 20;" /> </td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td align="left" valign="top" class="style6" style="border:1px solid #AAAAAA;" width="30%" >

 

 

 

<telerik:RadTreeView ID="RadTreeView1" runat="server" EnableDragAndDrop="True" OnNodeDrop="RadTreeView1_HandleDrop"

 

 

 

OnClientNodeDropping="onNodeDropping" OnClientNodeDragging="onNodeDragging" MultipleSelect="True" Height="500px"

 

 

 

EnableDragAndDropBetweenNodes="True" ShowLineImages="false" > <%--Skin="Windows7"--%>

 

 

 

<Nodes>

 

 

 

</Nodes>

 

 

 

</telerik:RadTreeView>

 

 

 

</td>

 

 

 

<td valign="top" width="70%">

 

 

 

<table border="0" width="100%">

 

 

 

<tr>

 

 

 

<td >

 

 

 

&nbsp;&nbsp;

 

 

 

</td>

 

 

 

<td colspan="2" valign="top">

 

 

 

<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-bottom: 0px">

 

 

 

<tr align="center">

 

 

 

<td class="filing_grfbar" style="width: 14px; height: 20px;"><img alt="" id="imgbLeft" runat="server" style="width: 14px;height: 20;" /></td>

 

 

 

<td class="filing_grfbar" valign="middle" style="height: 20px" align="left"><b><font class="style7">UCC Debtor Alert Receipients</font></b></td>

 

 

 

<td class="filing_grfbar" style="width: 14px; height: 20px;"><img alt="" id="imgbRight" runat="server" style="width: 14px" /></td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr >

 

 

 

<td>

 

 

 

&nbsp;&nbsp;

 

 

 

</td>

 

 

 

<td>

 

 

 

<table>

 

 

 

<tr>

 

 

 

<td>

 

 

 

<table>

 

 

 

<tr>

 

 

 

<td colspan="2" valign="top" height="100%">

 

 

 

<table border="0" cellpadding="0" cellspacing="0">

 

 

 

<tr>

 

 

 

<td class="roundedBlockTopLeft"></td>

 

 

 

<td class="roundedBlockTopCenter" style="text-align:left; width:160px;">User</td>

 

 

 

<td class="roundedBlockTopCenter" style="width:180px;text-align:left">Email</td>

 

 

 

<td class="roundedBlockTopCenter" style="text-align:right; width:105px;">Remove</td>

 

 

 

<td class="roundedBlockTopRight"></td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td colspan="2" width="100%" align="left" style="height:125px;">

 

 

 

<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False" GridLines="None"

 

 

 

Skin="Windows7" OnDeleteCommand="onDeleteUccDebtor" ShowHeader="false"

 

 

 

Height="100%" Width="99%" >

 

 

 

<ClientSettings>

 

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="true" />

 

 

 

</ClientSettings>

 

 

 

<MasterTableView TableLayout="Fixed" GroupLoadMode="Client">

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="UserName" HeaderText="User" UniqueName="User" ItemStyle-Wrap="true" ItemStyle-Width="35%" ItemStyle-HorizontalAlign="Left">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email" ItemStyle-Wrap="true" ItemStyle-Width="55%"

 

 

 

ItemStyle-HorizontalAlign="Left">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="UserNumber" HeaderText="" UniqueName="UserNo" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn UniqueName="Remove" ImageUrl="../Common/Images/delete.gif" ButtonType="ImageButton"

 

 

 

ItemStyle-Width="10%" CommandName="Delete" HeaderText="Remove">

 

 

 

</telerik:GridButtonColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td align="right" style="width:32%;" >

 

 

 

<asp:Label class="label" Text="Additional Email Address" runat="server" ID="Label1"></asp:Label>

 

 

 

</td>

 

 

 

<td align="left">

 

 

 

<telerik:RadTextBox ID="RadMaskedTextBox1" runat="server" Skin="Windows7" MaxLength="250"

 

 

 

Wrap="true" Width="270px" ButtonsPosition="Right" ShowButton="true" OnTextChanged="btnAddUCC_Click"

 

 

 

ButtonCssClass="cssButton">

 

 

 

<ClientEvents OnButtonClick="checkUCCEmail" />

 

 

 

</telerik:RadTextBox>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td >

 

 

 

&nbsp;&nbsp;

 

 

 

</td>

 

 

 

<td colspan="2" valign="top">

 

 

 

<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-bottom: 0px">

 

 

 

<tr align="center">

 

 

 

<td class="filing_grfbar" style="width: 14px; height: 20px;"><img alt="" id="img1" runat="server" style="width: 14px;height: 20;" /></td>

 

 

 

<td class="filing_grfbar" valign="middle" style="height: 20px" align="left"><b><font class="style7">Business Entity Alert Receipients</font></b></td>

 

 

 

<td class="filing_grfbar" style="width: 14px; height: 20px;"><img alt="" id="img2" runat="server" style="width: 14px" /></td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr >

 

 

 

<td>

 

 

 

&nbsp;&nbsp;

 

 

 

</td>

 

 

 

<td colspan="2">

 

 

 

<table border="0" width="100%">

 

 

 

<tr>

 

 

 

<td>

 

 

 

<table border="0">

 

 

 

<tr>

 

 

 

<td colspan="2" valign="top" height="100%">

 

 

 

<table border="0" cellpadding="0" cellspacing="0">

 

 

 

<tr>

 

 

 

<td class="roundedBlockTopLeft"></td>

 

 

 

<td class="roundedBlockTopCenter" style="text-align:left; width:160px;">User</td>

 

 

 

<td class="roundedBlockTopCenter" style="width:180px;text-align:left">Email</td>

 

 

 

<td class="roundedBlockTopCenter" style="text-align:right; width:105px;">Remove</td>

 

 

 

<td class="roundedBlockTopRight"></td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td colspan="2" width="100%" align="left" style="height:125px;">

 

 

 

<telerik:RadGrid runat="server" ID="RadGrid3" AutoGenerateColumns="False" GridLines="None"

 

 

 

Skin="Windows7" Height="100%" Width="99%" OnDeleteCommand="onDeleteBusinessEntity" ShowHeader="false">

 

 

 

<ClientSettings>

 

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="true" />

 

 

 

</ClientSettings>

 

 

 

<MasterTableView TableLayout="Fixed" GroupLoadMode="Client">

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="UserName" HeaderText="User" ItemStyle-Width="35%" UniqueName="User">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Email" HeaderText="Email" ItemStyle-Width="55%" UniqueName="Email">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="UserNumber" HeaderText="" UniqueName="UserNo" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn UniqueName="Remove" ImageUrl="../Common/Images/delete.gif" ButtonType="ImageButton"

 

 

 

CommandName="Delete" ItemStyle-Width="10%" HeaderStyle-Width="10%" HeaderText="Remove">

 

 

 

</telerik:GridButtonColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td align="right" style="width:32%">

 

 

 

<asp:Label class="label" Text="Additional Email Address" runat="server" ID="Label2" ></asp:Label></td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="RadTextBox2" runat="server" Skin="Windows7" MaxLength="250" Wrap="true" Width="270px"

 

 

 

ButtonsPosition="Right" ShowButton="true" ButtonCssClass="cssButton" OnTextChanged="btnAddBE_Click"><ClientEvents OnButtonClick="checkBEEmail" /></telerik:RadTextBox>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td style="width:100%; margin-top:10;" colspan="3" align="right" >

 

 

 

<asp:ImageButton ID="btnSave" runat="server" OnClick="btnSaveClick"/>

 

 

 

<asp:ImageButton ID="btnCancel" runat="server" Text="Cancel" OnClientClick="window.close()" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>

 

Yana
Telerik team
 answered on 22 Dec 2010
3 answers
61 views
Hi Team,

I am using radScheduler in one of my application.
I would like to display text other than hour line in hour panel..
For example I would like to display Period 1, Period 2, period 3.... on the hour pane.

For that I created a table, added two columns : ID, Description
and for resource, added a datasource to map the table..

The radScheduler is displaying the period on the left hand side but at the same time it is also displaying hour pane for each period value.

Please check the screenshot for more reference.
I just need to display periods on left hand side and not the hour line with period.

Any help will be appreciated.

thanks
Veronica
Telerik team
 answered on 22 Dec 2010
2 answers
79 views
Hi,

ok here is my scenario.

I am using MasterPage. In one of the page, I have a form which collects lots of data and is inside RadAjaxPanel. There is a RadWindowManager as well on the page. It is basically a jobsite form so I am trying to upload CV from upload button. The upload button opens another window to upload your cv and Rebinds the AjaxPanel and updates the cv name to a label and makes View/Delete buttons visible so you can view or delete the cv you have uploaded. This works fine, however when I click View it doesn't open the CV. This should open a ms word or pdf file (uploaded by user) but this is not happening. I have included code to exclude this button to Ajax but still not working.

The other problem is there is another upload button which when clicked opens a window and user can upload his picture. The picture is uploaded and window is closed and then hits Rebind Ajaxpanel event. In the event, I have an ASP IMAGE and I am trying to give it url of the uploaded image but this doesn't work either. I can see that CV and Image are uploaded fine but just doesn't work.

Here is some sample code;

Profile.aspx


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
     
            function refreshCV(arg) {
                $find("<%= RadAjaxPanel1.ClientID %>").ajaxRequest("RebindCV");
            }
 
            function refreshImg(arg) {
                $find("<%= RadAjaxPanel1.ClientID %>").ajaxRequest("RebindImg");
            }
             
            function RequestStart(sender, args) {
                if (args.EventTarget == "lnkCvDownload") {
                    args.EnableAjax = false;
                }
            }
 
            Telerik.Web.UI.RadWindowUtils.Localization =
       {
           "Close": "Close",
           "Minimize": "Minimize",
           "Maximize": "Maximize",
           "Reload": "Reload",
           "PinOn": "Pin on",
           "PinOff": "Pin off",
           "Restore": "Restore",
           "OK": "Yes",
           "Cancel": "No",
           "Yes": "Yes",
           "No": "No"
       };
 
        
        </script>
</telerik:RadCodeBlock>   
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%" LoadingPanelID="RadAjaxLoadingPanel1" OnAjaxRequest="RadAjaxPanel1_AjaxRequest">  
    <telerik:RadWindowManager ID="RadWindowManager1" Skin="Vista" runat="server" Behavior="Close" VisibleTitlebar="True" VisibleStatusbar="False">
    </telerik:RadWindowManager>
    
    
        <div id="left_container" class="equal_height01">
          <div id="quick-search"> <a href="#" class="tab01">Nanny agency directory</a> <a href="#" class="tab-active">Nanny agency directory</a>
            <div class="main-navigation">
            <ul>
             <li><a>Search Jobs</a></li>
              <li><a>Post a job</a></li>
              <li><a>Post Your CV</a></li>
              <li><a>Search CVs </a></li>
              <li><a class="lastchild">Jobs by email</a></li>
              </ul>
            </div>
          </div>
          <div id="nannie-inner-left">
            <h2>Nanny Profile and CV</h2>
            <div class="info-text">Edit your profile and upload your CV and then click on the Save button.</div>
            <!-- Begin: textfild -->
             
            <ul class="profileinfo">
              <li>
                <span class="sidelistheading">Settings:</span><ul class="fff">
                   
                  <li>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="20" align="left" valign="middle">
                            <asp:CheckBox ID="chAllowRecruiters" runat="server" />
                            </td>
                        <td width="317" align="left" valign="middle" class="textupper">Allow recruiters to view my profile and CV</td>
                        <td width="19" align="left" valign="middle">
                        <asp:CheckBox ID="chRecruitment" runat="server" /></td>
                        <td align="left" valign="middle" class="textupper">Recruitment agencies only</td>
                      </tr>
                    </table>
                  </li>
                </ul>
              </li>
            </ul>
            <ul class="profileinfo">
              <li>
               <span class="sidelistheading">Contact Details:</span> <ul class="fff">
                   
                  <li>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="120">FirstName:</td>
                        <td height="40" align="left" valign="top"><div class="contactdetal-profiltext-feald">
                            <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtFirstName"></asp:RequiredFieldValidator>                         
                          </div>
                           </td>
                      </tr>
                      <tr>
                        <td>Last Name:</td>
                        <td height="40" align="left" valign="top"><div class="contactdetal-profiltext-feald">
                        <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>   
                         <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtLastName"></asp:RequiredFieldValidator>                          
                          </div></td>
                      </tr>
                      <tr>
                        <td>Telephone Number:</td>
                        <td><div class="contactdetal-profiltext-feald">
                        <asp:TextBox ID="txtTelephoneNumber" runat="server"></asp:TextBox>
                          </div></td>
                      </tr>
                    </table>
                  </li>
                </ul>
              </li>
            </ul>
            <ul class="profileinfo">
              <li>
                <span class="sidelistheading">Your Details:</span><ul class="fff">
                   
                  <li>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td colspan="5" align="left" valign="top">
                        <table width="390" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="290" height="30" align="left" valign="top">
                              Are you a UK citizen or eligible to work in the UK?</td>
                            <td width="100" align="left" valign="top">
                                <asp:RadioButtonList ID="rblIsUkCitizen" Width="100" RepeatDirection="Horizontal" runat="server">
                                <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                </asp:RadioButtonList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="rblIsUkCitizen"></asp:RequiredFieldValidator>
                            </td>
                          </tr>
                          <tr>
                            <td height="30" align="left" valign="top">Are you able to drive?</td>
                            <td width="100" align="left" valign="top">
                                <asp:RadioButtonList ID="rblCanDrive" Width="100" RepeatDirection="Horizontal" runat="server">
                                <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                </asp:RadioButtonList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="rblCanDrive"></asp:RequiredFieldValidator>
                            </td>
                          </tr>
                          <tr>
                            <td height="30" align="left" valign="top">
                            Do you have contactable references?</td>
                           <td width="100" align="left" valign="top">
                                <asp:RadioButtonList ID="rblIsReferences" Width="100" RepeatDirection="Horizontal" runat="server">
                                <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                </asp:RadioButtonList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="rblIsReferences"></asp:RequiredFieldValidator>
                            </td>
                          </tr>
                          <tr>
                            <td height="30" align="left" valign="top">Do you have a CRB check?</td>
                            <td width="100" align="left" valign="top">
                                <asp:RadioButtonList ID="rblIsCRBCheck" Width="100" RepeatDirection="Horizontal" runat="server">
                                <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                </asp:RadioButtonList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="rblIsCRBCheck"></asp:RequiredFieldValidator>   
                            </td>
                          </tr>
                          <tr>
                            <td height="46" align="left" valign="top">Do you have a 1st Aid Certificate?</td>
                            <td width="100" align="left" valign="top">
                                <asp:RadioButtonList ID="rblIsFirstAid" Width="100" RepeatDirection="Horizontal" runat="server">
                                <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                </asp:RadioButtonList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="rblIsFirstAid">
                            </asp:RequiredFieldValidator>    
                            </td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td height="40" colspan="5" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                            <td width="72">Experience:</td>
                            <td width="48"><div class="tini-textfild">
                                <asp:TextBox ID="txtExperience" runat="server"></asp:TextBox>
                              </div></td>
                            <td class="gray-color">Years
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtExperience">
                            </asp:RequiredFieldValidator></td>
                          </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td height="39" colspan="5" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                            <td width="105">Available to Work:</td>
                            <td>
                  <div class="select-list ">
                  <div class="homepage-select">
                      <asp:DropDownList ID="ddlAvailableToWork" CssClass="select-group-four" runat="server">
                      <asp:ListItem Value="Available" Text="Available"></asp:ListItem>
                      <asp:ListItem Value="Within One Week" Text="Within One Week"></asp:ListItem>
                      <asp:ListItem Value="Within Two Weeks" Text="Within Two Weeks"></asp:ListItem>
                      <asp:ListItem Value="Within One Month" Text="Within One Month"></asp:ListItem>
                      </asp:DropDownList>
                  </div>
                </div></td>
                          </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td height="65" colspan="5" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                            <td width="32">For:</td>
                            <td width="48"><div class="tini-textfild">
                             <asp:TextBox ID="txtAvailable" runat="server"></asp:TextBox>                                                    
                              </div></td>
                            <td class="gray-color">Months (leave blank if you are available indefinitely)
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtAvailable">
                            </asp:RequiredFieldValidator>
                            </td>
                          </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td height="29" colspan="5" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                            <td width="121">Area :</td>
                            <td width="20" align="left" valign="top">
                                <asp:RadioButton ID="rblEurope" Checked="true" GroupName="area" runat="server" />
                            </td>
                            <td width="63" align="left" valign="middle" class="gray-color-01">Europe</td>
                            <td width="19" align="left" valign="top" class="gray-color">
                            <asp:RadioButton ID="tblMiddleEast" GroupName="area" runat="server" />
                            </td>
                            <td width="87" align="left" valign="middle" class="gray-color-01">Middle East</td>
                            <td width="19" align="left" valign="top" >
                            <asp:RadioButton ID="rblRussia" GroupName="area" runat="server" /></td>
                            <td width="63" align="left" valign="middle" class="gray-color-01">Russia</td>
                            <td width="20" align="left" valign="top" class="gray-color">
                            <asp:RadioButton ID="rblRestOfWorld" GroupName="area" runat="server" /></td>
                            <td align="left" valign="middle" class="gray-color-01">The rest of the World</td>
                          </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td height="46" colspan="5" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                            <td width="120" valign="top" class="dd">Languages Spoken:</td>
                            <td height="41" align="left" valign="top"><div class="contactdetal-profiltext-feald">
                             <asp:TextBox ID="txtLanguages" runat="server"></asp:TextBox
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator10" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtLanguages">
                            </asp:RequiredFieldValidator>    
                              </div></td>
                          </tr>
                            <tr>
                            <td valign="top" class="dd">Current Location:</td>
                            <td height="41" align="left" valign="top"><div class="contactdetal-profiltext-feald">
                                <asp:TextBox ID="txtCurrentLocation" runat="server"></asp:TextBox>  
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator11" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtCurrentLocation">
                            </asp:RequiredFieldValidator>  
                              </div></td>
                          </tr>
                            <tr>
                            <td valign="top" class="dd">Short Description:</td>
                            <td height="91" align="left" valign="top"><div class="jobdetail-textfild-03-03">
                                <asp:TextBox ID="txtShortDescription" Width="270" Height="67" runat="server" CssClass="jobdetail-textfild-03-help" TextMode="MultiLine"></asp:TextBox>     
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator12" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtShortDescription">
                            </asp:RequiredFieldValidator>
                              </div></td>
                          </tr>
                            <tr>
                            <td valign="top" class="dd">Experience:</td>
                            <td height="91" align="left" valign="top"><div class="jobdetail-textfild-03-03">
                                <asp:TextBox ID="txtExperienceDescription" Width="270" Height="67" runat="server" CssClass="jobdetail-textfild-03-help" TextMode="MultiLine"></asp:TextBox>     
                                 <asp:RequiredFieldValidator ID="RequiredFieldValidator13" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtExperienceDescription">
                            </asp:RequiredFieldValidator>
                              </div></td>
                          </tr>
                            <tr>
                            <td valign="top" class="dd">Qualifications:</td>
                            <td height="91" align="left" valign="top"><div class="jobdetail-textfild-03-03">
                          <asp:TextBox ID="txtQualificationDescription" Width="270" Height="67" runat="server" CssClass="jobdetail-textfild-03-help" TextMode="MultiLine"></asp:TextBox>     
                           <asp:RequiredFieldValidator ID="RequiredFieldValidator14" Display="Dynamic" runat="server" ErrorMessage="* Required" ControlToValidate="txtQualificationDescription">
                            </asp:RequiredFieldValidator>
                              </div></td>
                          </tr>
                            <tr>
                            <td valign="top" class="dd"> </td>
                            <td align="left" valign="top">
                                <asp:CheckBox ID="chShowPublicily" runat="server" />
                                <span class="gray-color-02">Show Description, Experience and Qualifications publicly</span></td>
                          </tr>
                          </table></td>
                      </tr>
                    </table>
                  </li>
                </ul>
              </li>
            </ul>
            <ul class="profileinfo">
              <li>
                <span class="sidelistheading">Your CV: </span><ul class="fff">
                   
                  <li>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                      <td align="left" valign="middle">
                      <asp:Panel ID="cvpanel" runat="server">
                       <asp:Literal ID="ltCvText" runat="server"></asp:Literal>
                         <asp:LinkButton ID="lnkCvDownload" runat="server" CausesValidation="false" OnClick="lnkCvDownload_Click">(view)</asp:LinkButton>   
                         <asp:LinkButton ID="lnkCvDelete" runat="server" CausesValidation="false" OnClick="lnkCvDelete_Click">(delete)</asp:LinkButton>                         
                       </asp:Panel>
                      </td>
                        <td width="74" align="left" valign="middle">                       
                        <asp:Button ID="btnUploadCV" runat="server" Text="Upload" CausesValidation="false" onclick="btnUploadCV_Click" CssClass="upload-button" />    
                        </td>
                        <td align="left" valign="middle" class="gray-color">(.doc, .docx, .pdf) 
                        <asp:Literal ID="ltCVUploadMsg" runat="server"></asp:Literal>
                        </td>
                      </tr>
                    </table>
                  </li>
                </ul>
              </li>
            </ul>
              <ul class="profileinfo">
              <li>
                <span class="sidelistheading">Your Photo: </span><ul class="fff">
                   
                  <li>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="74" height="36" align="left" valign="top">
                            <asp:Image ID="imgUploaded" runat="server" />
                        <asp:Button ID="btnUploadImage" CausesValidation="false" runat="server" OnClick="btnUploadImage_Click" Text="Upload" CssClass="upload-button" />
                        </td>
                        <td align="left" valign="top" class="gray-color-03">(.jpg, .gif, .png) 
                        <asp:Literal ID="ltImgUploadMsg" runat="server"></asp:Literal></td>
                      </tr>
                      <%--<tr>
                        <td colspan="2" align="left" valign="top">
                            <asp:CheckBox ID="chShowImage" runat="server" />
                                <span class="gray-color-02">Show photo publicly</span></td>
                      </tr>--%>
                    </table>
                  </li>
                </ul>
              </li>
            </ul>
               <ul class="profileinfo">
              <li>
                <span class="sidelistheading">Select Your Criteria: </span><ul class="fff">
 
                   
                  <li>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="94" height="26" align="left" valign="top"><table width="300" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="56" align="left" valign="middle">Hours:</td>
                            <td width="21" align="left" valign="middle">
                                <asp:CheckBox ID="chFullTime" runat="server" />
                            </td>
                            <td width="76" align="left" valign="middle" class="gray-color-05">Full-time</td>
                            <td width="20" align="left" valign="middle">
                            <asp:CheckBox ID="chPartTime" runat="server" /></td>
                            <td align="left" valign="middle" class="gray-color">Part-time</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td height="35" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="69" align="left" valign="middle">Job Type:</td>
                            <td width="21" align="left" valign="middle">
                            <asp:CheckBox ID="chPermanent" runat="server" /></td>
                            <td width="81" align="left" valign="middle" class="gray-color-05">Permanent</td>
                            <td width="20" align="left" valign="middle">
                             <asp:CheckBox ID="chTemporty" runat="server" /></td>
                            <td align="left" valign="middle" class="gray-color-05">Temporary/Contract</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td height="21" align="left" valign="top" >Specialism :</td>
                      </tr>
                      <tr>
                        <td height="19" align="left" valign="top" class="gray-color-04">Nanny & Childcare</td>
                      </tr>
                      <tr>
                        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="27" align="left" valign="top"></td>
                            <td width="159" height="9" align="left" valign="top" class="gray-color"></td>
                            <td width="26" align="left" valign="top"></td>
                            <td width="127" align="left" valign="top" class="gray-color"></td>
                            <td width="26" align="left" valign="top"></td>
                            <td align="left" valign="top" class="gray-color"></td>
                          </tr>
                          <tr>
                            <td width="27" align="left" valign="top"><asp:CheckBox ID="chAuPair" runat="server" /></td>
                            <td width="159" height="30" align="left" valign="top" class="gray-color-05">Au Pair </td>
                            <td width="26" align="left" valign="top"><asp:CheckBox ID="chBabySitter" runat="server" /></td>
                            <td width="127" align="left" valign="top" class="gray-color-05">Babysitter </td>
                            <td width="26" align="left" valign="top"><asp:CheckBox ID="chChildminder" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Childminder </td>
                          </tr>
                          <tr>
                            <td align="left" valign="top"><asp:CheckBox ID="chDoula" runat="server" /></td>
                            <td height="30" align="left" valign="top" class="gray-color-05">Doula</td>
                            <td align="left" valign="top"><asp:CheckBox ID="chMaternity" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Maternity Nurse </td>
                            <td align="left" valign="top"><asp:CheckBox ID="chMothers" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Mothers/Fathers Help</td>
                          </tr>
                          <tr>
                            <td align="left" valign="top"><asp:CheckBox ID="chNannyLiveIn" runat="server" /></td>
                            <td height="30" align="left" valign="top" class="gray-color-05">Nanny (live-in) </td>
                            <td align="left" valign="top"><asp:CheckBox ID="chNannyLiveOut" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Nanny (live-out) </td>
                            <td align="left" valign="top"><asp:CheckBox ID="chNannyHousekeeper" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Nanny/Housekeeper </td>
                          </tr>
                          <tr>
                            <td align="left" valign="top"><asp:CheckBox ID="chNannyPersonal" runat="server" /></td>
                            <td height="30" align="left" valign="top" class="gray-color-05">Nanny/Personal Assistant </td>
                            <td align="left" valign="top"><asp:CheckBox ID="chNightNanny" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Night Nanny </td>
                            <td align="left" valign="top"><asp:CheckBox ID="chResortChildcare" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Resort Childcare </td>
                          </tr>
                          <tr>
                            <td align="left" valign="top"><asp:CheckBox ID="chSecialNeeds" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Special Needs Childcare</td>
                            <td align="left" valign="top"><asp:CheckBox ID="chOthers" runat="server" /></td>
                            <td align="left" valign="top" class="gray-color-05">Other </td>
                            <td align="left" valign="top"> </td>
                            <td align="left" valign="top" class="gray-color"> </td>
                          </tr>
                        </table></td>
                      </tr>
                    </table>
                  </li>
                </ul>
              </li>
            </ul>
                         <ul class="profileinfo">
              <li>
                <div class="sidelistheading">
                    <asp:Button ID="btnSubmit" runat="server" Text="SAVE" CssClass="save-btn"
                        onclick="btnSubmit_Click" />
                 <%--<input name="" type="button" class="cancel-btn" value="CANCEL">--%></div>
 
                  </li>
                </ul>
   
             </div>
           
 
          <!-- end: textfild -->
        </div>
    
 
</telerik:RadAjaxPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
    Width="75px" Transparency="30">
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
        style="border: 0px;" />
</telerik:RadAjaxLoadingPanel>
</asp:Content>

Profile.aspx.cs

public partial class NannyProfile : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.User.Identity.IsAuthenticated == false)
            Response.Redirect("~/login.aspx");
 
        if (!IsPostBack)
        {           
            applyLocalisation();
            bindData();
        }
    }
 
    void applyLocalisation()
    {
        this.Page.Title = "Complete your profile";        
    }
 
    void bindData()
    {
        cvpanel.Visible = false;
        imgUploaded.Visible = false;
        MembershipUserCollection muc = Membership.FindUsersByName(Page.User.Identity.Name);
        MembershipUser mu = muc[Page.User.Identity.Name];
        if (mu != null)
        {
            NJC.Business.NannyProfile.NannyProfile nf = NannyProfileManager.GetNannyProfileByUserId((Guid)mu.ProviderUserKey);
            if (nf != null)
            {
                txtFirstName.Text = nf.FirstName;
                txtLastName.Text = nf.LastName;
            }
        }       
    }
 
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
 
        }
    }
 
    protected void btnUploadCV_Click(object sender, EventArgs e)
    {
        RadWindow rw = new RadWindow();
        rw.ID = "rw1";
        rw.VisibleOnPageLoad = true;
        rw.Width = Unit.Pixel(460);
        rw.Height = Unit.Pixel(50);
        rw.OnClientClose = "refreshCV";
        rw.NavigateUrl = "~/uploadfile.aspx?uploadtype=cv";
        rw.ReloadOnShow = true;       
        WindowBehaviors wb = new WindowBehaviors();
        wb = WindowBehaviors.Close;
        rw.Behaviors = wb;
        rw.Skin = "Vista";       
        RadWindowManager1.Windows.Add(rw);
    }
 
    protected void btnUploadImage_Click(object sender, EventArgs e)
    {
        RadWindow rw = new RadWindow();
        rw.ID = "rw1";
        rw.VisibleOnPageLoad = true;
        rw.Width = Unit.Pixel(460);
        rw.Height = Unit.Pixel(50);
        rw.OnClientClose = "refreshImg";
        rw.NavigateUrl = "~/uploadfile.aspx?uploadtype=image";
        rw.ReloadOnShow = true;
        WindowBehaviors wb = new WindowBehaviors();
        wb = WindowBehaviors.Close;
        rw.Behaviors = wb;
        rw.Skin = "Vista";
        RadWindowManager1.Windows.Add(rw);
    }
 
    protected void RadAjaxPanel1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "RebindCV")
        {
            MembershipUserCollection muc = Membership.FindUsersByName(Page.User.Identity.Name);
            MembershipUser mu = muc[Page.User.Identity.Name];
            NJC.Business.NannyProfile.NannyCvCollection ncc = NannyProfileManager.GetNannyCvByUserId((Guid)mu.ProviderUserKey);
            if (ncc.Count == 0)
            {
                NannyCv nc = ncc[0];
                ltCvText.Text = nc.CvPublicName; //"<a href=\"" + Server.MapPath("~/uploads/cvs/") + nf.CvLink + "\">" + nf.CvPublicName + "</a>";
                ltCVUploadMsg.Text = "CV Uploaded.";
                cvpanel.Visible = true;
            }
        }
        else if (e.Argument == "RebindImg")
        {
            MembershipUserCollection muc = Membership.FindUsersByName(Page.User.Identity.Name);
            MembershipUser mu = muc[Page.User.Identity.Name];
            NJC.Business.NannyProfile.NannyPicturesCollection npc = NannyProfileManager.GetNannyPicturesByUserId((Guid)mu.ProviderUserKey);
            if (npc.Count == 1)
            {
                NannyPictures np = npc[0];
                imgUploaded.ImageUrl = System.Configuration.ConfigurationManager.AppSettings["websiteaddress"].ToString() + "uploads/images/" + np.ImgName; //"<a href=\"" + Server.MapPath("~/uploads/cvs/") + nf.CvLink + "\">" + nf.CvPublicName + "</a>";
                ltImgUploadMsg.Text = "Image Uploaded.";
            }
        }
    }
 
 
    protected void lnkCvDownload_Click(object sender, EventArgs e)
    {
        MembershipUserCollection muc = Membership.FindUsersByName(Page.User.Identity.Name);
        MembershipUser mu = muc[Page.User.Identity.Name];
        if (mu != null)
        {
            NJC.Business.NannyProfile.NannyCvCollection ncc = NannyProfileManager.GetNannyCvByUserId((Guid)mu.ProviderUserKey);
            if (ncc.Count == 0)
            {
                NannyCv nc = ncc[0];
                if (!string.IsNullOrEmpty(nc.CvName))
                {                    
                    System.IO.FileInfo file = new System.IO.FileInfo(Server.MapPath("~/uploads/cvs/" + nc.CvName));
                    Response.Clear();
                    Response.AddHeader("Content-Disposition", "attachment; filename=" + nc.CvPublicName);
                    Response.AddHeader("Content-Length", file.Length.ToString());
                    Response.ContentType = nc.ContentType;
                    Response.WriteFile(file.FullName);
                    Response.End();
                }
            }
        }       
    }
 
    protected void lnkCvDelete_Click(object sender, EventArgs e)
    {
        MembershipUserCollection muc = Membership.FindUsersByName(Page.User.Identity.Name);
        MembershipUser mu = muc[Page.User.Identity.Name];
        if (mu != null)
        {
            NJC.Business.NannyProfile.NannyCvCollection ncc = NannyProfileManager.GetNannyCvByUserId((Guid)mu.ProviderUserKey);
            if (ncc.Count == 0)
            {
                NannyCv nc = ncc[0];
                if (!string.IsNullOrEmpty(nc.CvName))
                {
                    System.IO.File.Delete(Server.MapPath("~/uploads/cvs/" + nc.CvName));
                    if (NannyProfileManager.DeleteNannyCv(nc.NannyCvsId))
                    {
                        ltCvText.Text = ""; //"<a href=\"" + Server.MapPath("~/uploads/cvs/") + nf.CvLink + "\">" + nf.CvPublicName + "</a>";
                        ltCVUploadMsg.Text = "CV Deleted.";
                        cvpanel.Visible = false;
                    }
                    else
                    {
                        ltCVUploadMsg.Text = "An internal error has occured.";
                    }
                }
            }
        
    }
 
}

The upload file works fine and uploads the CV and image files. I have tried every approach to un-ajaxify the cv download button but that doesn't work and even when I assign the url to image, it doesn't show the image.

Please help me out with this.
Tsvetina
Telerik team
 answered on 22 Dec 2010
1 answer
75 views
Prior to the recent Telerik update we had styles working for RadDockZones like below. These no longer work due to the update. On RadGrids we have set EnableEmbeddedBaseStylesheet="false" and we're thinking this is the same problem where a base stylesheet is being used instead of the styles we are specifying below. We've tried setting enablembeddedbasestylesheet to false on the RadDockZone and RadDockLayout. Why is it no longer picking up these styles? It seems to pick up .RadDockZone but nothing for .RadDock_Office2007 .rdTitle. Prior to the Telerik Upgrade the element had a class of rdTitle.

<em class="rdTitle">Quick Links</em>

After the upgrade, this class is gone so we can't seem to style this element. 

<em style="width: 249px;">lz_Quick Links</em>

 

.RadDock_Office2007

 

 

.rdTitle

 

{

 

 

 

text-align:left !important;

 

 

 

 

padding-left: 5px;

 

}

 

.RadDock_Office2007

 

 

.rdHTitlebar .rdTitle {

 

 

 

 

background-color:Transparent !important;

 

 

 

 

padding-left: 5px;

 

}

 

Bozhidar
Telerik team
 answered on 22 Dec 2010
5 answers
62 views
HI,
    I have found RadGrid extremely useful so far. But just one thing, my alternating style item is not getting selected completely while the normal items would get selected the way they should be. I am posting screenshots for more clarity.. 


Thanks and Regards,
Niraj Khose
Tsvetina
Telerik team
 answered on 22 Dec 2010
2 answers
73 views
Hi! I have a problem with displaying colorpicker. I set SelectedColor = #FF0000 and colorpicker displays it normally, but if I set property ShowIcon = true then current color in colorpicker is #FFFFFF, but value of SelectedColor still #FF0000. Can you help me? In IE7 and IE8 it works fine.
de Phoenix
Top achievements
Rank 1
 answered on 22 Dec 2010
4 answers
148 views
Hello.  After applying the 2010.3.1215.35 upgrade, the code below began to throw a javascript error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.  As soon as I reverted to 2010.3.1109.35, the error went away.  There is quite a bit of code - mostly in a WebUserControl:
ASPX -
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ServiceAdd.aspx.cs" Inherits="AMSOILGarage.ServiceAdd" %>

<%@ Register src="WebControls/wucServiceAdd.ascx" tagname="wucServiceAdd" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>MyAMSOILGarage - Add Service Wizard</title>
    <link href="Theme/css/main.css" type="text/css" media="screen" rel="stylesheet" />
    <link href="Theme/css/wizard.css" type="text/css" media="screen" rel="stylesheet" />
    <link href="Theme/css/serviceWizard.css" type="text/css" media="screen" rel="stylesheet" />
    <script type="text/javascript" language="javascript">
        function getProduct() {
                     
            if (navigator.appName == "Microsoft Internet Explorer") {
                var cSearchValue = showModalDialog("/lit/g1490/1490.html", "Select Product", "dialogWidth:600px;dialogHeight:465px;");
                SetSearchValue(cSearchValue);
            } else {
                winModalWindow = window.open("/lit/g1490/1490.html", "Select Product", "dependent=yes,width:600px,height=465px")
                winModalWindow.focus()
            }
       
            return false;
        }
        function SetSearchValue(cSearchValue) {
            if (cSearchValue != null) {
                document.getElementById('wucServiceAdd1_Wizard1_wucServiceProductOtherAmsoil1_txtOtherAmsoilProductCode').value = cSearchValue;
                lookupOnBlur();
            }       
        }
        function toggle(id) {
            var styleObj = document.getElementById('instructionSection').style;
            if (styleObj.display == 'block') {
                document.getElementById(id).innerHTML = "Show Instructions <img src=\"/MyGarage/images/miniHelp.png\" />";
                styleObj.display = 'none';
            } else {
                document.getElementById(id).innerHTML = "Hide Instructions <img src=\"/MyGarage/images/miniHelp.png\" />";
                styleObj.display = 'block';
            }
        }
    </script>
    <script type="text/javascript" src="fancybox/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="fancybox/jquery.fancybox-1.3.0.pack.js"></script>
    <link rel="stylesheet" type="text/css" href="fancybox/fancybox.css" media="screen" />
    <script type="text/javascript">
    $(document).ready(function() {
            $("a.tutorial").fancybox({
                'titlePosition'       : 'over',
                'transitionIn'       : 'none',
                'transitionOut'       : 'none'
            });
            $("a.whatsThis").fancybox({
                'titleShow'       :  false,
                'padding'       :  15
            });
             
        });
    function pageLoad(sender, args) {
        var prm = Sys.WebForms.PageRequestManager.getInstance();
    
        prm.add_endRequest(function() {
            $("a.tutorial").fancybox({
                    'titlePosition'       : 'over',
                    'transitionIn'       : 'none',
                    'transitionOut'       : 'none'
                });
            $("a.whatsThis").fancybox({
                'titleShow'       :  false,
                'padding'       :  15
            });
        });
    }
    </script>
</head>
<body onkeydown="if (event.keyCode==13) {event.keyCode=9; return event.keyCode }" >
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager1" runat="server">
    </telerik:RadScriptManager>
    
    <div id="rightHeader">
        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Always" runat="server">
            <ContentTemplate>
                <div id="rightHeaderNav">
                    <h3 class="left">
                        Welcome,
                        <%= Session["FirstLast"]%></h3>
                    <h3 class="right topFont">
                        <asp:LinkButton ID="lbtBack" runat="server" OnClick="lbtBack_Click" CssClass="">Back to <%= wucServiceAdd1.NickName%></asp:LinkButton>
                    </h3>
                </div>
                <div id="rightDisplayName">
                    <h1 class="left">
                        <%= wucServiceAdd1.WizardCaption%></h1>
                    <div class="right" id="progressBar">
                        <asp:UpdateProgress ID="progress1" DisplayAfter="1" runat="server">
                            <ProgressTemplate>
                                <div>
                                    <img src="/MyGarage/images/ajax-loader.gif" alt="Please wait..." />
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div class="actionBar">
    <h3 class="center"><%= wucServiceAdd1.NickName%></h3><!--<a class="tutorial right" style="margin: -29px 8px 0 0;"href="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf"><img src="/MyGarage/images/help.png" title="Video Tutorial" alt="Video Tutorial" /></a>-->
    </div>
    <div class="content">
        <div>
            <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Always" runat="server">
                <ContentTemplate>
                    <asp:HiddenField ID="hdnErrorNotification" runat="server" />
                    <uc1:wucServiceAdd ID="wucServiceAdd1" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
     </div>
</div>
    <script type="text/javascript" language="javascript">
        Sys.Application.add_load(load);
        function load() {
            var hdn = document.getElementById('hdnErrorNotification');
            if (hdn.value != '') {
                alert(hdn.value);
                hdn.value = '';
            }
        }
    </script>
    </form>
</body>
</html>

ASPX Code Behind -
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using AMSOILGarage.classes;

namespace AMSOILGarage
{
    public partial class ServiceAdd : cGarageAJAX
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager1.AsyncPostBackTimeout = 3600;
        }


        protected void lbtBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("GarageVehicle.aspx?id=" + wucServiceAdd1.UnitInstanceID.ToString());
        }

        protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
        {
            AmsWebLibrary.Module1.LogError("ServiceAdd.ScriptManager1_AsyncPostBackError", e.Exception, false, string.Empty, string.Empty);

        }
        protected override bool OnBubbleEvent(object source, EventArgs e)
        {
            if (e is ErrorNotificationEventArgs)
            {
                ErrorNotificationEventArgs ee = (ErrorNotificationEventArgs)e;
                hdnErrorNotification.Value = ee.ErrorNotification;
                return true;
            }
            return false;
        }
    }
}


WebUserControl -
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wucServiceAdd.ascx.cs" Inherits="AMSOILGarage.WebControls.wucServiceAdd" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="wucServiceProductRadioList2.ascx" TagName="wucServiceProductRadioList2" TagPrefix="uc1" %>
<%@ Register Src="wucServiceProductOtherAmsoil.ascx" TagName="wucServiceProductOtherAmsoil" TagPrefix="uc2" %>
<%@ Register Src="wucServiceProductNonAmsoil.ascx" TagName="wucServiceProductNonAmsoil" TagPrefix="uc3" %>
<%@ Register TagPrefix="uc4" Namespace="AMSOILGarage.classes" Assembly="AMSOILGarage" %>

<script type="text/javascript">
    function checkMeOnly(opt, recentlySelectedLabelID, optionText, productCode, purchaseLinkID, purchaseLinkText, optIDFragment) {
        resetRadioButtons(optIDFragment);
        opt.checked = true;
        var hdn = document.getElementById('wucServiceAdd1_hdnProductSource');
        hdn.value = '1';
    }
    function resetRadioButtons(optIDFragment) {
        var allInputs = document.getElementsByTagName("input");
        for (i = 0; i < allInputs.length; i++) {
            var input = allInputs[i];
            if (input.id != null) {
                if ((input.type == "radio") && (input.id.indexOf(optIDFragment) > -1)) {
                    input.checked = false;
                }
            }
        }
    }
    
    function lookupOnBlur() {
        if (document.getElementById('wucServiceAdd1_hdnMoveOn') != null) {
            if (document.getElementById('wucServiceAdd1_hdnMoveOn').value != '1') {
                setTimeout("document.forms[0].submit();", 300);
            }
            document.getElementById('wucServiceAdd1_Wizard1_wucServiceProductOtherAmsoil1_hdnDoLookup').value = '1';
        }
    }
    
    function resetAndSubmitForm() {
    }
    function stepNext(WizardID) {
        if (document.getElementById('wucServiceAdd1_Wizard1_wucServiceProductOtherAmsoil1_hdnDoLookup') != null) {
            if (document.getElementById('wucServiceAdd1_Wizard1_wucServiceProductOtherAmsoil1_hdnDoLookup').value != '1') {
                setTimeout("document.forms[0].submit();", 300);
            }
            document.getElementById('wucServiceAdd1_hdnMoveOn').value = '1';
        }
    }
//    function doPostBackAsync(eventName, eventArgs) {
//        var prm = Sys.WebForms.PageRequestManager.getInstance();
//        if (!Array.contains(prm._asyncPostBackControlIDs, eventName)) {
//            prm._asyncPostBackControlIDs.push(eventName);
//        }
//        if (!Array.contains(prm._asyncPostBackControlClientIDs, eventName)) {
//            prm._asyncPostBackControlClientIDs.push(eventName);
//        }
//        __doPostBack(eventName, eventArgs);
//    }
</script>

<!--<asp:Label ID="lblWizardCaption" runat="server" Text=""></asp:Label>-->
<input id="hdnCode" type="hidden" />
<input id="hdnName" type="hidden" />
<input id="hdnAnchor" type="hidden" />
<asp:HiddenField ID="hdnMoveOn" runat="server" />
<asp:HiddenField ID="hdnProductCodeReturned" Value="" runat="server" />
<asp:HiddenField ID="hdnUpdateAnchors" Value="0" runat="server" />
<asp:Label ID="lblUnitInstanceID" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblProductCount" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblServiceID" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblEquipmentTypeID" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblEquipmentUnitID" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblStepDisplay" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblEquipmentDescriptor" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblServiceType" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblProductType" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblProductIndex" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblProductSource" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblShowServiceEdit" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblNoTechContact" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblPreviousServiceTypeID" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblProductTypeCount" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblProductCodes" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblProductNames" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblProductSources" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblScreenCounts" runat="server" Visible="False" Text=""></asp:Label>
<asp:Label ID="lblNickname" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblProductSourceSelected" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblDivProductSelectionWasShowing" runat="server" Visible="false" Text=""></asp:Label>
<asp:Label ID="lblProductName" runat="server" Visible="false" Text=""></asp:Label>

<asp:HiddenField ID="hdnProductSource" runat="server" />
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
       <StyleSheets>
           <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Calendar.css" Assembly="Telerik.Web.UI" />
           <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Web20.Calendar.Web20.css" Assembly="Telerik.Web.UI" />
       </StyleSheets>
</telerik:RadStyleSheetManager>
<div id="wizard">
    <uc4:CustomWizard ID="Wizard1" runat="server" OnNextButtonClick="Wizard1_NextButtonClick" OnFinishButtonClick="Wizard1_FinishButtonClick" Width="100%" OnPreviousButtonClick="Wizard1_PreviousButtonClick" OnSideBarButtonClick="Wizard1_SideBarButtonClick" CancelDestinationPageUrl="/amsoilgarage.aspx" DisplayCancelButton="False"  onactivestepchanged="Wizard1_ActiveStepChanged">
        <SideBarTemplate>
            <asp:DataList ID="SideBarList" runat="server" OnItemDataBound="SideBarList_ItemDataBound">
                <ItemTemplate>
                    <asp:LinkButton ID="SideBarButton" runat="server"></asp:LinkButton>
                </ItemTemplate>
                <SelectedItemStyle Font-Bold="True" />
            </asp:DataList>
        </SideBarTemplate>
        <StartNextButtonStyle CssClass="button blue" />
        <FinishCompleteButtonStyle CssClass="button blue" />
        <StepNextButtonStyle CssClass="button blue" />
        <FinishPreviousButtonStyle CssClass="button gray" />
        <WizardSteps>
       
            <asp:WizardStep ID="WizardStep1" runat="server" Title="Select Service Type">
                <h3><span class="wizardStep">Select Service Type</span></h3><br/>
                <div class="formStyle">
                    <table>
                        <tr>
                            <td width="120px">
                                <asp:Button ID="btnUpdatePurchaseLinks" CssClass="invisible" runat="server" Text="You can't see me" />Service: <span class="required">*</span>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlServiceType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlServiceType_SelectedIndexChanged"></asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Date: <span class="required">*</span>
                            </td>
                            <td>
                                <telerik:RadDatePicker ID="rdpServiceDate" runat="server" MinDate="1900-01-01" ToolTip="Open the calendar popup" Skin="Web20" Calendar-ShowRowHeaders="False">
                                    <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
                                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                    <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy"></DateInput>
                                </telerik:RadDatePicker>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblVehicleMilesCaption" runat="server" Text="">Vehicle Miles:</asp:Label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtVehicleMiles" MaxLength="8" Width="100px" runat="server" Skin="Web20">
                                    <NumberFormat DecimalDigits="0" />
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="clear instructionLink">
                    <br/>
                    <a id="soIll" href="javascript:toggle('soIll');"  class="right">Show Instructions <img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br/>
                    <div class="instructions" id="instructionSection" style="display: none; clear: both;">
                        <hr/>
                        <p>Adding a service to this equipment record means you will be tracking a maintenance action and a possible AMSOIL product (or other non-AMSOIL product) associated with this maintenance.</p>
                        <span class="left">
                            <p>1.   First, define the <b>Service</b> by choosing a service type.  You can pick from any of the types we have provided for you, or choose <b>Custom Service Type</b> from the bottom of the list to add your own.</p>
                            <p>2.   Next, select a <b>Date</b> of service.  You can enter it in dd/mm/yyyy format, or use the calendar assistant link to the left to choose a date.</p>
                        </span>
                        <span class="left">
                            <p>3.   The <b>Equipment Miles</b> text box will automatically fill in with a number based upon the information you have entered into this equipment record’s <b>Current Mileage</b> field.  If you would like to change this, you can type any mileage into the text field.</p>
                            <p>4.   When you are ready to proceed, click the <b>Next</b> button.</p>
                        </span>
                    </div>
                </div>
                <hr class="clear" />
            </asp:WizardStep>
           
            <asp:WizardStep ID="WizardStep2" runat="server" Title="Select Products">
                <h3><%= StepDisplay %> - <span class="wizardStep"><b>Select <%= ProductTypeDisplay%></b> for <%= ServiceType%> Service</span></h3><br/>
                <p>                    
                    <asp:Panel ID="pnlProductSourceSelection" runat="server">
                        <div style="padding-left: 10px;">
                            <asp:Panel ID="pnlRecommended" runat="server">
                                <div runat="server" id="divGotProducts">
                                    <h3>Recommended AMSOIL Products</h3>
                                </div>
                                <div runat="server" id="divNoTechContact">
                                    <h3>Recommended AMSOIL Products</h3>
                                    <p class="instructions">
                                        AMSOIL currently does not currently recommend a specific product for this service
                                        on this equipment. You may call <%= TechServicesPhone%> or <%= TechServicesEmail%> for
                                        more help in finding a product recommendation.
                                    </p>
                                </div>
                                <div>
                                    <uc1:wucServiceProductRadioList2 ID="wucServiceProductRadioList21" runat="server" />
                                </div>
                            </asp:Panel>
                        </div>
                    </asp:Panel>
                </p>
                
                <div runat="server" id="divProductSelection">                
                    <uc2:wucServiceProductOtherAmsoil ID="wucServiceProductOtherAmsoil1" runat="server" />
                    <uc3:wucServiceProductNonAmsoil ID="wucServiceProductNonAmsoil1" runat="server" />
                </div>
                <!--<div runat="server" id="divRecentlySelected">
                    <%= ProductType%>:<asp:HyperLink ID="hypPurchase" runat="server">Purchase</asp:HyperLink>
                    <asp:Label ID="lblSelected" runat="server" Text=""></asp:Label>
                </div>-->
                <div id="divInfo" runat="server" class="invisible">
                    <p>
                        <asp:HyperLink ID="hypInfo" runat="server">Click here</asp:HyperLink> for information on selecting the correct AMSOIL product for your vehicle, or call 1-800-399-TECH for a live technical rep.
                    </p>
                </div>
                <div id="divNoInfo" runat="server" class="invisible">
                    <p>For information on selecting the correct AMSOIL product for your vehicle, call 1-800-399-TECH for a live technical rep.</p>
                </div>
                <div class="clear instructionLink">
                    <br/>
                    <a id="soIll" href="javascript:toggle('soIll');"  class="right">Show Instructions <img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br/>
                    <div class="instructions" id="instructionSection" style="display: none; clear: both;">
                        <hr/>
                        <div id="divDefaultInstructions" runat="server" class="clear">
                            <p>Based upon the service type you have chosen for this equipment, this next step will offer you the chance to attach an AMSOIL product or other product to this service record.  <b>You can click on the radio buttons just above the bold text to highlight any one of these four options.</b></p>
                            <span class="left">
                                <p>
                                1.   If your equipment type and engine are represented in one of the AMSOIL databases of known equipment, we will attempt to match products for you under the <b>AMSOIL Recommended Products</b> section.  If products are available, you may use one of the radio selection buttons to choose a product. If you are setting up a record for a multi-step service (such as <b>Change Engine Oil & Filter</b>) you will need to select products several times to complete this step.
                                <br/><i><b>NOTE:</b> If no products are found or we cannot match this equipment, this area has contact information which you can use to request product selection help from the <b>AMSOIL Technical Services Department.</b></i>
                                </p>
                                <p>2.   If we did not match specific products to the equipment you are attempting to service, you can also choose to have the website assist you with finding and attaching an AMSOIL product yourself. Choose the <b>AMSOIL Products</b> section to lookup a product.</p>
                            </span>
                            <span class="left">
                                <p>3.   If you need to enter a product for a service which AMSOIL does not offer (such as electrical parts or tires), you can select the <b>Other Products</b> section to use a free form textbox to attach a non-AMSOIL part number to this service record.</p>
                                <p>4.   If you do not want to attach any products to this service at this time, select the <b>None</b> option.</p>
                                <p>5.   When you are ready to move on, click the <b>Next</b> button.  If you would like to go back and make changes to details from the last screen, click the “<b>Previous</b>” button.</p>
                            </span>
                        </div>
                        <div id="divOtherAMSOILInstructions" runat="server" class="clear">
                            <p>In order to help you select an AMSOIL product for this service record, we have included a product lookup feature.</p>
                            <span class="left">
                                <p>1.   Enter your AMSOIL Product Code (if known). To select from a list of AMSOIL products, enter the first 3 characters of the Product Code then click TAB or NEXT.</p>
                                <p>2.   If you would like more help determining which motor oil you would like to use for an oil change service, click on the <b>Lookup a Motor Oil</b> button to use our Product Recommendation and Drain Interval Guide. It consists of a series of questions which will guide you to your best lubricant options. When finished you will be able to click on a motor oil product and attach it to this service.</p>
                            </span>
                            <span class="left">
                                <p>3.   When you have determined the AMSOIL product you wish to use for this service record, click <b>Next</b> to continue. If you would like to go back and make changes to details from the last screen, click the “<b>Previous</b>” button.</p>
                            </span>
                        </div>
                        <div id="divOtherInstructions" runat="server" class="clear">
                            <span class="left">
                                <p>1.   Use the text box above to enter descriptive details about the non-AMSOIL product your are attaching to this equipment’s service record.</p>
                            </span>
                            <span class="left">
                                <p>2.   Click <b>Next</b> to continue. If you would like to go back and make changes to details from the last screen, click the “<b>Previous</b>” button.</p>
                            </span>
                        </div>
                    </div>
                </div>
                <hr class="clear" />
            </asp:WizardStep>
           
            <asp:WizardStep ID="WizardStep3" runat="server" Title="Service Details/Procedures Comments">
                <h3><%= StepDisplay %> - <span class="wizardStep"><b>(Optional)</b> - Procedure Details</span></h3><br/>
                <div class="formStyle">
                    <table>
                        <tr>
                            <td valign="top">
                                Details:
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtDetails" TextMode="MultiLine" Height="80" Width="50%"
                                    MaxLength="1000" runat="server" Skin="Web20">
                                </telerik:RadTextBox><br/>
                            </td>
                        </tr>
                        <tr>
                            <td width="120px">
                                Service Cost:
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtServiceCost" MaxLength="8" Width="100px" runat="server" Skin="Web20" MaxValue="1000000" Type="Currency">
                                    <NumberFormat DecimalDigits="2" />
                                </telerik:RadNumericTextBox>
                                <div runat="server" id="divTechInfo">
                                    <a href="#tech" class="whatsThis">Technical Information</a>
                                    <div class="invisible">
                                        <div id="tech">
                                            <table>
                                                <tr runat="server" id="trTech">
                                                    <td>
                                                        <h3><asp:Label ID="lblTechCaption" runat="server" Text=""></asp:Label></h3>
                                                        <asp:Label ID="lblTech" runat="server" Text=""></asp:Label>
                                                        <p align="right"><a href="#" onclick="$.fancybox.close()" class="button gray">Close</a></p> 
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                   
                </div>
                <div class="clear instructionLink">
                    <br/>
                    <a id="soIll" href="javascript:toggle('soIll');"  class="right">Show Instructions <img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br/>
                    <div class="clear instructions" id="instructionSection" style="display: none;">
                        <hr/>
                        <p>The step allows you to provide some optional maintenance procedure details for your records.</p>
                        <span class="left">
                            <p>1.   If you would like to record a <b>Service Cost</b> for this maintenance record, you may do so in the text box available.</p>
                            <p>2.   You can also provide details about the service in the <b>Details</b> text box. This can be useful for reference the next time you look up this service item.</p>
                        </span>
                        <span class="left">
                            <p>3.   Click <b>Next</b> to continue. If you would like to go back and make changes to details from the last screen, click the “<b>Previous</b>” button.</p>
                        </span>
                    </div>
                </div>
                <hr class="clear" />
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep4" runat="server" Title="E-Mail Reminders">
                
                    <h3> <%= StepDisplay %> - <span class="wizardStep"><b>(Optional)</b> - Set Email Reminder</span></h3> <br/>  
                    <div class="formStyle">         
                    <p><asp:CheckBox ID="chkSendEmailNextChange" runat="server" /> Send me an e-mail reminder to follow up on this procedure</p>
                    <p>
                        <div style="display: none; visibility: hidden;">
                            <table>
                                <tr>
                                    <td width="150px">
                                        Recommended Oil Change Date: <span class="required">*</span>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblNextOilChangeDate" Font-Bold="true" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <table>
                            <tr>
                                <td width="220px">
                                    Select Your Email Reminder Date:
                                </td>
                                <td>
                                    <telerik:RadDatePicker ID="rdpNextEmailDate" runat="server" MinDate="1900-01-01" ToolTip="Open the calendar popup" CssClass="RadCalendar_Default" Skin="Web20" Calendar-ShowRowHeaders="False">
                                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" Skin="Web20"></Calendar>
                                        <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                        <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy"></DateInput>
                                    </telerik:RadDatePicker>
                                </td>
                            </tr>
                        </table>
                        <br/><b>Note:</b> To ensure that your important MyAMSOILGarage™ email messages are not filtered into your Spam, Junk or Bulk Mail folder, select the Add/Save to Address Book function in your email browser and follow the appropriate instructions to add AMSOIL to your safe senders list. See your email providers Safe Senders List instructions for more details on how to accomplish this.
                    </p>
                </div>
                <div class="clear instructionLink">
                    <br/>
                    <a id="soIll" href="javascript:toggle('soIll');"  class="right">Show Instructions <img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br/>
                    <div class="instructions" id="instructionSection" style="display: none; clear: both;">
                        <hr/>
                        <p>The final step allows you to set up an email reminder for this service to the address we have on file for your MyAMSOILGarage™ account. If you do not wish to set up an email reminder right now, you will also be able to do so later from the <b>Email Reminders</b> screen.</p>
                        <span class="left">
                            <p>1.   Check the box next to “<b>Send me an e-mail reminder to follow up in this procedure</b>” to enable this feature.</p>
                            <p>2.   Set the <b>Email Reminder Date</b>. You can enter it in dd/mm/yyyy format, or use the calendar assistant link to the left to choose a date.</p>
                        </span>
                        <span class="left">
                            <p>3.   Click <b>Finish</b> to save this equipment service record. If you would like to go back and make changes to details from the last screen, click the “<b>Previous</b>” button.</p>
                        </span>
                    </div>
                </div>
                <hr class="clear" />
            </asp:WizardStep>
           
            <asp:WizardStep ID="WizardStep5" runat="server" Title="Complete" StepType="Complete">
                <div id="wizardEnd">
                    <h3 class="center"><%= ServiceType%> recorded for <%= NickName%></h3><br/><br />
                    <h4>Please select your next option:</h4><br />
                    <asp:ImageButton ID="btnBackToEquipment" ImageUrl="~/AmsoilGarage/Theme/images/equip1.gif" OnClick="btnBackToEquipment_Click" runat="server" /> <a href="#details" class="whatsThis" alt="What's This?" title="What's This?"><img src="/AmsoilGarage/Theme/images/miniHelp.png"  /></a><br/><br />
                    <asp:ImageButton ID="btnAddNewService" ImageUrl="~/AmsoilGarage/Theme/images/add1.gif" OnClick="btnAddNewService_Click" runat="server" /> <a href="#service" class="whatsThis" alt="What's This?" title="What's This?"><img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br /><br />
                    <asp:ImageButton ID="btnEmail" ImageUrl="~/AmsoilGarage/Theme/images/email1.gif" OnClick="btnEmail_Click" runat="server" /> <a href="#reminders" class="whatsThis" alt="What's This?" title="What's This?"><img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br /><br />
                    <div runat="server" id="productLookup">
                        <h4>Or...</h4><br />
                        <asp:ImageButton ID="btnAddNewEquipment" ImageUrl="~/AmsoilGarage/Theme/images/addEquip1.gif"  OnClick="btnAddNewEquipment_Click" runat="server" /><a href="#equipment" class="whatsThis" alt="What's This?" title="What's This?"><img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a>
                    </div>
                    <!-- Help Information -->
                    <div style="display: none;">
                        <div id="details">
                            <h3>View Equipment Details</h3>
                            <p>Look at the information you used to create this equipment record.</p>
                            <p align="right"><br/>
                                <a href="#" onclick="$.fancybox.close()" class="button gray">Close</a>
                            </p>
                        </div>
                        <div id="service">
                            <h3>Add New Service</h3>
                            <p>Start tracking maintenance actions and products for this equipment record.</p>
                            <p align="right"><br/>
                                <a href="#" onclick="$.fancybox.close()" class="button gray">Close</a>
                            </p>
                        </div>
                        <div id="reminders">
                            <h3>Set-Up Email Reminders</h3>
                            <p>Set up a scheduled email to remind you to look at this equipment record.</p>
                            <p align="right"><br/>
                                <a href="#" onclick="$.fancybox.close()" class="button gray">Close</a>
                            </p>
                        </div>
                        <div id="equipment">
                            <h3>Add New Equipment</h3>
                            <p>Start the process over and add another piece of equipment to your account.</p>
                            <p align="right"><br/>
                                <a href="#" onclick="$.fancybox.close()" class="button gray">Close</a>
                            </p>
                        </div>
                    </div>
                    <div class="clear instructionLink">
                        <br/>
                        <a id="soIll" href="javascript:toggle('soIll');"  class="right">Show Instructions <img src="/AmsoilGarage/Theme/images/miniHelp.png" /></a><br/>
                        <div class="instructions" id="instructionSection" style="display: none; clear: both; text-align: left;">
                            <hr/>
                            <p>To get started, you must first choose a type of equipment to add to your MyAMSOILGarage&trade; account.  Follow these steps to add a new piece of equipment:</p>
                                <span class="left">
                                    <p>1. Choose the <b>Equipment Details</b> button to see a summary screen of everything you just entered for this equipment.  From this screen, you can <b>Adjust Equipment Details</b> if something may not be correct or <b>Add a Photo</b> to this equipment record.</p>
                                    <p>2. Choose the <b>Add New Service</b> button if you would like to begin tracking your maintenance of this equipment and start attaching products to the equipment.</p>
                                </span>
                                <span class="left">
                                    <p>3. Choose <b>Set Up E-Mail Reminders</b> if you would like to schedule maintenance email reminders for this piece of equipment. This can also be done after you have attached products and maintenance types through the Add New Service option.</p>
                                    <p>4. Or, if you have more equipment records which you would like to enter now, you may choose <b>Add Additional Equipment</b> to start the process over and redefine another equipment record.</p>
                                </span>
                            </ol>
                        </div>
                    </div>
                    <hr class="clear" />
                </div>
            </asp:WizardStep>
        </WizardSteps>
        <StepNavigationTemplate>
            <asp:Button CausesValidation="False" CssClass="button gray" CommandName="MovePrevious" ID="StepPreviousButton"
                runat="server" Text="Previous" />
            <asp:Button CommandName="MoveNext" CssClass="button blue" ID="StepNextButton" runat="server" Text="Next" />
        </StepNavigationTemplate>
        <CancelButtonStyle CssClass="button black" />
        <SideBarStyle CssClass="wizardSidebar" />
    </uc4:CustomWizard>
</div>
<asp:Button ID="btnServiceCustomater" CssClass="invisible" runat="server" Text="Anna" />
<cc1:ModalPopupExtender runat="server" ID="mpeCustomService" TargetControlID="btnServiceCustomater"
    PopupControlID="pnlCustomService" BackgroundCssClass="modalBackground" DropShadow="false" />
<asp:Panel ID="pnlCustomService" runat="server" CssClass="modalPopup">
    <div class="modalHeader"></div>
    <div class="modal">
        <!-- Add Custom Service -->
        <div runat="server" id="divAddCustomService">
            <h3>Add Custom Service Item</h3>
            <p>
                <span class="formStyle"><asp:TextBox ID="txtNewCustomService" runat="server"></asp:TextBox></span>
            </p>
            <p align="right">
                <asp:Button ID="btnSaveNewCustomService" CssClass="button blue" runat="server" Text="Save" OnClick="btnSaveNewCustomService_Click" />
                <asp:Button ID="btnCancelNewCustomService" CssClass="button gray" runat="server" Text="Cancel" OnClick="btnCancelNewCustomService_Click" />
            </p>
        </div>
        
        <!-- Edit Custom Service -->
        <div runat="server" id="divUpdateCustomService">
            <h3>Edit Custom Service Item(s)</h3>
            <asp:GridView ID="grdUpdateServiceTypes" runat="server" AutoGenerateColumns="False"
                DataKeyNames="ServiceTypeUserDefinedID" DataSourceID="sdsSTUD" OnRowDataBound="grdUpdateServiceTypes_RowDataBound"
                OnRowCommand="grdUpdateServiceTypes_RowCommand" OnRowUpdated="grdUpdateServiceTypes_RowUpdated">
                <Columns>
                    <asp:BoundField DataField="ServiceTypeUserDefinedID" HeaderText="ServiceTypeUserDefinedID"
                        InsertVisible="False" ReadOnly="True" SortExpression="ServiceTypeUserDefinedID"
                        Visible="False" />
                    <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
                        Visible="False" />
                    <asp:BoundField DataField="ServiceType" HeaderText="ServiceType" SortExpression="ServiceType" />
                    <asp:CommandField ShowEditButton="True">
                        <ControlStyle CssClass=" " />
                    </asp:CommandField>
                    <asp:BoundField DataField="EquipmentTypeID" HeaderText="EquipmentTypeID" SortExpression="EquipmentTypeID"
                        Visible="False" />
                    <asp:TemplateField HeaderText="" ShowHeader="False" ItemStyle-CssClass="">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkDelete" Font-Size="8pt" runat="server" OnClientClick="return confirm('OK to Delete?');"
                                CausesValidation="false" CommandName="Remove" CommandArgument='<%# Eval("ServiceTypeUserDefinedID") %>'
                                Text="Remove"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="sdsSTUD" runat="server" ConnectionString="<%$ ConnectionStrings:AmsoilGarageConnectionString %>"
                SelectCommand="SELECT * FROM [ServiceTypeUserDefined] WHERE (([EquipmentTypeID] = @EquipmentTypeID) AND ([CustomerID] = @CustomerID)) ORDER BY [ServiceType]"
                DeleteCommand="DELETE FROM [ServiceTypeUserDefined] WHERE [ServiceTypeUserDefinedID] = @ServiceTypeUserDefinedID"
                InsertCommand="INSERT INTO [ServiceTypeUserDefined] ([CustomerID], [ServiceType], [EquipmentTypeID]) VALUES (@CustomerID, @ServiceType, @EquipmentTypeID)"
                UpdateCommand="UPDATE [ServiceTypeUserDefined] SET [ServiceType] = @ServiceType, [EquipmentTypeID] = @EquipmentTypeID WHERE [ServiceTypeUserDefinedID] = @ServiceTypeUserDefinedID">
                <SelectParameters>
                    <asp:ControlParameter ControlID="lblEquipmentTypeID" Name="EquipmentTypeID" PropertyName="Text"
                        Type="Int32" />
                    <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="Int32" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="ServiceTypeUserDefinedID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="ServiceType" Type="String" />
                    <asp:ControlParameter ControlID="lblEquipmentTypeID" Name="EquipmentTypeID" PropertyName="Text"
                        Type="Int32" />
                    <asp:Parameter Name="ServiceTypeUserDefinedID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="Int32" />
                    <asp:Parameter Name="ServiceType" Type="String" />
                    <asp:ControlParameter ControlID="lblEquipmentTypeID" Name="EquipmentTypeID" PropertyName="Text"
                        Type="Int32" />
                </InsertParameters>
            </asp:SqlDataSource>
            <br />
            <%--<asp:Button ID="btnCancelUpdateCustomServic" runat="server" Text="Cancel" OnClick="btnCancelUpdateCustomService_Click" />--%>
            <p align="right">
                <asp:Button ID="btnSaveUpdateCustomService" CssClass="button blue" runat="server"
                    Text="Done" OnClick="btnSaveUpdateCustomService_Click" />
            </p>
        </div>
    </div>
    <div class="modalFooter"></div>
</asp:Panel>

WebUserControl  Code Behind -
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using AMSOILGarage.classes;
using AmsDbVB;
using AmsDbLib;
using GarageLib;


namespace AMSOILGarage.WebControls
{
    public partial class wucServiceAdd : cGarageDataControl
    {
        public enum ProductSourceEnum { Recommended = 1, OtherAmsoil = 2, NonAmsoil = 3 };

        #region properties
        public int ServiceID
        {
            get
            {
                Label lbl = (Label)FindControl("lblServiceID");
                return Convert.ToInt32(cStatic.ValC(lbl.Text));
            }
            set
            {
                Label lbl = (Label)FindControl("lblServiceID");
                lbl.Text = value.ToString();
            }
        }
        public string NickName
        {
            get
            {
                Label lbl = (Label)FindControl("lblNickName");
                return lbl.Text;
            }
            set
            {
                Label lbl = (Label)FindControl("lblNickName");
                lbl.Text = value;
            }
        }
        public int UnitInstanceID
        {
            get
            {
                Label lbl = (Label)FindControl("lblUnitInstanceID");
                return Convert.ToInt32(cStatic.ValC(lbl.Text));
            }
            set
            {
                Label lbl = (Label)FindControl("lblUnitInstanceID");
                lbl.Text = value.ToString();
                if (value > 0)
                {
                    vehicle v = new vehicle();
                    v.ConnectionString = ConnectionString;
                    v.UnitInstanceID = value;
                    bool bSuccess = v.setServiceValues();
                    if (bSuccess)
                    {
                        if (v.CustomerID != CustomerID)
                        {
                            Response.Redirect("~/");
                        }
                        EquipmentDescriptor = v.EquipmentDescriptor;
                        EquipmentTypeID = v.EquipmentTypeID;
                        EquipmentUnitID = v.EquipmentUnitID;
                    }
                    NickName = v.getNickname(UnitInstanceID);
                }
            }
        }
        public int EquipmentUnitID
        {
            get
            {
                Label lbl = (Label)FindControl("lblEquipmentUnitID");
                return Convert.ToInt32(cStatic.ValC(lbl.Text));
            }
            set
            {
                Label lbl = (Label)FindControl("lblEquipmentUnitID");
                lbl.Text = value.ToString();
            }
        }
        private ProductSourceEnum productSource = ProductSourceEnum.NonAmsoil;
        public ProductSourceEnum ProductSource
        {
            get
            {
                List<ProductSourceEnum> pSources = ProductSources;
                while (pSources.Count < ProductIndex)
                {
                    pSources.Add(ProductSourceEnum.Recommended);
                }        
                return pSources[ProductIndex-1];
            }
            set
            {
                productSource = value;
                if (productSource == ProductSourceEnum.Recommended)
                {
                }
                else if (productSource == ProductSourceEnum.OtherAmsoil)
                {
                    wucServiceProductRadioList21.SelectedIndex = (wucServiceProductRadioList21.ProductCount - 2);
                    wucServiceProductOtherAmsoil1.Visible = true;
                    this.wucServiceProductNonAmsoil1.Visible = false;
                }
                else //(productSource == ProductSourceEnum.NonAmsoil)
                {
                    wucServiceProductRadioList21.SelectedIndex = (wucServiceProductRadioList21.ProductCount - 1);
                    this.wucServiceProductNonAmsoil1.Visible = true;
                    wucServiceProductOtherAmsoil1.Visible = false;
                    ProductCode = string.Empty;
                }

                List<ProductSourceEnum> pSources = ProductSources;
                while (pSources.Count < ProductIndex)
                {
                    pSources.Add(ProductSourceEnum.Recommended);
                }
                pSources[ProductIndex - 1] = value;
                ProductSources = pSources;
                ProductNameRecentlySelected = ProductNameRecentlySelected;
                hypPurchase.NavigateUrl = wucServiceProductRadioList21.PurchaseLink;
            }
        }
        public int EquipmentTypeID
        {
            get
            {
                return Convert.ToInt32(cStatic.ValC(lblEquipmentTypeID.Text));
            }
            set
            {
                lblEquipmentTypeID.Text = value.ToString();
            }
        }        
        public int CustomerID
        {
            get
            {
                int customerID = 0;
                if (Session["CustomerID"] != null && int.Parse(Session["CustomerID"].ToString()) != 0)
                {
                    customerID = int.Parse(Session["CustomerID"].ToString());
                }
                return customerID;
            }
        }
        public string EquipmentDescriptor
        {
            get
            {
                Label lbl = (Label)FindControl("lblEquipmentDescriptor");
                return lbl.Text;
            }
            set
            {
                Label lbl = (Label)FindControl("lblEquipmentDescriptor");
                lbl.Text = value;
            }
        }

        public int ServiceTypeID
        {
            get
            {
                return Convert.ToInt32(ddlServiceType.SelectedValue);
            }
            set
            {
                AmsWebLibrary.Module1.SelectDDLItem(ref ddlServiceType, value, false, true);
            }
        }
        public string ServiceType
        {
            get
            {
                Label lbl = (Label)FindControl("lblServiceType");
                return lbl.Text;
            }
            set
            {
                Label lbl = (Label)FindControl("lblServiceType");
                lbl.Text = value;
            }
        }
        public string ProductType
        {
            get
            {
                Label lbl = (Label)FindControl("lblProductType");
                return lbl.Text;
            }
            set
            {
                Label lbl = (Label)FindControl("lblProductType");
                lbl.Text = value;
            }
        }
        public string ProductTypeDisplay
        {
            get
            {
                string s = ProductType;
                if (s == "Other")
                {
                    s = "Product";
                }
                return s;
            }
        }
        public int ProductIndex
        {
            get
            {
                Label lbl = (Label)FindControl("lblProductIndex");
                return Convert.ToInt32(cStatic.ValC(lbl.Text));
            }
            set
            {
                Label lbl = (Label)FindControl("lblProductIndex");
                lbl.Text = value.ToString();
            }
        }
        public string StepDisplay
        {
            get
            {
                Label lbl = (Label)FindControl("lblStepDisplay");
                return lbl.Text;
            }
            set
            {
                Label lbl = (Label)FindControl("lblStepDisplay");
                lbl.Text = value;
            }
        }
        public string WizardCaption
        {
            get
            {
                Label lbl = (Label)FindControl("lblWizardCaption");
                return lbl.Text;
            }
            set
            {
                Label lbl = (Label)FindControl("lblWizardCaption");
                lbl.Text = value;
            }
        }
        private bool multiProductServiceSelected;
        public bool MultiProductServiceSelected
        {
            get
            {
                return multiProductServiceSelected;
            }
            set
            {
                multiProductServiceSelected = value;
            }
        }
        public string ServiceDate
        {
            get
            {
                return rdpServiceDate.SelectedDate.ToString();
            }
            set
            {
                if (value.Length > 0)
                {
                    rdpServiceDate.SelectedDate = Convert.ToDateTime(value);
                }
            }
        }
        public string ServiceMiles
        {
            get
            {
                return txtVehicleMiles.Text;
            }
            set
            {
                if (value == "0")
                {
                    txtVehicleMiles.Text = string.Empty;
                }
                else
                {
                    txtVehicleMiles.Text = value;
                }
            }
        }
        public string ServiceCost
        {
            get
            {
                return txtServiceCost.Text;
            }
            set
            {
                txtServiceCost.Text = value;
            }
        }
        public string Details
        {
            get
            {
                return txtDetails.Text;
            }
            set
            {
                txtDetails.Text = value;
            }
        }
        private string productCode = string.Empty;
        public string ProductCode
        {
            get
            {
                return productCode;
            }
            set
            {
                if (value == "OTHERAMSOIL" || value == "NONAMSOIL")
                {
                    productCode = string.Empty;
                }
                else
                {
                    productCode = value;
                }
            }
        }
        public string ProductCodeSelected
        {
            get
            {
                ProductSourceEnum ps = ProductSource;
                if ((ps == ProductSourceEnum.Recommended) && (wucServiceProductRadioList21.SelectedIndex > -1))
                {
                    return wucServiceProductRadioList21.ProductCode;
                }
                else if ((ps == ProductSourceEnum.OtherAmsoil) && (wucServiceProductOtherAmsoil1.ProductCode.Length > -1))
                {
                    return wucServiceProductOtherAmsoil1.ProductCode;
                }
                else
                {
                    return string.Empty;
                }
            }
        }
        private List<string> productCodes = new List<string>();
        public List<string> ProductCodes
        {
            get
            {
                productCodes.Clear();
                string s = lblProductCodes.Text;
                string _pattern = @"\,";
                int commaCount = cGeneral.CountOccurrences(s, _pattern);
                if (s.Trim().Length > 0)
                {
                    commaCount += 1;
                }

                string[] codes = new string[commaCount];

                codes = s.Split(new char[] { ',' });
                for (int i = 0; i <= commaCount - 1; i += 1)
                {
                    productCodes.Add(codes[i].Replace("|",string.Empty));
                }
                return productCodes;
            }
            set
            {
                System.Text.StringBuilder sCodes = new System.Text.StringBuilder();
                List<string> productCodes = value;
                foreach (string s in productCodes)
                {
                    if (s.Trim().Length > 0)
                    {
                        sCodes.Append(s + ",");
                    }
                    else
                    {
                        sCodes.Append("|,");
                    }
                }
                if (sCodes.Length > 1)
                {
                    sCodes = sCodes.Remove(sCodes.Length - 1, 1);                    
                }
                lblProductCodes.Text = sCodes.ToString();
            }
        }

        private List<string> productNames = new List<string>();
        public List<string> ProductNames
        {
            get
            {
                productNames.Clear();
                string s = lblProductNames.Text;
                string _pattern = @"\,";
                int commaCount = cGeneral.CountOccurrences(s, _pattern);
                if (s.Trim().Length > 0)
                {
                    commaCount += 1;
                }

                string[] Names = new string[commaCount];

                Names = s.Split(new char[] { ',' });
                for (int i = 0; i <= commaCount - 1; i += 1)
                {
                    productNames.Add(Names[i].Replace("|", string.Empty));
                }
                return productNames;
            }
            set
            {
                System.Text.StringBuilder sNames = new System.Text.StringBuilder();
                List<string> productNames = value;
                foreach (string s in productNames)
                {
                    if (s.Trim().Length > 0)
                    {
                        sNames.Append(s + ",");
                    }
                    else
                    {
                        sNames.Append("|,");
                    }
                }
                if (sNames.Length > 1)
                {
                    sNames = sNames.Remove(sNames.Length - 1, 1);
                }
                lblProductNames.Text = sNames.ToString();
            }
        }
        private List<ProductSourceEnum> productSources = new List<ProductSourceEnum>();
        public List<ProductSourceEnum> ProductSources
        {
            get
            {
                productSources.Clear();
                string s = lblProductSources.Text;
                string _pattern = @"\,";
                int commaCount = cGeneral.CountOccurrences(s, _pattern);
                if (s.Trim().Length > 0)
                {
                    commaCount += 1;
                }

                string[] Sources = new string[commaCount];

                Sources = s.Split(new char[] { ',' });
                for (int i = 0; i <= commaCount - 1; i += 1)
                {
                    ProductSourceEnum pse =
                        (ProductSourceEnum)Enum.Parse(typeof(ProductSourceEnum), Sources[i]);

                    productSources.Add(pse);
                    //.ToString("D")
                }
                return productSources;
            }
            set
            {
                System.Text.StringBuilder sSources = new System.Text.StringBuilder();
                productSources = value;
                foreach (ProductSourceEnum pse in productSources)
                {                    
                    sSources.Append(pse.ToString("D") + ",");
                }
                if (sSources.Length > 1)
                {
                    sSources = sSources.Remove(sSources.Length - 1, 1);
                }
                lblProductSources.Text = sSources.ToString();
            }
        }
        private List<int> screenCounts = new List<int>();
        public List<int> ScreenCounts
        {
            get
            {
                screenCounts.Clear();
                string s = lblScreenCounts.Text;
                string _pattern = @"\,";
                int commaCount = cGeneral.CountOccurrences(s, _pattern);
                if (s.Trim().Length > 0)
                {
                    commaCount += 1;
                }

                string[] Counts = new string[commaCount];
                Counts = s.Split(new char[] { ',' });
                for (int i = 0; i <= commaCount - 1; i += 1)
                {
                    Int32 pse = 0;
                    bool b = Int32.TryParse(Counts[i], out pse);
                    if (b)
                    {
                    }

                    screenCounts.Add(pse);
                    //.ToString("D")
                }
                return screenCounts;
            }
            set
            {
                System.Text.StringBuilder sCounts = new System.Text.StringBuilder();
                screenCounts = value;
                foreach (int pse in screenCounts)
                {
                    sCounts.Append(pse.ToString() + ",");
                }
                if (sCounts.Length > 1)
                {
                    sCounts = sCounts.Remove(sCounts.Length - 1, 1);
                }
                lblScreenCounts.Text = sCounts.ToString();
            }
        }

        //private string productName = string.Empty;
        public string ProductName
        {
            get
            {
                return lblProductName.Text;
            }
            set
            {
                lblProductName.Text = value;
                wucServiceProductNonAmsoil1.ProductName = value;
            }
        }
        public string ProductNameSelected
        {
            get
            {

                if (ProductSource == ProductSourceEnum.NonAmsoil)
                {
                    return wucServiceProductNonAmsoil1.ProductName;
                }
                else
                {
                    return string.Empty;
                }
            }
        }
        public string ProductNameRecentlySelected
        {
            get
            {
                string s = "No Selection";

                if (ProductSource == ProductSourceEnum.NonAmsoil)
                {
                    string sProductName = wucServiceProductNonAmsoil1.ProductName;
                    s = sProductName.Length > 0 ? sProductName : s;
                }
                else if ((ProductSource == ProductSourceEnum.Recommended) || (ProductSource == ProductSourceEnum.OtherAmsoil))
                {
                    string sProductCode = ProductCodeSelected;
                    if (sProductCode.Length > 0)
                    {
                        product p = new product();
                        p.ConnectionString = ConnectionString;
                        s = p.getNameByCode(sProductCode);
                    }
                }
                return s;
            }
            set
            {
                lblSelected.Text = value;
            }
        }

        public bool SendEmail
        {
            get
            {
                return chkSendEmailNextChange.Checked;
            }
            set
            {
                chkSendEmailNextChange.Checked = value;
            }
        }

        public bool ShowOtherAmsoil
        {
            get
            {
                return ((ServiceTypeID > 0) && !NoTechContact);
            }
        }

        public string NextEmailDate
        {
            get
            {
                return rdpNextEmailDate.SelectedDate.ToString();
            }
            set
            {
                if (value.Length > 0)
                {
                    rdpNextEmailDate.SelectedDate = Convert.ToDateTime(value);
                }
            }
        }

        public string InfoLink
        {
            get
            {
                return hypInfo.NavigateUrl;
            }
            set
            {
                hypInfo.NavigateUrl = value;
                divInfo.Visible = false;// (value.Length > 0);
                divNoInfo.Visible = false;//(value.Length == 0);
            }
        }

        public bool ShowServiceEdit
        {
            get
            {
                if (lblShowServiceEdit.Text.Length == 0)
                {
                    lblShowServiceEdit.Text = "false";
                }
                return Convert.ToBoolean(lblShowServiceEdit.Text);
            }
            set
            {
                lblShowServiceEdit.Text = value.ToString();
                if (Convert.ToBoolean(lblShowServiceEdit.Text))
                {
                    //pnlCustomService.Style.Value = "display:block;";
                    mpeCustomService.Show();
                }
                else
                {
                    pnlCustomService.Style.Value = "display:none;";
                    mpeCustomService.Hide();
                }
            }
        }

        public bool NoTechContact
        {
            get
            {
                if (lblNoTechContact.Text.Length == 0)
                {
                    lblNoTechContact.Text = "false";
                }
                return Convert.ToBoolean(lblNoTechContact.Text);
            }
            set
            {
                lblNoTechContact.Text = value.ToString();
                if (Convert.ToBoolean(lblNoTechContact.Text))
                {
                    divNoTechContact.Style.Value = "display:none;";
                }
                else
                {
                    divNoTechContact.Style.Value = "display:block;";
                }
            }
        }

        public int PreviousServiceTypeID
        {
            get
            {
                return Convert.ToInt32(cStatic.ValC(lblPreviousServiceTypeID.Text));
            }
            set
            {
                lblPreviousServiceTypeID.Text = value.ToString();
            }
        }
        
        public string ButtonUpdatePurchaseLinksID
        {
            get
            {
                return btnUpdatePurchaseLinks.ClientID;
            }
        }
        public string HiddenUpdateAnchorsID
        {
            get
            {
                return hdnUpdateAnchors.ClientID;
            }
        }
        public string HiddenProductCodeReturnedID
        {
            get
            {
                return hdnProductCodeReturned.ClientID;
            }
        }
        private List<ProductType> productTypes = new List<ProductType>();
        public List<ProductType> ProductTypes
        {
            get
            {
                return productTypes;
            }
            set
            {
                productTypes = value;
            }
        }

        public int ProductCount
        {
            get
            {
                return Convert.ToInt32(cStatic.ValC(lblProductCount.Text));
            }
            set
            {
                lblProductCount.Text = value.ToString();
            }
        }

        public int CurrentProductTypeID
        {
            get
            {
                if (ProductTypes.Count > 0)
                {
                    return ProductTypes[ProductIndex - 1].ProductTypeID;
                }
                else
                {
                    return 0;
                }
            }
        }

        public bool ProductSelected
        {
            get
            {
                if (!divProductSelection.Visible && wucServiceProductRadioList21.AmsoilProductSelected)
                {
                    return true;
                }
                else if (divProductSelection.Visible && ProductSource == ProductSourceEnum.OtherAmsoil && wucServiceProductOtherAmsoil1.ProductCode != string.Empty)
                {
                    return true;
                }
                else if ((ProductSource == ProductSourceEnum.NonAmsoil) && divProductSelection.Visible)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }

        public RadioButton optRecommended
        {
            get
            {
                Panel div = (Panel)pnlProductSourceSelection.FindControl("pnlRecommended");
                RadioButton opt = (RadioButton)div.FindControl("optPSRecommended");
                return opt;
            }
        }

        public RadioButton optNone
        {
            get
            {
                Panel div = (Panel)pnlProductSourceSelection.FindControl("pnlRecommended");
                RadioButton opt = (RadioButton)div.FindControl("optPSNone");
                return opt;
            }
        }
        public string TechServicesPhone
        {
            get
            {
                return AmsWebLibrary.Module1.getWebConfigValue("TechServicesPhone");
            }
        }
        public string TechServicesEmail
        {
            get
            {
                return AmsWebLibrary.Module1.getWebConfigValue("TechServicesEmailLink");
            }
        }
        
        #endregion

        #region events
        void NextButtonSelected()
        {
            WizardNavigationEventArgs wa = new WizardNavigationEventArgs(Wizard1.ActiveStepIndex, Wizard1.ActiveStepIndex + 1);
            object o = Wizard1;
            WizardMoveNext(ref o, ref wa);
            if (!wa.Cancel && (ProductIndex >= (ProductCount - 1)))
            {
                Wizard1.MoveTo(WizardStep3);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            wucServiceProductOtherAmsoil1.ProductSelectedEvent += new wucServiceProductOtherAmsoil.ProductSelectedEventHandler(wucServiceProductOtherAmsoil1_ProductSelectedEvent);
            if (wucServiceProductOtherAmsoil1.getResetDoLookupValue() == "1")
            {
                wucServiceProductOtherAmsoil1.doLookup();
            }
            if (hdnMoveOn.Value == "1")
            {
                hdnMoveOn.Value = string.Empty;
                this.NextButtonSelected();
            }

            if (AmsWebLibrary.Module1.IsDev())
            {
                Session["ZO_NUM"] = 600001;
                Session["DealerName"] = "Joe Sixpack";
                Session["Email"] = "vbswami@gmail.com";
                Session["CustomerID"] = 195897;// 851096;
                Session["PriceType"] = "PRUSCAT";
            }

            if (Session["CustomerID"] == null || int.Parse(Session["CustomerID"].ToString()) == 0)
            {
                Response.Redirect("~/loginweb.aspx?sourceform=/mygarage/garage.aspx");
            }

            productCodes = new List<string>();
            productNames = new List<string>();
            productSources = new List<ProductSourceEnum>();
            screenCounts = new List<int>();
            if (!IsPostBack)
            {

                btnBackToEquipment.Attributes.Add("onmouseover", "this.src='Theme/images/equip2.gif';");
                btnBackToEquipment.Attributes.Add("onmouseout", "this.src='Theme/images/equip1.gif';");
                btnAddNewService.Attributes.Add("onmouseover", "this.src='Theme/images/add2.gif';");
                btnAddNewService.Attributes.Add("onmouseout", "this.src='Theme/images/add1.gif';");
                btnEmail.Attributes.Add("onmouseover", "this.src='Theme/images/email2.gif';");
                btnEmail.Attributes.Add("onmouseout", "this.src='Theme/images/email1.gif';");
                btnAddNewEquipment.Attributes.Add("onmouseover", "this.src='Theme/images/addEquip2.gif';");
                btnAddNewEquipment.Attributes.Add("onmouseout", "this.src='Theme/images/addEquip1.gif';");
                SetStepDisplay(0);
                rdpServiceDate.SelectedDate = DateTime.Today;
                if (Request.QueryString["EquipmentTypeID"] != null)
                {
                    if (Convert.ToInt32(Request.QueryString["EquipmentTypeID"]) > 0)
                    {
                        EquipmentTypeID = Convert.ToInt32(Request.QueryString["EquipmentTypeID"]);
                    }
                }
                LoadServiceTypes(0);
                if (Request.QueryString["ServiceID"] != null)
                {
                    if (Convert.ToInt32(Request.QueryString["ServiceID"]) > 0)
                    {
                        ServiceID = Convert.ToInt32(Request.QueryString["ServiceID"]);
                        PopulateForm();
                    }
                }
                else if (Request.QueryString["UnitInstanceID"] != null)
                {
                    WizardCaption = "Add New Service";
                    if (Convert.ToInt32(Request.QueryString["UnitInstanceID"]) > 0)
                    {
                        UnitInstanceID = Convert.ToInt32(Request.QueryString["UnitInstanceID"]);
                        vehicle v = new vehicle(CustomerID, UnitInstanceID);
                        EquipmentUnitID = v.GetEquipmentUnitIDByInstanceID(ConnectionString);
                        EquipmentType et = new EquipmentType(v.EquipmentTypeID);
                        et.load();
                        if (et.HoursForMiles)
                        {
                            lblVehicleMilesCaption.Text = lblVehicleMilesCaption.Text.Replace("Vehicle Miles", "Equipment Hours");
                        }
                    }
                }
                if (Request.QueryString["servicetypeid"] != null)
                {
                    if (Convert.ToInt32(Request.QueryString["servicetypeid"]) > 0)
                    {
                        ServiceTypeID = Convert.ToInt32(Request.QueryString["servicetypeid"]);
                    }
                }
                if (ServiceMiles.ToString() == string.Empty)
                {
                    vehicle v = new vehicle();
                    v.ConnectionString = ConnectionString;
                    ServiceMiles = v.getCurrentMiles(UnitInstanceID).ToString();
                }
                pnlCustomService.Style.Value = "display:none;";
                //EnDisableContinueButton(false);
            }
            else
            {
                if (ShowServiceEdit)
                {
                    AmsWebLibrary.Module1.SelectDDLItem(ref ddlServiceType, PreviousServiceTypeID, false, false);
                }
            }
            if (ShowServiceEdit)
            {
                //pnlCustomService.Style.Value = "display:block;";
                mpeCustomService.Show();
            }
            else
            {
                pnlCustomService.Style.Value = "display:none;";
                mpeCustomService.Hide();
            }
            if (hdnUpdateAnchors.Value == "1")
            {
                hdnUpdateAnchors.Value = "0";
                UpdateAnchors();
            }

            rdpNextEmailDate.MinDate = DateTime.Today;
            if ((Session["KilometersMode"] != null) && (Convert.ToBoolean(Session["KilometersMode"].ToString())))
            {
                lblVehicleMilesCaption.Text = lblVehicleMilesCaption.Text.Replace("Miles", "Kilometers");
            }

        }

        void wucServiceProductOtherAmsoil1_ProductSelectedEvent(object sender, ProductSelectedEventArgs e)
        {
            ProductCode = e.ProductCode;
            ProductName = e.ProductName;
            ProductNameRecentlySelected = ProductName;
            hypPurchase.NavigateUrl = e.ProductLink;
        }

        protected void ddlServiceType_SelectedIndexChanged(object sender, EventArgs e)
        {
            int serviceTypeID = Convert.ToInt32(ddlServiceType.SelectedValue);
            if (serviceTypeID == -2)
            {
                divAddCustomService.Visible = true;
                divUpdateCustomService.Visible = false;
                ShowServiceEdit = true;
            }
            else if (serviceTypeID == -3)
            {
                divUpdateCustomService.Visible = true;
                divAddCustomService.Visible = false;
                ShowServiceEdit = true;
            }
            else
            {
                PreviousServiceTypeID = Convert.ToInt32(ddlServiceType.SelectedValue);
            }
            RaiseBubbleEvent(this, new ServiceTypeSelectedEventArgs(serviceTypeID));
        }

        protected void WizardMoveNext(ref object sender, ref WizardNavigationEventArgs e)
        {
            bool bValid = false;
            bool bRepeatStep = false;
            string sAlert = string.Empty;
            if (e.CurrentStepIndex == 0)
            {
                bValid = (ddlServiceType.SelectedIndex > 0) && (ServiceDate.Length > 0);
                if (ddlServiceType.SelectedIndex <= 0)
                {
                    bValid = false;
                    sAlert = "Service type is required";
                }
                else if (ServiceDate.Trim().Length == 0)
                {
                    bValid = false;
                    sAlert = "Service date is required";
                }
                else
                {
                    ServiceTypeID = Convert.ToInt32(ddlServiceType.SelectedItem.Value);
                    trTech.Visible = ((ServiceTypeID < 4) && (ServiceTypeID > 0));
                    MultiProductServiceSelected = GetMultiProductServiceSelected();
                    NoTechContact = GetNoTechContact();
                    ServiceType = ddlServiceType.SelectedItem.Text;
                    ProductIndex = 1;
                    LoadProductTypes();
                    wucServiceProductRadioList21.EquipmentUnitID = EquipmentUnitID;
                    SetStepDisplay(1);
                    SetInputValues();
                    InitInputs();
                    InitProducts();
                    bool bShowTech = ((ServiceTypeID >= 1 && ServiceTypeID <= 3) && EquipmentTypeID == 1);
                    if (bShowTech)
                    {
                        MyGarage.cMaintenanceTechContent mtc = new MyGarage.cMaintenanceTechContent((object)EquipmentUnitID);
                        lblTech.Text = mtc.TechInfo;
                        vehicle vv = new vehicle();
                        lblTechCaption.Text = vv.getCaption(UnitInstanceID);
                        divTechInfo.Visible = (lblTech.Text.Length > 97);
                    }
                    else
                    {
                        divTechInfo.Visible = false;
                    }
                }
            }
            else if (e.CurrentStepIndex == 1)
            {
                RecordProductSource();

                if (ProductSelected || divProductSelection.Visible)
                {
                    sAlert = ValidateProduct();
                    bValid = (sAlert.Length == 0);
                    if (sAlert == "Please enter a valid AMSOIL product code")
                    {
                        sAlert = "";
                        wucServiceProductOtherAmsoil1.ShowHideProductSelection(true);
                    }
                    if (bValid)
                    {
                        SaveProduct();
                        InitInputs();
                        if (ProductIndex < ProductCount)
                        {
                            SaveScreenCount();
                            pnlProductSourceSelection.Visible = true;
                            e.Cancel = true;
                            ProductIndex += 1;
                            SetInputValues();
                            ProductSource = ProductSources[ProductIndex - 1];
                            LoadProductTypes();
                            InitProducts();
                            //setInitialProductSource();
                            SetStepDisplay(1);
                            divProductSelection.Visible = false;
                            bRepeatStep = true;
                        }
                        else
                        {
                            SaveScreenCount();
                            SetStepDisplay(2);
                        }
                    }
                }
                else if (!divProductSelection.Visible)
                {
                    if ((ProductSource == ProductSourceEnum.Recommended) && (wucServiceProductRadioList21.ProductCount == 2) &&
                        (wucServiceProductRadioList21.SelectedIndex == -1))
                    {
                        sAlert = "Please select \"I want to select my own AMSOIL product\" or \"I am not using an AMSOIL product\".";
                        bValid = false;
                    }
                    else
                    {
                        SaveScreenCount();
                        SaveProduct();
                        divProductSelection.Visible = true;
                        pnlProductSourceSelection.Visible = false;
                        SetStepDisplay(2);
                    }
                }
                else
                {
                    pnlProductSourceSelection.Visible = true;
                    divProductSelection.Visible = false;
                    LoadProductTypes();
                    setInitialProductSource();
                    bRepeatStep = true;
                }
            }
            else if (e.CurrentStepIndex == 2)
            {
                SetStepDisplay(3);
                bValid = true;
            }
            e.Cancel = ((!bValid) || bRepeatStep);
            if (e.Cancel)
            {
                ConfigureNextButton();
            }
            if (sAlert.Length > 0)
            {
                RaiseBubbleEvent(this, new ErrorNotificationEventArgs(sAlert));
            }
        }

        protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
        {
            if (!wucServiceProductOtherAmsoil1.Visible) // && (Wizard1.ActiveStepIndex == 1)
            {
                WizardMoveNext(ref sender, ref e);
            }
        }

        protected void RecordProductSource()
        {
            bool selectOtherAmsoilProduct = ((ShowOtherAmsoil) && (wucServiceProductRadioList21.SelectedIndex == wucServiceProductRadioList21.ProductCount - 2));
            bool selectNonAmsoilProduct = (wucServiceProductRadioList21.SelectedIndex == wucServiceProductRadioList21.ProductCount - 1);
            if (selectOtherAmsoilProduct)
            {
                ProductSource = ProductSourceEnum.OtherAmsoil;
            }
            else if (selectNonAmsoilProduct)
            {
                ProductSource = ProductSourceEnum.NonAmsoil;
            }
            else
            {
                ProductSource = ProductSourceEnum.Recommended;
            }
        }

        protected void Wizard1_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
        {
            bool bValid = true;
            bool bRepeatStep = false;
            string sAlert = string.Empty;
            bool reHideProductSelection = false;
            bool reShowProductSelection = false;
            bool onFirstScreenOfProduct = false;

            if (e.CurrentStepIndex == 1)
            {
                bValid = true;
                if (bValid)
                {
                    InitInputs();
                    List<int> sCounts = ScreenCounts;
                    if (sCounts.Count < ProductIndex)
                    {
                        if (!pnlProductSourceSelection.Visible && !wucServiceProductRadioList21.NonAmsoilOnly)
                        {
                            onFirstScreenOfProduct = false;
                        }
                        else
                        {
                            onFirstScreenOfProduct = true;
                        }
                    }
                    else if (sCounts[ProductIndex - 1] == 1)
                    {
                        if (!pnlProductSourceSelection.Visible && !wucServiceProductRadioList21.NonAmsoilOnly)
                        {
                            onFirstScreenOfProduct = false;
                        }
                        else
                        {
                            onFirstScreenOfProduct = true;
                        }
                    }
                    if ((onFirstScreenOfProduct) || (pnlProductSourceSelection.Visible))
                    {
                        // going to previous product
                        ProductIndex -= 1;
                        if (ProductIndex > 0)
                        {
                            bRepeatStep = true;
                            if (ScreenCounts[ProductIndex - 1] == 1)
                            {
                                divProductSelection.Visible = false;
                                reHideProductSelection = true;
                                pnlProductSourceSelection.Visible = true;
                            }
                            else
                            {
                                divProductSelection.Visible = true;
                                reShowProductSelection = true;
                                pnlProductSourceSelection.Visible = false;
                            }
                        }
                    }
                    else if (!ShowOtherAmsoil)
                    {
                        bRepeatStep = false;
                    }
                    else
                    {
                        // staying on this product
                        bRepeatStep = true;
                        divProductSelection.Visible = false;
                        reHideProductSelection = true;
                        pnlProductSourceSelection.Visible = true;
                    }

                    if (bRepeatStep)
                    {
                        LoadProductTypes();
                        ProductSource = ProductSources[ProductIndex - 1];
                        InitProducts();
                        ////setInitialProductSource();
                        SetInputValues();
                        SetStepDisplay(1);
                        if (reHideProductSelection)
                        {
                            divProductSelection.Visible = false;
                            pnlProductSourceSelection.Visible = true;
                        }
                        else if (reShowProductSelection)
                        {
                            divProductSelection.Visible = true;
                            pnlProductSourceSelection.Visible = false;
                        }
                    }

                    else
                    {
                        SetStepDisplay(0);
                    }
                    ConfigureNextButton();
                }
            }
            else if
                ((e.CurrentStepIndex == 2)) // || (e.CurrentStepIndex == 3)
            {
                LoadProductTypes();
                ProductIndex = ProductCount;
                if (ProductTypes.Count > 0)
                {
                    ProductType = ProductTypes[ProductIndex - 1].ProductTypeName;
                }
                InitInputs();
                InitProducts();
                SetInputValues();
                SetStepDisplay(1);
                if (ScreenCounts[ProductIndex - 1] == 1)
                {
                    divProductSelection.Visible = false;
                    pnlProductSourceSelection.Visible = true;
                }
                else
                {
                    divProductSelection.Visible = true;
                    pnlProductSourceSelection.Visible = false;
                }
            }
            else
            {
                SetStepDisplay(e.NextStepIndex);
            }
            e.Cancel = ((!bValid) || bRepeatStep);
            if (sAlert.Length > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alerto", "alert('" + sAlert + "');", true);
            }
        }

        protected void Wizard1_SideBarButtonClick(object sender, WizardNavigationEventArgs e)
        {
            SetStepDisplay(e.NextStepIndex);
        }

        protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            bool bValid = true;
            string sAlert = string.Empty;
            if (chkSendEmailNextChange.Checked && NextEmailDate.Trim().Length == 0)
            {
                bValid = false;
            }
            if (!bValid)
            {
                e.Cancel = true;
                sAlert = "Please select or enter an E-Mail reminder date";
            }
            else
            {
                SaveForm();
                WizardCaption = "Service Recorded";
                StepDisplay = string.Empty;
            }
            if (sAlert.Length > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alerto", "alert('" + sAlert + "');", true);
            }
        }
        protected void SideBarList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
        }

        protected void btnAddNewEquipment_Click(object sender, EventArgs e)
        {
            Response.Redirect("EquipmentAdd.aspx");
        }

        protected void btnAddNewService_Click(object sender, EventArgs e)
        {
            Response.Redirect("ServiceAdd.aspx?EquipmentTypeID=" + EquipmentTypeID.ToString() + "&UnitInstanceID=" + UnitInstanceID.ToString());
        }

        protected void btnBackToEquipment_Click(object sender, EventArgs e)
        {
            Response.Redirect("GarageVehicle.aspx?id=" + UnitInstanceID.ToString());
        }        

        protected void btnEmail_Click(object sender, EventArgs e)
        {
            Response.Redirect("Reminders.aspx?Tab=Reminders&id=" + UnitInstanceID.ToString());
        }

        protected void btnSaveNewCustomService_Click(object sender, EventArgs e)
        {
            if (txtNewCustomService.Text.Length > 0)
            {
                UserDefinedServiceType uds = new UserDefinedServiceType(CustomerID, EquipmentTypeID, ConnectionString);
                uds.ServiceType = txtNewCustomService.Text;
                uds.saveToDB();
                vehicle v = new vehicle();
                v.ConnectionString = ConnectionString;
                v.CustomerID = CustomerID;
                v.UnitInstanceID = UnitInstanceID;
                v.synchronizeReminders();
                grdUpdateServiceTypes.DataBind();
                ddlServiceType.Items.Add(new ListItem(uds.ServiceType, (-1 * uds.ServiceTypeUserDefinedID).ToString()));
                ddlServiceType.SelectedIndex = ddlServiceType.Items.Count - 1;
                ShowServiceEdit = false;
                RaiseBubbleEvent(this, new ServiceTypeSelectedEventArgs(-1 * uds.ServiceTypeUserDefinedID));
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alerto", "alert('Service Type is required');", true);
            }
        }

        protected void btnCancelNewCustomService_Click(object sender, EventArgs e)
        {
            ShowServiceEdit = false;
            RaiseBubbleEvent(this, new ServiceTypeSelectedEventArgs(ServiceTypeID));
        }

        protected void btnSaveUpdateCustomService_Click(object sender, EventArgs e)
        {

            ShowServiceEdit = false;
        }

        protected void grdUpdateServiceTypes_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //// the underlying data item is a DataRowView object.
                DataRowView rowView = (DataRowView)e.Row.DataItem;
                int id = Convert.ToInt32(rowView["ServiceTypeUserDefinedID"].ToString());

                //// Retrieve the state value for the current row.
                //String state = rowView["state"].ToString();

                UserDefinedServiceType udst = new UserDefinedServiceType(Convert.ToInt32(Session["CustomerID"]), EquipmentTypeID, id, ConnectionString, true);
                LinkButton lbt = (LinkButton)e.Row.FindControl("lnkDelete");
                lbt.Enabled = (!udst.hasServices());
            }

        }

        protected void grdUpdateServiceTypes_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Remove")
            {
                UserDefinedServiceType u = new UserDefinedServiceType(CustomerID, EquipmentTypeID, Convert.ToInt32(e.CommandArgument), ConnectionString, true);
                u.delete();
                vehicle v = new vehicle();
                v.ConnectionString = ConnectionString;
                v.CustomerID = CustomerID;
                v.UnitInstanceID = UnitInstanceID;
                v.synchronizeReminders();
                this.grdUpdateServiceTypes.DataBind();
                LoadServiceTypes(PreviousServiceTypeID);
            }
        }

        protected void grdUpdateServiceTypes_RowUpdated(object sender, GridViewUpdatedEventArgs e)
        {
            LoadServiceTypes(PreviousServiceTypeID);
        }

        protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
        {
            ConfigureNextButton();
        }
        #endregion

        #region methods
        protected void SaveScreenCount()
        {
            List<int> scrCounts = ScreenCounts;
            int i = 1;
            if (divProductSelection.Visible)
            {
                i = 2;
            }
            if (scrCounts.Count < ProductIndex)
            {
                scrCounts.Add(i);
            }
            else
            {
                scrCounts[ProductIndex - 1] = i;
            }
            ScreenCounts = scrCounts;
        }
        protected void LoadServiceTypes(int _serviceTypeID)
        {
            string sConn = ConnectionString;
            string sSql = "ServiceTypesSelect " + Convert.ToInt32(CustomerID.ToString()) + ", " + Convert.ToInt32(EquipmentTypeID.ToString());
            AmsWebLibrary.Module1.PopulateDropdown(ref ddlServiceType, sSql, "1", false, "Select Service Type", sConn, true);
            ddlServiceType.Items.Add(new ListItem("Add Custom Service Type", "-2"));
            GarageUser g = new GarageUser(CustomerID);
            bool gotUserDefinedServiceTypes = g.hasUserDefinedServices();
            if (gotUserDefinedServiceTypes)
            {
                ddlServiceType.Items.Add(new ListItem("Edit Custom Service Type", "-3"));
            }
            if (_serviceTypeID != 0)
            {
                AmsWebLibrary.Module1.SelectDDLItem(ref ddlServiceType, _serviceTypeID, false, true);
            }
        }

        public void LoadProductTypes()
        {
            if (ServiceTypeID != 0)
            {
                service s = new service(ServiceTypeID, EquipmentUnitID, ConnectionString);
                ProductTypes = s.ProductTypes;
                ProductCount = ProductTypes.Count;
                if (ProductTypes.Count > 0)
                {
                    ProductType = ProductTypes[ProductIndex - 1].ProductTypeName;
                }
            }
        }

        public void ConfigureNextButton()
        {
            Button btnNext = (Button)Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            btnNext.Attributes.Remove("onmousedown");

            if (wucServiceProductOtherAmsoil1.Visible)
            {
                btnNext.Attributes.Add("onmousedown", "stepNext('" + Wizard1.ClientID + "');");
                btnNext.Attributes.Add("onclick", "return false;");
            }
            else
            {
                btnNext.Attributes.Add("onclick", "return true;");
            }
        }

        public void InitProducts()
        {
            if (ServiceTypeID != 0)
            {
                List<string> pCodes = ProductCodes;
                if ((pCodes.Count > 0) && (pCodes.Count >= ProductIndex))
                {
                    ProductCode = pCodes[ProductIndex - 1];
                }
                else
                {
                    ProductCode = string.Empty;
                }
                wucServiceProductRadioList21.EquipmentUnitID = EquipmentUnitID;
                wucServiceProductRadioList21.ServiceTypeID = ServiceTypeID;
                wucServiceProductRadioList21.ProductTypeID = CurrentProductTypeID;
                wucServiceProductOtherAmsoil1.ProductTypeID = CurrentProductTypeID;
                wucServiceProductRadioList21.RecentlySelectedLabelID = lblSelected.ClientID;
                wucServiceProductRadioList21.PurchaseLinkID = hypPurchase.ClientID;
                pnlProductSourceSelection.Visible = true;
                wucServiceProductRadioList21.ShowOtherAmsoil = ShowOtherAmsoil;
                wucServiceProductRadioList21.LoadProductList();
                HtmlGenericControl div = (HtmlGenericControl)pnlProductSourceSelection.FindControl("divGotProducts");
                div.Visible = (wucServiceProductRadioList21.ProductCount > (ShowOtherAmsoil ? 2 : 1));
                divNoTechContact.Visible = ((wucServiceProductRadioList21.ProductCount == (ShowOtherAmsoil ? 2 : 1)) && (!NoTechContact));
                wucServiceProductRadioList21.ProductCode = ProductCode;
                if ((ProductCode.Length == 0))
                {
                    List<string> pNames = ProductNames;
                    if ((pNames.Count > 0) && (pNames.Count >= ProductIndex))
                    {
                        ProductName = pNames[ProductIndex - 1];
                    }
                    else
                    {
                        ProductName = string.Empty;
                    }
                }
                if (wucServiceProductRadioList21.NonAmsoilOnly)
                {
                    wucServiceProductRadioList21.SelectedIndex = 0;
                    pnlProductSourceSelection.Visible = false;
                    divProductSelection.Visible = true;
                    wucServiceProductOtherAmsoil1.Visible = false;
                }
                else
                {
                    divProductSelection.Visible = false;
                    if (((wucServiceProductRadioList21.SelectedIndex == -1) && (wucServiceProductRadioList21.ProductCount > (ShowOtherAmsoil ? 2 : 1)) &&
                        (ProductCode.Length == 0) && (ProductName.Length == 0) && (ProductSource != ProductSourceEnum.NonAmsoil) && (ProductSource != ProductSourceEnum.OtherAmsoil)))
                    {
                        wucServiceProductRadioList21.SelectedIndex = 0;
                        ProductSource = ProductSourceEnum.Recommended;
                    }
                    else if ((wucServiceProductRadioList21.SelectedIndex != -1) &&
                        (wucServiceProductRadioList21.SelectedIndex < (wucServiceProductRadioList21.ProductCount - (ShowOtherAmsoil ? 2 : 1))))
                    {
                        ProductSource = ProductSourceEnum.Recommended;
                    }
                    else if (ProductCode.Length > 0 || ProductSource == ProductSourceEnum.OtherAmsoil)
                    {
                        wucServiceProductOtherAmsoil1.ProductCode = ProductCode;
                        ProductSource = ProductSourceEnum.OtherAmsoil;
                    }
                    else if (ProductName.Length > 0 || ProductSource == ProductSourceEnum.NonAmsoil)
                    {
                        ProductSource = ProductSourceEnum.NonAmsoil;
                    }
                }
            }
            else
            {
                wucServiceProductRadioList21.Visible = false;
            }
        }

        public void UpdateAnchors()
        {
            if (ServiceTypeID > 0)
            {
                if (MultiProductServiceSelected)
                {
                }
                else
                {
                    wucServiceProductOtherAmsoil1.SetOtherAmsoilProductNameAndAnchor(hdnProductCodeReturned.Value);
                }
            }
            else
            {
                wucServiceProductRadioList21.Visible = false;
            }
        }

        public void SaveForm()
        {
            service s = new service(ServiceID, ConnectionString);
            MultiProductServiceSelected = (ProductCount > 0);
            s.ProductCodes = ProductCodes;
            s.ProductNames = ProductNames;
            s.Cost = cStatic.ValC(ServiceCost);
            s.ServiceDate = ServiceDate;
            s.VehicleUsage = (int)cStatic.ValC(ServiceMiles);
            s.ServiceTypeID = ServiceTypeID;
            s.EquipmentUnitInstanceID = UnitInstanceID;
            s.Details = Details;
            s.SendEmail = chkSendEmailNextChange.Checked;
            s.NextEmailDate = NextEmailDate;
            LoadProductTypes();
            s.ProductTypes = ProductTypes;
            if (s.saveToDB() && (ServiceID == 0))
            {
                ServiceID = s.ServiceID;
            }
            //OnServiceUpdateEvent(System.EventArgs.Empty);
        }
        public bool GetMultiProductServiceSelected()
        {
            int lServiceTypeID = ServiceTypeID;
            bool IsMultiProduct = false;
            if (lServiceTypeID > 0)
            {
                ServiceType st = new ServiceType(lServiceTypeID, ConnectionString);
                IsMultiProduct = st.IsMultiProduct();
                return IsMultiProduct;
            }
            else
            {
                return false;
            }
        }
        public bool GetNoTechContact()
        {
            int lServiceTypeID = ServiceTypeID;
            if (lServiceTypeID > 0)
            {
                ServiceType st = new ServiceType(lServiceTypeID, ConnectionString);
                bool ntc = st.NoTechContact();
                return ntc;
            }
            else
            {
                return false;
            }
        }
        private void showProductSelectionHelp(int _nextStepIndex)
        {
            if (_nextStepIndex == 1)
            {
                divDefaultInstructions.Visible = true;
                divOtherAMSOILInstructions.Visible = false;
                divOtherInstructions.Visible = false;
            }
            else if (wucServiceProductOtherAmsoil1.Visible)
            {
                divDefaultInstructions.Visible = false;
                divOtherAMSOILInstructions.Visible = true;
                divOtherInstructions.Visible = false;
            }
            else
            {
                divDefaultInstructions.Visible = false;
                divOtherAMSOILInstructions.Visible = false;
                divOtherInstructions.Visible = true;
            }
        }
        private void SetStepDisplay(int _nextStepIndex)
        {
            if (_nextStepIndex == 0)
            {
                StepDisplay = "Step 1";
                ddlServiceType.Focus();
            }
            else if (_nextStepIndex == 1)
            {
                StepDisplay = "Step " + (1 + ProductIndex).ToString() + " of " + (3 + ProductCount).ToString();
                showProductSelectionHelp(_nextStepIndex);
            }
            else if (_nextStepIndex == 2)
            {
                StepDisplay = "Step " + (2 + ProductCount).ToString() + " of " + (3 + ProductCount).ToString();
                showProductSelectionHelp(_nextStepIndex);
                txtDetails.Focus();
                //txtServiceCost.Focus();
            }
            else if (_nextStepIndex == 3)
            {
                StepDisplay = "Step " + (3 + ProductCount).ToString() + " of " + (3 + ProductCount).ToString();
                chkSendEmailNextChange.Focus();
            }
            else if (_nextStepIndex == 4)
            {
                StepDisplay = string.Empty;
            }
        }

        private void PopulateForm()
        {
            service srv = new service(ServiceID, ConnectionString);

            EquipmentUnit eu = new EquipmentUnit();
            eu.EquipmentUnitID = srv.EquipmentUnitID;
            EquipmentTypeID = srv.EquipmentTypeID;
            LoadServiceTypes(EquipmentTypeID);

            AmsWebLibrary.Module1.SelectDDLItem(ref ddlServiceType, srv.ServiceTypeID, false, true);
            if (srv.Cost > 0)
            {
                ServiceCost = srv.Cost.ToString();
            }
            ServiceDate = srv.ServiceDate;
            ServiceMiles = srv.VehicleUsage.ToString();
            UnitInstanceID = srv.EquipmentUnitInstanceID;
            EquipmentUnitID = srv.EquipmentUnitID;
            Details = srv.Details;
            chkSendEmailNextChange.Checked = srv.SendEmail;
            NextEmailDate = srv.NextEmailDate;
            ProductCodes = srv.ProductCodes;
            ProductNames = srv.ProductNames;
            InfoLink = srv.getInfoLink();
            if (ServiceID == 0)
            {
                WizardCaption = "Add New Service";
            }
            else
            {
                WizardCaption = "Edit Service";
            }

            if (Request.QueryString["Dup"] != null)
            {
                if (Convert.ToInt32(Request.QueryString["Dup"]) > 0)
                {
                    ServiceID = 0;
                    WizardCaption = "Repeat Service";
                }
            }

            List<ProductSourceEnum> pSources = new List<ProductSourceEnum>();
            List<int> scrCounts = new List<int>();
            while (pSources.Count < ProductCodes.Count)
            {
                pSources.Add(ProductSourceEnum.Recommended);
                scrCounts.Add(1);
            }
            ProductSources = pSources;
            ScreenCounts = scrCounts;
            EquipmentType et = new EquipmentType(EquipmentTypeID);
            et.load();
            if (et.HoursForMiles)
            {
                lblVehicleMilesCaption.Text = lblVehicleMilesCaption.Text.Replace("Vehicle Miles", "Equipment Hours");
            }   
        }


        private string ValidateProduct()
        {
            bool bValid = false;
            string sAlert = string.Empty;
            LoadProductTypes();
            if (ProductSource == ProductSourceEnum.Recommended)
            {
                bValid = (wucServiceProductRadioList21.SelectedIndex > -1);
                if (!bValid)
                {
                    sAlert = "Please select a recommended AMSOIL product";
                }
            }
            else if (ProductSource == ProductSourceEnum.OtherAmsoil)
            {                

                bValid = (wucServiceProductOtherAmsoil1.ProductCode.Length > 2);
                if (!bValid)
                {
                    sAlert = "Please select an AMSOIL product. Enter at least 3 characters.";
                }
                else
                {
                    product p = new product();
                    p.ConnectionString = ConnectionString;
                    bValid = p.validCode(wucServiceProductOtherAmsoil1.ProductCode);
                    if (!bValid)
                    {
                        sAlert = "Please enter a valid AMSOIL product code";
                    }
                }
            }
            else if (ProductSource == ProductSourceEnum.NonAmsoil)
            {
                bValid = true;
            }
            return sAlert;
        }

        private void SaveProduct()
        {
            List<string> pCodes = ProductCodes;
            while (pCodes.Count < ProductIndex)
            {
                pCodes.Add(string.Empty);
            }
            pCodes[ProductIndex - 1] = ProductCodeSelected;
            if (ProductCodeSelected.Length == 0)
            {
                // hack to get empty string into list member
                pCodes[ProductIndex - 1] = "hello";
                pCodes[ProductIndex - 1] = string.Empty;
            }
            else
                if (ProductCodeSelected.Length == 0)
                {
                    // hack
                    pCodes[ProductIndex - 1] = "hello";
                    pCodes[ProductIndex - 1] = ProductCodeSelected;
                }
            ProductCodes = pCodes;

            List<string> pNames = ProductNames;
            while (pNames.Count < ProductIndex)
            {
                pNames.Add(string.Empty);
            }
            pNames[ProductIndex - 1] = ProductNameSelected;
            if (ProductNameSelected.Length == 0)
            {
                // hack to get empty string into list member
                pNames[ProductIndex - 1] = "hello";
                pNames[ProductIndex - 1] = string.Empty;
            }
            else
            {
                // hack
                pNames[ProductIndex - 1] = "hello";
                pNames[ProductIndex - 1] = ProductNameSelected;
            }
            ProductNames = pNames;
            List<ProductSourceEnum> pSources = ProductSources;
            while (pSources.Count < ProductIndex)
            {
                pSources.Add(ProductSourceEnum.Recommended);
            }
            pSources[ProductIndex - 1] = ProductSource;
            ProductSources = pSources;

        }

        private void InitInputs()
        {
            wucServiceProductRadioList21.ProductCode = string.Empty;
            wucServiceProductOtherAmsoil1.ProductCode = string.Empty;
            wucServiceProductOtherAmsoil1.ProductName = string.Empty;
            wucServiceProductNonAmsoil1.ProductName = string.Empty;
            ProductCode = string.Empty;
            ProductName = string.Empty;
        }

        protected void setInitialProductSource()
        {
            if (wucServiceProductRadioList21.SelectedIndex > -1 ||
                ((wucServiceProductRadioList21.ProductCount > 0) && ServiceID == 0 && ProductCode.Length == 0 && ProductName.Length == 0))
            {
                ProductSource = ProductSourceEnum.Recommended;
            }
            else if ((ProductCode.Length > 0) || (((wucServiceProductRadioList21.ProductCount == 0)) && ServiceID == 0))
            {
                ProductSource = ProductSourceEnum.OtherAmsoil;
                if (productCode.Length > 0)
                {
                    wucServiceProductOtherAmsoil1.ProductCode = ProductCode;
                }
            }
            else if (ProductName.Length > 0)
            {
                ProductSource = ProductSourceEnum.NonAmsoil;
                if (ProductName.Length > 0)
                {
                    wucServiceProductNonAmsoil1.ProductName = ProductName;
                }
            }
            ProductNameRecentlySelected = ProductNameRecentlySelected;
            hypPurchase.NavigateUrl = wucServiceProductRadioList21.PurchaseLink;
        }

        private void SetInputValues()
        {

            List<ProductSourceEnum> pSources = ProductSources;
            while (pSources.Count < ProductIndex)
            {
                pSources.Add(ProductSourceEnum.Recommended);
            }
            ProductSource = pSources[ProductIndex - 1];
            ProductSources = pSources;

            List<string> pCodes = ProductCodes;
            while (pCodes.Count < ProductIndex)
            {
                pCodes.Add(string.Empty);
            }
            ProductCode = pCodes[ProductIndex - 1];
            ProductCodes = pCodes;

            List<string> pNames = ProductNames;
            while (pNames.Count < ProductIndex)
            {
                pNames.Add(string.Empty);
            }
            ProductName = pNames[ProductIndex - 1];
            ProductNames = pNames;
        }

        #endregion

    }
}

Thank you for taking a look at it.
Mark


Pavel
Telerik team
 answered on 22 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?