T
Tebogo Tefo via .NET 247
Hi
I have a user control that contains three dropdownlists that I populate according to
what was selected in the other dropdownlist (i.e. populate dropdownlist2 after selecting a
value in dropdownlist1)
The App works fine if I don't add the user control that I created
and all events on the page work and thus the App is perfect.
But as soon as I add my user control (Here used as the TopNav for my page) all
events on the page for all controls don't fire.
I have check that the events are wired up correctly and that the AutoPostBack is
set to true for the dropdownlists
following is the html for the user control that I add to the page
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TopNav.ascx.cs" Inherits="Chevrolet.Navigation.TopNav" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<map name="chev_logo">
<area shape="RECT" target="_new" coords="0,0,180,120" href="http://www.chevrolet.co.za">
</map>
<script>
function itemChange()
{
<!--
/* if(document.chevsites.site.value != "")
{
document.location = document.chevsites.site.value;
}*/
if(document.all.site.value != "")
{
document.location = document.all.site.value;
}
//-->
}
</script>
<table cellSpacing="0" cellPadding="0">
<TBODY>
<tr>
<td style="FONT-SIZE: 0px"><IMG height="0" src="Images/Chevrolet/spacer.gif" width="0">
</td>
<td style="FONT-SIZE: 0px"><IMG height="0" src="Images/Chevrolet/spacer.gif" width="0">
</td>
</tr>
<tr>
<td style="FONT-SIZE: 0px" colSpan="2"><asp:Image id="imgMainTop" Runat="server"></asp:Image></td>
</tr>
<tr>
<td style="FONT-SIZE: 0px"><asp:Image id="imgMainLeft" Runat="server"></asp:Image></td>
<td style="FONT-SIZE: 0px"><asp:Image id="imgBanner" Runat="server"></asp:Image></td>
</tr>
<tr>
<td style="FONT-SIZE: 0px" colSpan="2" valign="top"><IMG height="19" src="Images/Chevrolet/spacer.gif" width="0">
</td>
</tr>
</TBODY>
</table>
<div style="LEFT: 210px; POSITION: absolute; TOP: 35px">
<table cellSpacing="0" cellPadding="0" border="0" width="102%">
<tr>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="3">
</td>
<td style="FONT-SIZE: 0px"><a class="aBlack" href="dealer_locator.jhtml">Your Nearest
Dealer</a>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><a class="aBlack" href="http://www.gmsa.com/finance.jhtml">Finance</a>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><A class="aBlack" href="onlinebooking.jhtml">On Line Booking</A>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><A class="aBlack" href="wallpaper.jhtml">Multi-Media</A>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><a class="aBlack" href="http://www.chevrolet.com" target="_new">International
Links</a>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<form name="chevsites">
<td align="right" width="0"><select style="FONT-SIZE: 9px; FONT-FAMILY: arial" onchange="itemChange()" name="site">
<option selected>Models</option>
<option value="http://www.chevrolet.co.za/sparkHome.jhtml">Spark</option>
<option value="http://www.chevrolet.co.za/aveoHatchHome.jhtml">Aveo Hatch</option>
<option value="http://www.chevrolet.co.za/aveoNotchHome.jhtml">Aveo Sedan</option>
<option value="http://www.chevrolet.co.za/optraHome.jhtml">Optra</option>
<option value="http://www.chevrolet.co.za/vivantHome.jhtml">Vivant</option>
<option value="http://www.chevrolet.co.za/luminaHome.jhtml">Lumina</option>
<option value="http://www.chevrolet.co.za/luminaUteHome.jhtml">Lumina UTE</option>
</select>
</td>
</form>
</tr>
</table>
</div>
Can tell what I am doing wrong in my usercontrol
Thanks in advance
Tabzz
I have a user control that contains three dropdownlists that I populate according to
what was selected in the other dropdownlist (i.e. populate dropdownlist2 after selecting a
value in dropdownlist1)
The App works fine if I don't add the user control that I created
and all events on the page work and thus the App is perfect.
But as soon as I add my user control (Here used as the TopNav for my page) all
events on the page for all controls don't fire.
I have check that the events are wired up correctly and that the AutoPostBack is
set to true for the dropdownlists
following is the html for the user control that I add to the page
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TopNav.ascx.cs" Inherits="Chevrolet.Navigation.TopNav" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<map name="chev_logo">
<area shape="RECT" target="_new" coords="0,0,180,120" href="http://www.chevrolet.co.za">
</map>
<script>
function itemChange()
{
<!--
/* if(document.chevsites.site.value != "")
{
document.location = document.chevsites.site.value;
}*/
if(document.all.site.value != "")
{
document.location = document.all.site.value;
}
//-->
}
</script>
<table cellSpacing="0" cellPadding="0">
<TBODY>
<tr>
<td style="FONT-SIZE: 0px"><IMG height="0" src="Images/Chevrolet/spacer.gif" width="0">
</td>
<td style="FONT-SIZE: 0px"><IMG height="0" src="Images/Chevrolet/spacer.gif" width="0">
</td>
</tr>
<tr>
<td style="FONT-SIZE: 0px" colSpan="2"><asp:Image id="imgMainTop" Runat="server"></asp:Image></td>
</tr>
<tr>
<td style="FONT-SIZE: 0px"><asp:Image id="imgMainLeft" Runat="server"></asp:Image></td>
<td style="FONT-SIZE: 0px"><asp:Image id="imgBanner" Runat="server"></asp:Image></td>
</tr>
<tr>
<td style="FONT-SIZE: 0px" colSpan="2" valign="top"><IMG height="19" src="Images/Chevrolet/spacer.gif" width="0">
</td>
</tr>
</TBODY>
</table>
<div style="LEFT: 210px; POSITION: absolute; TOP: 35px">
<table cellSpacing="0" cellPadding="0" border="0" width="102%">
<tr>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="3">
</td>
<td style="FONT-SIZE: 0px"><a class="aBlack" href="dealer_locator.jhtml">Your Nearest
Dealer</a>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><a class="aBlack" href="http://www.gmsa.com/finance.jhtml">Finance</a>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><A class="aBlack" href="onlinebooking.jhtml">On Line Booking</A>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><A class="aBlack" href="wallpaper.jhtml">Multi-Media</A>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><IMG src="Images/Chevrolet/brown_dot.jpg">
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<td style="FONT-SIZE: 0px"><a class="aBlack" href="http://www.chevrolet.com" target="_new">International
Links</a>
</td>
<td style="FONT-SIZE: 0px"><IMG height="23" src="Images/Chevrolet/spacer.gif" width="5">
</td>
<form name="chevsites">
<td align="right" width="0"><select style="FONT-SIZE: 9px; FONT-FAMILY: arial" onchange="itemChange()" name="site">
<option selected>Models</option>
<option value="http://www.chevrolet.co.za/sparkHome.jhtml">Spark</option>
<option value="http://www.chevrolet.co.za/aveoHatchHome.jhtml">Aveo Hatch</option>
<option value="http://www.chevrolet.co.za/aveoNotchHome.jhtml">Aveo Sedan</option>
<option value="http://www.chevrolet.co.za/optraHome.jhtml">Optra</option>
<option value="http://www.chevrolet.co.za/vivantHome.jhtml">Vivant</option>
<option value="http://www.chevrolet.co.za/luminaHome.jhtml">Lumina</option>
<option value="http://www.chevrolet.co.za/luminaUteHome.jhtml">Lumina UTE</option>
</select>
</td>
</form>
</tr>
</table>
</div>
Can tell what I am doing wrong in my usercontrol
Thanks in advance
Tabzz