By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,728 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,728 IT Pros & Developers. It's quick & easy.

open.window javascript function not working within GridView

P: n/a
Dear all,
I tried to replace the GridView Column's HyperLinkField
"DataNavigateUrlFormatString" property with a java script pop up
window, but wehen i preview the page, the link is REMOVED! Does any one
see any thing wrong in the code below?

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="ITEM_ID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ITEM_ID" HeaderText="Item
ID" ReadOnly="True"
Visible="False" />
<asp:HyperLinkField
DataNavigateUrlFields="ITEM_ID,ITEM_MODEL,ITEM_MAN UFACTURER"
DataTextField="ITEM_MODEL"
HeaderText="Model"
DataNavigateUrlFormatString="javascript:var
w=window.open('../ItemsDetails.aspx?ITEM_ID={0}&ITEM_MODEL={1}&ITEM_ MANUFACTURE={2}',null,'width=600,height=400');"
/>
<asp:BoundField DataField="ITEM_MANUFACTURER"
HeaderText="ITEM_MANUFACTURER"
SortExpression="ITEM_MANUFACTURER" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyDBConnectionString
%>"
ProviderName="<%$
ConnectionStrings:MyDBConnectionString.providerNam e %>"
SelectCommand="SELECT [ITEM_ID], [ITEM_MODEL],
[ITEM_MANUFACTURER] FROM [ITEM]">
</asp:SqlDataSource>

May 5 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.