I am relatively new to MSVS and am stuck on event wiring. I have a web
application and the screen contains a DataList. Inside the template, I
am
creating either a button or just text, depending on the data for that
cell.
The HTML looks like:
<DIV style="DISPLAY: inline; Z-INDEX: 101; LEFT: 8px; OVERFLOW: auto;
WIDTH:
904px; POSITION: absolute; TOP: 112px; HEIGHT: 288px"
ms_positioning="FlowLayout">
<table id="DataList1" cellspacing="0" rules="all" bordercolor="Black"
border="3"
style="border-color:Black;border-width:3px;border-style:solid;height:159
px;width:888px;border-collapse:collapse;">
<tr>
<td style="background-color:Transparent;">
<table width="100%">
<tr>
<td>
</td>
<td align="center">
<button style="WIDTH: 100px; COLOR: black; HEIGHT: 20px;
BACKGROUND-COLOR:
yellow" id="Course_Button1" onfiltered="Course_Button_Click"
runat="server"><strong> MD005 </strong> </button></td>
..
..
..
The <button is something that is not visible at compile time since it is
returned as a string by a function within a script on the page. When I
click
on the button, it says that Course_Button_Click is not defined although
I
have it in the code-behind. If I just drop a button on the page with
Course_Button_Click as the click event handler, it works. What do I have
to
do to connect Course_Button1 with Course_Button_Click? I tried:
this.Course_Button1.Click += new
System.EventHandler(this.Course_Button_Click);
in the InitializeComponent but it says that Course_Button1 is not set to
an
instance of an object.
Thanks in advance.
Google Jenny
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!