Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<asp:updatepanel id="UpdatePanel3" runat="server" updatemode="Conditional" xmlns:asp="#unknown">
<asp:gridview id="grdViewAllStudy" runat="server" autogeneratecolumns="False">
OnRowDataBound="grdViewAllStudy_RowDataBound">
<asp:templatefield headertext="Action">
<asp:linkbutton id="btnAuditTrail" oncommand="btnAuditTrail_command" commandargument="<%#Eval("StudyCodeId")%>">
Text='View History' runat="server">

What I have tried:

string strEncrypt = clsCommon.Encrypt_QueryString(Convert.ToString("110"));
string pageurl = "frmViewUpdateHistoryPage.aspx?StudyCodeID=" + strEncrypt + "";
StringBuilder sb = new StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.open('");
sb.Append(pageurl);
sb.Append("');");
sb.Append("</script>");

1] ClientScript.RegisterStartupScript(this.GetType(), "script",sb.ToString());
2] ScriptManager.RegisterStartupScript(this.GetType(),"Window", "script", sb.ToString(),true);

I used above 2 option, But Still it is not working ,Please Help.........
Note :: In my Source Code I close GridView as well as UpdatePanel.
Posted
Updated 6-Jul-16 21:09pm
v3
Comments
Karthik_Mahalingam 5-Jul-16 4:31am    
you are invoking the code in button click or on page load?
Abhijit Mindcraft 7-Jul-16 2:50am    
I am invoking it on linkButton(btnAuditTrail) click.
Karthik_Mahalingam 7-Jul-16 2:51am    
on button click, it should open the pop up?
Abhijit Mindcraft 7-Jul-16 2:49am    
I am invoking it on linkButton(btnAuditTrail) click.
Karthik_Mahalingam 7-Jul-16 2:54am    
is the button inside gridivew?

1 solution

try this
C#
string script = sb.ToString();
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", script, false);
 
Share this answer
 

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