User Control causes events on page not to fire

  • Thread starter Tebogo Tefo via .NET 247
  • Start date
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
 
G

Guest

You have the auto events wire up turned off. This means either

a) you have to turn it on
b) you have to add delegates for the events you wish to bubble up.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top