Re: asp.net 1.1 datagrid and DataNavigateUrlFormatString
- From: msuk <msuk@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 Jun 2006 03:05:01 -0700
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" wrote:
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" <msuk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0D5AA0DE-1A8B-418F-9EF4-7F9282D46FBE@xxxxxxxxxxxxxxxx
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
- Follow-Ups:
- References:
- Prev by Date: Re: Remote logon page like Microsoft passport
- Next by Date: Re: need to get unique ids of selected checkboxes in datagrid
- Previous by thread: Re: asp.net 1.1 datagrid and DataNavigateUrlFormatString
- Next by thread: Re: asp.net 1.1 datagrid and DataNavigateUrlFormatString
- Index(es):
Relevant Pages
|