Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi friends,
I have a form in which i have a button in my gridview.When i click that button, i need the corresponding row 'ID' value to be passed to another page which will be opened in a new window.I need a javascript method to open that page in a new window.Also , in the new window the maximize button should be disabled and that window should open in the center of the screnn. Can anyonre help me with the code for this.Thanks in advance,...
Posted

1 solution

Hi,
Try this:
JavaScript
window.open('../Test1.aspx', null, 'height=500, width=1100, status=no, resizable=no, scrollbars=yes, toolbar=no,location=no, menubar=no');

[Edited]:
ASP.NET
<asp:Button ID="btn" runat="server" Text="View" onClientClick='window.open(../Test1.aspx?ID=<%#Eval("IDColumnName") %>, null, height=500, width=1100, status=no, resizable=no, scrollbars=yes, toolbar=no,location=no, menubar=no)'/>

--Amit
 
Share this answer
 
v3
Comments
ajithk444 9-Aug-12 0:50am    
Hi,I need to get the value of the first column in my gridview which should pass to the next window.how to fetch the selected record ID from grid using javascript?
ajithk444 9-Aug-12 1:00am    
using hyperlink i can oly pass the value to a new window.But i want to pass values to the new window as well as open it using the appropriate window settings.pls help me how to do this..
_Amy 9-Aug-12 1:02am    
Add the attributes to the linkbutton or hyperlink in rowdatabound event of gridview and pass the required parameter.
ajithk444 9-Aug-12 1:19am    
i am not able to get clear about where to use what all codes.what code should i write in rowdatabound event if am using a hyperlink.and what should be in my javascript to get that value?

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