TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Azaad Abbas
NA
221
41.7k
open new tab by click on row command of gridview in update c
Mar 24 2015 3:14 AM
I want to open new tab window by click grid row command,so normally its working but when i put grid into update panel then its not redirecting to new tab, where as when i de bugged code behind side working properly.so how to open new tab by click on row command of gridview in update control?
<asp:UpdatePanel ID="upbtnSearch" runat="server"><ContentTemplate>
<asp:Button ID="btnSearchCust" Text="Search" runat="server" class="btn btn-success" onclick="btnSearchCust_Click" />
<asp:Label ID="lblDiscounts" runat="server"></asp:Label>
<asp:Label ID="lblTotPaids" runat="server"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSearchCust" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="upGrid" runat="server"><ContentTemplate>
<asp:GridView ID="gridPaySearch" AutoGenerateColumns="False" runat="server"
BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3" CellSpacing="1" GridLines="None"
onrowcommand="gridPaySearch_RowCommand"
onselectedindexchanging="gridPaySearch_SelectedIndexChanging">
<Columns>
<asp:TemplateField HeaderText="#">
<ItemTemplate>
<%#Container.DataItemIndex + 1%>
</ItemTemplate>
<ItemStyle Width="8%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Invoice#">
<ItemTemplate>
<asp:LinkButton ID="linkPayId" ItemStyle-Width="150px" ItemStyle-Height="150px" runat="server" Text='<%# Bind("PayId") %>' CommandArgument='<%#Eval("PayId")%>' CommandName="PaymentVIEW"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Account No" DataField="UserId" />
<asp:TemplateField HeaderText="Customer Name">
<ItemTemplate>
<asp:LinkButton ID="linkCustName" runat="server" Text='<%# Bind("[ Name]") %>' CommandArgument='<%#Eval("UserId")%>' CommandName="CustomerVIEW"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UserName" HeaderText="User Name" />
<asp:BoundField DataField="PackageName" HeaderText="Package Name" />
<asp:BoundField DataField="PackagePeriod" HeaderText="Package Period" />
<asp:BoundField DataField="InstallCharge" HeaderText="Installation Charges" />
<asp:BoundField DataField="AmountToPay" HeaderText="Amount To Pay" />
<asp:BoundField DataField="PyingAmount" HeaderText="Amount Paid" />
<asp:BoundField DataField="Balance" HeaderText="Balance" />
<asp:BoundField DataField="DiscountToPay" HeaderText="Discount" />
<asp:BoundField DataField="AreaName" HeaderText="Area" />
<asp:BoundField DataField="MobNo" HeaderText="Mobile#" />
<asp:BoundField DataField="CreatedDate" HeaderText="Created Time" />
<asp:BoundField DataField="EmpName" HeaderText="Collected By" />
<asp:BoundField DataField="BankName" HeaderText="Bank Name" />
<asp:BoundField DataField="ChequeNo" HeaderText="Cheque No" />
<asp:BoundField DataField="ChequeDate" HeaderText="Cheque Date" />
</Columns>
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#594B9C" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#33276A" />
</asp:GridView>
<asp:Repeater ID="rptPager" runat="server"></asp:Repeater>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gridPaySearch" EventName="RowCommand" />
<asp:AsyncPostBackTrigger ControlID="btnSearchCust" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ddlRecordPayment" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="upddlRecord" runat="server"><ContentTemplate>
<asp:DropDownList ID="ddlRecordPayment" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlRecordPayment_SelectedIndexChanged">
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>25</asp:ListItem>
<asp:ListItem>50</asp:ListItem>
<asp:ListItem>100</asp:ListItem>
<asp:ListItem>250</asp:ListItem>
<asp:ListItem>500</asp:ListItem>
<asp:ListItem>1000</asp:ListItem>
</asp:DropDownList>
/* code beind side*/
protected void gridPaySearch_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "PaymentVIEW")
{
int row = Convert.ToInt32(e.CommandArgument);
Session["PayId"] = row;
Response.Write("<script> window.open( '../Update Pages/PaymentUpdateAndDelete.aspx','_blank' ); </script>");
//Response.Write("<script>window.opener.location.href = window.opener.location.href </script>");
//Response.Redirect("~/Update Pages/PaymentUpdateAndDelete.aspx");
}
else if (e.CommandName == "CustomerVIEW")
{
int row = Convert.ToInt32(e.CommandArgument);
Session["UserId"] = row;
Response.Redirect("~/Update Pages/RegCustUpdateAndDelete.aspx");
}
}
Reply
Answers (
2
)
How to use javascript two nested master page in asp.net
Performance Tool for .NET Application