Hi,
I got the following error:
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Literal content ('<asp:HyperLinkColumn
DataNavigateUrlField="id"
DataNavigateUrlFormatString=ConfigurationSettings.AppSettings["webRoot"] +
"//link.aspx?id={0}" DataTextField="name" HeaderText="Document">
</asp:HyperLinkColumn>') is not allowed within a
'System.Web.UI.WebControls.DataGridColumnCollection'.
Source Error:
Line 131: <HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#999999"></HeaderStyle>
Line 132: <Columns>
Line 133: <asp:HyperLinkColumn DataNavigateUrlField="id"
DataNavigateUrlFormatString=ConfigurationSettings.AppSettings["webRoot"] +
"//showpdf.aspx?id={0}" DataTextField="name" HeaderText="Document">
Line 134:
Line 135: </asp:HyperLinkColumn>
I also tried with a single '/' and get the same message. I placed the
'Imports System.Configuration' in the code behind for the page is this
correct?
Thanks
msuk
CK said:
In the VS 2003 edit your web config;
<appSettings>
<add key="SomeDomain" value="
www.somedomain.com"/>
</appSettings>
Then in the code use
DataNavigateUrlFormatString= ConfigurationSettings.AppSettings["SomeDomain"]
+ "//link.aspx?id{0}";
that should work. You may or may not need the double forward slash. Also add
System.Configuration reference to a page that would use this.
HTH,
~CK
msuk said:
All,
I am using a datagrid on a 1.1 .aspx page that has a hyperlink column. I
am
using 'DataNavigateUrlFormatString' to set the URL to browse to once the
user
clicks on the link i.e.
DataNavigateUrlFormatString="
www.somedomain.com/link.aspx?id={0}"
What I would like to do is get the "
www.somedomain.com" from my web.config
and concat the "/link.aspx?id={0}".
Can some tell me how I can code this please?
Thanks
Msuk