473,471 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

passing values between a form and modal form

1 New Member
Hello I'm creating a report, I want to display information about a single person in a modal form based the populated datagridview. I'm using jquery to show the modal form, but I'm having problems display the specific information based on the primary key. This is what I have done so far

Expand|Select|Wrap|Line Numbers
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head runat="server">
  3.     <link href="Styles/ModalPopup.css" rel="stylesheet" type="text/css" />
  4.     <link href="Styles/Site.css" rel="stylesheet" type="text/css" /> 
  5.     <script src="Scripts/jquery-1.7.1.js" type="text/javascript"></script>
  6.     <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
  7.     <script type="text/javascript">
  8.           $(document).ready(function () {
  9.               //select all the a tag with name equal to modal
  10.               $('a[name=modal]').click(function (e) {
  11.                   //Cancel the link behavior
  12.                   e.preventDefault();
  13.  
  14.                   //Get the A tag
  15.                   var id = $(this).attr('href');
  16.  
  17.                   //Get the screen height and width
  18.                   var maskHeight = $(document).height();
  19.                   var maskWidth = $(window).width();
  20.  
  21.                   //Set heigth and width to mask to fill up the whole screen
  22.                   $('#mask').css({ 'width': maskWidth, 'height': maskHeight });
  23.  
  24.                   //transition effect    
  25.                   //$('#mask').fadeIn(1000);    
  26.                   $('#mask').fadeIn(500);
  27.                   $('#mask').fadeTo("slow", 0.7);
  28.  
  29.                   //Get the window height and width
  30.                   var winH = $(window).height();
  31.                   var winW = $(window).width();
  32.  
  33.                   //Set the popup window to center
  34.                   $(id).css('top', winH / 2 - $(id).height() / 2);
  35.                   $(id).css('left', winW / 2 - $(id).width() / 2);
  36.  
  37.                   //transition effect
  38.                   $(id).fadeIn(500);
  39.  
  40.               });
  41.  
  42.               //if close button is clicked
  43.               $('.window .close').click(function (e) {
  44.                   //Cancel the link behavior
  45.                   e.preventDefault();
  46.  
  47.                   $('#mask').hide();
  48.                   $('.window').hide();
  49.               });
  50.  
  51.               //if mask is clicked
  52.               $('#mask').click(function () {
  53.                   $(this).hide();
  54.                   $('.window').hide();
  55.               });
  56.           });
  57.       </script>
  58.  <title></title>
  59. </head>
  60. <body>
  61.     <form id="form1" runat="server">
  62.        <div id="header">        
  63.             <div id="headerText">
  64.                 <asp:Label ID="Label1" runat="server" EnableViewState="False" 
  65.                     Font-Names="Segoe UI" Font-Size="16pt" Text="REPORTS"></asp:Label>
  66.                 <br />
  67.             </div>
  68.      </div>
  69.      <div id="body">
  70.         <div id="bodySearchParam">
  71.  
  72.         </div>
  73.         <div id="bodyDisplaySearch">
  74.             <asp:GridView ID="ReportGridView" runat="server" AllowPaging="True" 
  75.                 BorderStyle="Groove" BorderWidth="1px" 
  76.                 CellPadding="4" EmptyDataText="No records defined!!" ForeColor="#333333" 
  77.                 Height="374px" onpageindexchanging="ReportGridView_PageIndexChanging" 
  78.                 onrowcommand="ReportGridView_RowCommand" 
  79.                 onrowdatabound="ReportGridView_RowDataBound" PageSize="11" Width="790px" 
  80.                 AutoGenerateColumns="False" ShowHeaderWhenEmpty="True">
  81.                 <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
  82.                 <Columns>
  83.                     <asp:TemplateField HeaderText="Select">
  84.                         <ItemTemplate> 
  85.                                    <a href="#modalChild" name="modal"">View Report</a>
  86.                         </ItemTemplate>
  87.                         <ItemStyle HorizontalAlign="Left" Width="80px" />
  88.                     </asp:TemplateField>
  89.                     <asp:BoundField HeaderText="Session ID" DataField="session_id"
  90.                         SortExpression="session_id" />
  91.                     <asp:BoundField HeaderText="Account No" DataField="card_no"
  92.                         SortExpression="acc_no" />
  93.                 <asp:BoundField HeaderText="Amount" DataField="amount" 
  94.                         SortExpression="amount" />
  95.                     <asp:BoundField HeaderText="Time Req." DataField="time_req" 
  96.                         SortExpression="time_req" />
  97.                     <asp:BoundField HeaderText="IP Address" DataField="name"
  98.                         SortExpression="ip_add" />
  99.                 </Columns>
  100.                 <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  101.                 <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
  102.                     Font-Names="Segoe UI" HorizontalAlign="Left" Height="30px" />
  103.                 <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
  104.                 <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Left" 
  105.                     Height="30px" />
  106.                 <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
  107.                 <SortedAscendingCellStyle BackColor="#E9E7E2" />
  108.                 <SortedAscendingHeaderStyle BackColor="#506C8C" />
  109.                 <SortedDescendingCellStyle BackColor="#FFFDF8" />
  110.                 <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
  111.             </asp:GridView>
  112.        </div>         
  113.          <div id="modalForm">
  114.              <div id="modalChild" class="window">
  115.                   <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
  116.                  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  117.                  <br />
  118.                  <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
  119.                  <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
  120.                  <br />
  121. <asp:Button ID="Button1" runat="server" Text="Button" />
  122.                 <asp:Button ID="Button2" runat="server" Text="Button" />
  123.               </asp:Panel> 
  124.  
  125.  
  126.              </div>
  127.              <div id="mask"></div>
  128.         </div>
  129.      <div id="footer"></div>
  130.     </form>
  131. </body>
  132. </html>
  133.  
  134.  
Feb 4 '12 #1
0 1375

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: DanC | last post by:
This is the situation. In the firts form a selection is done. After submit a second form is called. In that form there must be select from a list that is depending on the result of the first...
6
by: Mark Goldin | last post by:
I have main aspx page with a button that will show a modal dialog in the Browser when a user clicks on the button. On the modal form the user will do some selections. The he will submit his...
2
by: frixx net via .NET 247 | last post by:
I want to know if anybody here knows how to pass values from a child form to an object in parent mdi form. -------------------------------- From: frixx net ----------------------- Posted by a...
2
by: eight02645999 | last post by:
hi i have 3 python cgi scripts created, one is a login page(login.py), another is the main page(main.py) with a lot of user inputs and the last one is a python cgi script results.py to process...
1
by: prasathas | last post by:
HI GUYS... i displayed three forms in a single page .. one form with dropdown list box ...and in another form if i select the value in drop down list box and submit it then i want to show the...
5
vanc
by: vanc | last post by:
I read many articles about this problem, but I found out that to pass values between one created form and one is not yet is created is fairly simple, it can be done by assign value to public variable...
3
by: urcutesweety | last post by:
Hi, I have 2 frames(top n bottom) each has one web form. Now I want to show any error message that occur in the top frame to be displayed in the bottom frame. I dont want to be redirected to...
0
by: deedeem | last post by:
I have a form with a subform called MMS Update. I have a button that brings up another form to add a new record. I then have a button on the add form to go back to the MMS Update form. I have tried...
1
by: jiaudheen | last post by:
hi i have a multiline textbox and a button in parent form. in the child form i have text boxes,comboboxes,button. the thing is i click the button in the parent form ,the child form opens. i fill the...
3
by: vidhyapriya | last post by:
Hi all I am developing windows application using vb.net.I want to pass values to open form.I am opening only one form when user click the buttons several times.Useing delegate i am passing...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.