S
Steve Kallal
I have found some postings on multi-parameter hyperlinks. But none of them involve calling a javascript function. I have almost got the NavigateUrl property to work, but not quite. Here is the DataGrid definition
<aspataGrid id="grid" runat="server" Width="99%" AutogenerateColumns="false" AllowPaging="True
AllowCustomPaging="True"><AlternatingItemStyle CssClass="datagrid_alternating_item"></AlternatingItemStyle><ItemStyle CssClass="datagrid_item"></ItemStyle><HeaderStyle CssClass="tableheader" BackColor="SteelBlue"></HeaderStyle><Columns><asp:TemplateColumn><ItemTemplate><asp:HyperLink id=lnkID runat="server" NavigateUrl='<%# "javascript:ShowForm(accountID=" & Server.UrlEncode(Container.DataItem("AccountKey")) & "&LDCID=" & Server.UrlEncode(Container.DataItem("LDCID")) & ")" %>
text='<%#Container.DataItem("RowNum")%>'></asp:HyperLink></ItemTemplate></asp:TemplateColumn></Columns><PagerStyle HorizontalAlign="Right" Position="TopAndBottom" CssClass="field" Mode="NumericPages"></PagerStyle></aspataGrid
I am able to get the hyperlink URL at runtime set to
javascript:ShowForm(accountID=267425&LDCID=SCE
But what I really need is
javascript:ShowForm('accountID=267425&LDCID=SCE'
The single quote characters surrounding the parameter to the ShowForm Javascript function is a real annoyance. How do I do this without resorting to code of the ItemDataBound event
Thanks in advance
<aspataGrid id="grid" runat="server" Width="99%" AutogenerateColumns="false" AllowPaging="True
AllowCustomPaging="True"><AlternatingItemStyle CssClass="datagrid_alternating_item"></AlternatingItemStyle><ItemStyle CssClass="datagrid_item"></ItemStyle><HeaderStyle CssClass="tableheader" BackColor="SteelBlue"></HeaderStyle><Columns><asp:TemplateColumn><ItemTemplate><asp:HyperLink id=lnkID runat="server" NavigateUrl='<%# "javascript:ShowForm(accountID=" & Server.UrlEncode(Container.DataItem("AccountKey")) & "&LDCID=" & Server.UrlEncode(Container.DataItem("LDCID")) & ")" %>
text='<%#Container.DataItem("RowNum")%>'></asp:HyperLink></ItemTemplate></asp:TemplateColumn></Columns><PagerStyle HorizontalAlign="Right" Position="TopAndBottom" CssClass="field" Mode="NumericPages"></PagerStyle></aspataGrid
I am able to get the hyperlink URL at runtime set to
javascript:ShowForm(accountID=267425&LDCID=SCE
But what I really need is
javascript:ShowForm('accountID=267425&LDCID=SCE'
The single quote characters surrounding the parameter to the ShowForm Javascript function is a real annoyance. How do I do this without resorting to code of the ItemDataBound event
Thanks in advance