Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Javascript .NET , +
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 8-Aug-12 18:04pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
Try this:
window.open('../Test1.aspx', null, 'height=500, width=1100, status=no, resizable=no, scrollbars=yes, toolbar=no,location=no, menubar=no');
[Edited]:
<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
  Permalink  
v3
Comments
ajithk444 at 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 at 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 at 9-Aug-12 1:02am
   
Add the attributes to the linkbutton or hyperlink in rowdatabound event of gridview and pass the required parameter.
ajithk444 at 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?
_Amy at 9-Aug-12 1:30am
   
Try My edited answer..
ajithk444 at 9-Aug-12 1:40am
   
I get this error.
"The server tag is not well formed."
 
This was my code.:
 
<asp:Button ID="btnEdit" runat="server" Text="Edit" onClientClick="window.open('ISSRegistrationForm.aspx?E_Id=<%#Eval("ID") %>', null, 'height=500, width=1100, status=no, resizable=no, scrollbars=yes, toolbar=no,location=no, menubar=no')"/>
_Amy at 9-Aug-12 1:44am
   
Use single quote:
<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)'/>
ajithk444 at 9-Aug-12 1:51am
   
still it is the same error:(
 
<asp:TemplateField>

<asp:Button ID="btnEdit" runat="server" Text="Edit" onClientClick='window.open('ISSRegistrationForm.aspx?E_Id=<%#Eval("ID") %>', 'Employee Details', 'height=500, width=1100, status=no, resizable=no, scrollbars=yes, toolbar=no,location=no, menubar=no')'/>
 


ajithk444 at 9-Aug-12 1:59am
   
what to change in this code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100