Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi
I have listed some things from a database in a datalist with a link tag. Look like this on front page.

ID= 21 something click me

C#
<HeaderTemplate>
                 <p class="overskrift_bestil">Ekstra varer</p>
             </HeaderTemplate>

             <ItemTemplate>

                   <td><asp:TextBox ID="TextBox_deli" runat="server" Width="15" Height="15"></asp:TextBox></td>
                   <td><p><%#Eval("deli_navn") %></p></td>
                  <td>
                    <a href="#contactFormContainer" id="showdialog2">Show the Dialog</a>


                  </td>

            </ItemTemplate>
         </asp:DataList>


When I click the click me link I want the popup box to show all the information on the product on ID=21. I know that I have to load some querystring when I click the html link, but I am stuck. This is what I have now:

JavaScript
$(document).ready(function () {

          $('#contactFormContainer').hide();

          $('#showdialog2').click(function () {
              $("#contactFormContainer").load("bekraeft.aspx?deli_id=deli_id");
              $("#contactFormContainer").fadeToggle('slow');
          });
      });

    </script>


Hope someone could help me

/Tina
Posted

1 solution

Here is a very simple implementation of what you need - You will have to improvise this to your needs. The main objective is to give you an idea! I have added comments inline!

http://jsfiddle.net/FNt5N/2/[^]

In this method I have used jQuery and jQuery UI. There are no validations or any silver linings, since that would be a good learning exercise for you!

Missed some inputs for the 2nd part of your question! In the click event you could use the id to issue an ajax request by providing the id and then load the result! Check out:

$.ajax[^]

similar question[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900