passing arguments to popup window

Last post 05-26-2009 9:26 PM by Lance Zhang - MSFT. 1 replies.

Sort Posts:

  • passing arguments to popup window

    05-21-2009, 4:22 AM
    • Member
      point Member
    • Mohan1
    • Member since 04-30-2009, 7:50 AM
    • Posts 3

    hi friends

    i am new to asp.net

    i am using bulkeditgridview

    problem is :  the gridview is in updatepanel and in a cell of gridview i am using a linkbutton alongwith textbox my requirement is when user clicks on linkbutton it pops up a dialog box where i am updating a few values in database so i need to pass three values to popup window which will be used as key  and finally i need to refresh the gridview in the parent window i as adding ab attribute to linkbutton in rowbound event

    code is as follows:

    any help would highly be appreciated

     

    <PNCL:BulkEditGridView id="GV" runat="server" Height="88px" Width="912px" BackColor="White" BorderColor="#006699" DataSourceID="ObjectDataSource1" DataKeyNames="EMP_ID" CellPadding="3" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="4px" saveButtonID="SaveButton" AllowSorting="True" OnSelectedIndexChanged = "GV_SelectedIndexChanged">

    <RowStyle ForeColor="#000066"></RowStyle>

    <Columns>

    <asp:BoundField DataField="EMP_ID" HeaderText="EmpID" ReadOnly="True"></asp:BoundField>

    <asp:BoundField DataField="EMP_NAME" HeaderText="Employee Name" ReadOnly="True"></asp:BoundField>

    <asp:BoundField DataField="BASIC_SAL" HeaderText="Basic" ReadOnly="True"></asp:BoundField>

    <asp:TemplateField HeaderText="Allowances">

    <EditItemTemplate>

    <asp:TextBox runat="server" Text='<%# Bind("ALLOWANCES_DESCRIPTION") %>' id="TextBox1"></asp:TextBox>

    <asp:LinkButton runat ="server" Text="^" id="lbtnMore" width = "15px" forecolor="Blue" CommandName="Select" />

    </EditItemTemplate>

    <ItemTemplate>

    <asp:Label runat="server" Text='<%# Bind("ALLOWANCES_DESCRIPTION") %>' id="Label11"></asp:Label>

    </ItemTemplate>

    <ItemStyle Width="110px"></ItemStyle>

    </asp:TemplateField>

    <asp:BoundField DataField="ALLOWANCES_AMOUNT" HeaderText="Amount"></asp:BoundField>

    <asp:BoundField DataField="INCOME_TAX" HeaderText="Income Tax"></asp:BoundField>

    <asp:BoundField DataField="EPF" HeaderText="EPF"></asp:BoundField>

    <asp:BoundField DataField="OTHER_DEDUCTIONS_DESCRIPTION" HeaderText="Other Deductions"></asp:BoundField>

    <asp:BoundField DataField="OTHER_DEDUCTIONS_AMOUNT" HeaderText="Amount"></asp:BoundField>

    <asp:BoundField DataField="NET_SAL" HeaderText="Net Salary"></asp:BoundField>

    <asp:BoundField DataField="APPROVAL_STATUS" HeaderText="Approval Status" ReadOnly="True"></asp:BoundField>

    <asp:BoundField DataField="PAYSLIP_MONTH" HeaderText="Month" ReadOnly="True"></asp:BoundField>

    <asp:BoundField DataField="PAYSLIP_YEAR" HeaderText="Year" ReadOnly="True"></asp:BoundField>

    </Columns>

    <FooterStyle BackColor="White" ForeColor="#000066"></FooterStyle>

    <PagerStyle HorizontalAlign="Left" BackColor="White" ForeColor="#000066"></PagerStyle>

    <EmptyDataTemplate>

    </EmptyDataTemplate>

    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White"></SelectedRowStyle>

    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"></HeaderStyle>

    </PNCL:BulkEditGridView> <asp:ObjectDataSource id="ObjectDataSource1" runat="server" UpdateMethod="UpdateTable" TypeName="ObjectDB" SelectMethod="getTable">

    <UpdateParameters>

    <asp:Parameter Name="e" Type="Int32"></asp:Parameter>

    <asp:Parameter Name="ALLOWANCES_DESCRIPTION" Type="String"></asp:Parameter>

    <asp:Parameter Name="ALLOWANCES_AMOUNT" Type="Int32"></asp:Parameter>

    <asp:Parameter Name="INCOME_TAX" Type="Int32"></asp:Parameter>

    <asp:Parameter Name="EPF" Type="Int32"></asp:Parameter>

    <asp:Parameter Name="OTHER_DEDUCTIONS_DESCRIPTION" Type="String" />

    <asp:Parameter Name="OTHER_DEDUCTIONS_AMOUNT" Type="Int32" />

    <asp:Parameter Name="NET_SAL" Type="Int32" />

    <asp:Parameter Name="EMP_ID" Type="String"></asp:Parameter>

    </UpdateParameters>

    </asp:ObjectDataSource> </TD></TR><TR><TD style="TEXT-ALIGN: right" colSpan=11><asp:Button id="SaveButton" onclick="SaveButton_Click" runat="server" Text="Save Data"></asp:Button></TD></TR><TR><TD colSpan=11><asp:UpdateProgress id="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="250">

    <ProgressTemplate>

     

    <div style="text-align: center; font-size: 10pt;" >

    <img src="rotation.gif" alt="Processing " />

    Please wait ...

    </div>

    </ProgressTemplate>

    </asp:UpdateProgress> </TD></TR><TR><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px">&nbsp;</TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="TEXT-ALIGN: right" colSpan=3><asp:Button id="btnApprove" onclick="btnApprove_Click" runat="server" Font-Bold="True" Text="Approve Payslip Requests" Enabled="False"></asp:Button></TD></TR><TR><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="TEXT-ALIGN: right" colSpan=3><asp:Button id="btnGenPaySlip" onclick="btnGenPaySlip_Click" runat="server" Text="Generate Pay Slip" __designer:wfdid="w1"></asp:Button>&nbsp;</TD></TR></TBODY></TABLE><asp:Button style="DISPLAY: none" id="btnRefreshGrid" runat="server" Text="RefreshGrid" __designer:wfdid="w10" OnClick="btnRefreshGrid_Click"></asp:Button>

    </contenttemplate>

    </asp:UpdatePanel>

    code behind

     

    Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound

    If e.Row.RowType = DataControlRowType.DataRow Then

    If Session("SingleRow") Is Nothing Then

    Dim lbtn As LinkButton = CType(e.Row.FindControl("lbtnMore"), LinkButton)

     

    lbtn.Attributes.Add(
    "onclick", "window.showModalDialog('PopUpAllowance.aspx?planID=' + '" + keyDetails + "','','dialogWidth:320px;dialogHeight:200px;statusbar:no;toolbar:no;menubar=no;location:no;dialogleft:325;dialog:top:300;fullscreen:yes;addressbar:no;statusbar:false;dialogHide:true;resizable: No; status: No');return false;")

     

    End If

    If CType(e.Row.Cells(10), TableCell).Text.ToString = "0" Then

    CType(e.Row.Cells(10), TableCell).Text = "Pending..."

    CType(e.Row.Cells(10), TableCell).BackColor = Drawing.Color.Tomato

    ElseIf CType(e.Row.Cells(10), TableCell).Text.ToString = "1" Then

    CType(e.Row.Cells(10), TableCell).Text = "Approved"

    CType(e.Row.Cells(10), TableCell).BackColor = Drawing.Color.GreenYellow

    Else

    CType(e.Row.Cells(10), TableCell).Text = ""

    End If

    End If

    End Sub

     

        
     
    Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
    
            If e.Row.RowType = DataControlRowType.DataRow Then
    
                If Session("SingleRow") Is Nothing Then
    
                    Dim lbtn As LinkButton = CType(e.Row.FindControl("lbtnMore"), LinkButton)
          
                    lbtn.Attributes.Add("onclick", "window.showModalDialog('PopUpAllowance.aspx?planID=' + '" + keyDetails + "','','dialogWidth:320px;dialogHeight:200px;statusbar:no;toolbar:no;menubar=no;location:no;dialogleft:325;dialog:top:300;fullscreen:yes;addressbar:no;statusbar:false;dialogHide:true;resizable: No; status: No');return false;")
              
                End If
    
     
  • Re: passing arguments to popup window

    05-26-2009, 9:26 PM
    Answer

    Hello Mohan1 
     
    From the code above, I think you are using a third-party control names “BulkEditGridView”, right?
     
    If so, I would like to suggest you post the question on their support forum or contact the service provider for help.
     
    Because this is a generic ASP.NET forum. And community members not familiar with that control. Hope you can get more helpful information there.
     
    Thanks.

     

    Lance Zhang
Page 1 of 1 (2 items)