Event Wiring

Discussion in 'Microsoft Dot NET' started by Google Jenny, Sep 24, 2004.

  1. Google Jenny

    Google Jenny Guest

    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!
     
    Google Jenny, Sep 24, 2004
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott M

    Assembly metadata and event wiring.

    Scott M, Aug 29, 2003, in forum: Microsoft Dot NET
    Replies:
    1
    Views:
    162
    Scott Meddows
    Aug 29, 2003
  2. Guest
    Replies:
    0
    Views:
    231
    Guest
    Jun 17, 2004
  3. Serge Shimanovsky
    Replies:
    1
    Views:
    564
    Joshua Flanagan
    Apr 14, 2005
  4. Serge Shimanovsky
    Replies:
    0
    Views:
    394
    Serge Shimanovsky
    Jan 11, 2005
  5. dbuchanan
    Replies:
    12
    Views:
    575
Loading...

Share This Page