473,769 Members | 4,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hyperlink Eval Statement Problem

I am trying to impliment the extensions to the Club Starter kit as described
at:
http://msdn.microsoft.com/asp.net/de...bwebsitesk.asp
but when I build the hyperlinks in the Gridview Column template as described
at the end of the article I am getting two errors on each of the hyperlinks
("Characer is not valid" and "Expression Expected"). I've included the code
from one of these instances below. The errors point to the line with the
NavigateURL expression. Any thoughts on what is wrong here?

=============== =============== =============== =============
<asp:GridView ID="GridView1" runat="server" Width="75%" AllowPaging="Tr ue"
AllowSorting="T rue" AutoGenerateCol umns="False" DataKeyNames="D ocumentID"
DataSourceID="S qlDataSource2">
<Columns>

<asp:CommandFie ld ShowSelectButto n="True" />

<asp:TemplateFi eld HeaderText="Doc umentName" SortExpression= "DocumentNa me">

<EditItemTempla te>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocumentN ame")
%>'></asp:TextBox>

</EditItemTemplat e>

<ItemTemplate >

<asp:HyperLin k ID="HyperLink2 " runat="server" NavigateUrl='<% # <%#
Eval("DocumentN ame", @"~\Files\{0 }") %> %>'

Text='<%# Eval("DocumentN ame") %>'></asp:HyperLink>

</ItemTemplate>

</asp:TemplateFie ld>

<asp:BoundFie ld DataField="Date Input" HeaderText="Dat eInput"
SortExpression= "DateInput" />

<asp:BoundFie ld DataField="Comm ents" HeaderText="Com ments"
SortExpression= "Comments" />

</Columns>

</asp:GridView>

=============== =============== =============== ==
Jan 2 '06 #1
3 6850
I saw that the process of inserting that link had wrapped the targeturl
within 2 sets of "<%#..%>" and I rmoved the outer set so it now is:

<asp:HyperLin k ID="HyperLink1 " runat="server" NavigateUrl='<% #
Eval("CategoryI D", @"Docs.aspx?cat egoryid={0}") %>'

Text='<%# Eval("CategoryN ame") %>'></asp:HyperLink>

but I still get the "Character is not valid" error?

"Wayne Wengert" <wa***********@ wengert.org> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
I am trying to impliment the extensions to the Club Starter kit as
described at:
http://msdn.microsoft.com/asp.net/de...bwebsitesk.asp
but when I build the hyperlinks in the Gridview Column template as
described at the end of the article I am getting two errors on each of the
hyperlinks ("Characer is not valid" and "Expression Expected"). I've
included the code from one of these instances below. The errors point to
the line with the NavigateURL expression. Any thoughts on what is wrong
here?

=============== =============== =============== =============
<asp:GridView ID="GridView1" runat="server" Width="75%" AllowPaging="Tr ue"
AllowSorting="T rue" AutoGenerateCol umns="False" DataKeyNames="D ocumentID"
DataSourceID="S qlDataSource2">
<Columns>

<asp:CommandFie ld ShowSelectButto n="True" />

<asp:TemplateFi eld HeaderText="Doc umentName"
SortExpression= "DocumentNa me">

<EditItemTempla te>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocumentN ame")
%>'></asp:TextBox>

</EditItemTemplat e>

<ItemTemplate >

<asp:HyperLin k ID="HyperLink2 " runat="server" NavigateUrl='<% # <%#
Eval("DocumentN ame", @"~\Files\{0 }") %> %>'

Text='<%# Eval("DocumentN ame") %>'></asp:HyperLink>

</ItemTemplate>

</asp:TemplateFie ld>

<asp:BoundFie ld DataField="Date Input" HeaderText="Dat eInput"
SortExpression= "DateInput" />

<asp:BoundFie ld DataField="Comm ents" HeaderText="Com ments"
SortExpression= "Comments" />

</Columns>

</asp:GridView>

=============== =============== =============== ==

Jan 2 '06 #2
If you're using C#, verify that you have a language attribute of C# in the
@Page directive. If you're not using C#, remove the "@" from in from of
your "Docs.aspx...." .
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Wayne Wengert" <wa***********@ wengert.org> wrote in message
news:eK******** ******@TK2MSFTN GP09.phx.gbl...
I saw that the process of inserting that link had wrapped the targeturl
within 2 sets of "<%#..%>" and I rmoved the outer set so it now is:

<asp:HyperLin k ID="HyperLink1 " runat="server" NavigateUrl='<% #
Eval("CategoryI D", @"Docs.aspx?cat egoryid={0}") %>'

Text='<%# Eval("CategoryN ame") %>'></asp:HyperLink>

but I still get the "Character is not valid" error?

"Wayne Wengert" <wa***********@ wengert.org> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
I am trying to impliment the extensions to the Club Starter kit as
described at:
http://msdn.microsoft.com/asp.net/de...bwebsitesk.asp
but when I build the hyperlinks in the Gridview Column template as
described at the end of the article I am getting two errors on each of the
hyperlinks ("Characer is not valid" and "Expression Expected"). I've
included the code from one of these instances below. The errors point to
the line with the NavigateURL expression. Any thoughts on what is wrong
here?

=============== =============== =============== =============
<asp:GridView ID="GridView1" runat="server" Width="75%"
AllowPaging="Tr ue" AllowSorting="T rue" AutoGenerateCol umns="False"
DataKeyNames="D ocumentID" DataSourceID="S qlDataSource2">
<Columns>

<asp:CommandFie ld ShowSelectButto n="True" />

<asp:TemplateFi eld HeaderText="Doc umentName"
SortExpression= "DocumentNa me">

<EditItemTempla te>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocumentN ame")
%>'></asp:TextBox>

</EditItemTemplat e>

<ItemTemplate >

<asp:HyperLin k ID="HyperLink2 " runat="server" NavigateUrl='<% # <%#
Eval("DocumentN ame", @"~\Files\{0 }") %> %>'

Text='<%# Eval("DocumentN ame") %>'></asp:HyperLink>

</ItemTemplate>

</asp:TemplateFie ld>

<asp:BoundFie ld DataField="Date Input" HeaderText="Dat eInput"
SortExpression= "DateInput" />

<asp:BoundFie ld DataField="Comm ents" HeaderText="Com ments"
SortExpression= "Comments" />

</Columns>

</asp:GridView>

=============== =============== =============== ==


Jan 2 '06 #3
Thanks - I am using VB and removing the seems to have fixed it. It appears
that the whitepaper code sample for setting the hyperlink was for C#

Wayne

"Christophe r Reed" <ca****@nospam. nospam> wrote in message
news:ev******** ******@TK2MSFTN GP12.phx.gbl...
If you're using C#, verify that you have a language attribute of C# in the
@Page directive. If you're not using C#, remove the "@" from in from of
your "Docs.aspx...." .
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Wayne Wengert" <wa***********@ wengert.org> wrote in message
news:eK******** ******@TK2MSFTN GP09.phx.gbl...
I saw that the process of inserting that link had wrapped the targeturl
within 2 sets of "<%#..%>" and I rmoved the outer set so it now is:

<asp:HyperLin k ID="HyperLink1 " runat="server" NavigateUrl='<% #
Eval("CategoryI D", @"Docs.aspx?cat egoryid={0}") %>'

Text='<%# Eval("CategoryN ame") %>'></asp:HyperLink>

but I still get the "Character is not valid" error?

"Wayne Wengert" <wa***********@ wengert.org> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
I am trying to impliment the extensions to the Club Starter kit as
described at:
http://msdn.microsoft.com/asp.net/de...bwebsitesk.asp
but when I build the hyperlinks in the Gridview Column template as
described at the end of the article I am getting two errors on each of
the hyperlinks ("Characer is not valid" and "Expression Expected"). I've
included the code from one of these instances below. The errors point to
the line with the NavigateURL expression. Any thoughts on what is wrong
here?

=============== =============== =============== =============
<asp:GridView ID="GridView1" runat="server" Width="75%"
AllowPaging="Tr ue" AllowSorting="T rue" AutoGenerateCol umns="False"
DataKeyNames="D ocumentID" DataSourceID="S qlDataSource2">
<Columns>

<asp:CommandFie ld ShowSelectButto n="True" />

<asp:TemplateFi eld HeaderText="Doc umentName"
SortExpression= "DocumentNa me">

<EditItemTempla te>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocumentN ame")
%>'></asp:TextBox>

</EditItemTemplat e>

<ItemTemplate >

<asp:HyperLin k ID="HyperLink2 " runat="server" NavigateUrl='<% # <%#
Eval("DocumentN ame", @"~\Files\{0 }") %> %>'

Text='<%# Eval("DocumentN ame") %>'></asp:HyperLink>

</ItemTemplate>

</asp:TemplateFie ld>

<asp:BoundFie ld DataField="Date Input" HeaderText="Dat eInput"
SortExpression= "DateInput" />

<asp:BoundFie ld DataField="Comm ents" HeaderText="Com ments"
SortExpression= "Comments" />

</Columns>

</asp:GridView>

=============== =============== =============== ==



Jan 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2603
by: Kumar | last post by:
Hi Folks, I have a question regarding conditional hyperlink in datagrid. I want to display Hyperlink if my QID values in (1,4,5,6) other wise i want to display just Qdescription with out hyperlink. <asp:hyperlinkcolumn headertext="Question" SortExpression="QDescription" datatextfield="QDescription"
0
550
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif images as the ImageURL of the Hyperlink. When a load the page with the controls on it works fine, but sometimes the images are broken, but if i hit refresh i get random selections of the gifs appearing and not appearing. if i hit Back button to a page...
5
6689
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
4
2218
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile" NavigateUrl="javascript:OpenImage('<%# DataBinder.Eval(Container.DataItem,"FileName") %>');"><%#
3
4172
by: Bren | last post by:
Hi All VS2005 Gridview control with vb I am populating a gridview of company staff. One of the columns is a hyperlink to a SMS texting facility I have so secrataries can text the managers etc. i.e Secratary loads the page on the intranet, finds the manager they want to contact, clicks on the "SMS" hyperlink and is taken to the SMS page to fill out the message and send it to the manager.
3
3699
by: keithb | last post by:
Using a GridView, I get a "Specified cast is not valid" error when binding the Visible propery of a hyperlink control to a DataTable text field. The error goes away if I replace the data binding statement with "true" or "false". This code causes the error: <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("c2Hyperlink1Link") %>' Target="_blank"
7
7047
by: ashtek | last post by:
I have an <ASP:HYPERLINKon a datagrid (templatecolumn) and I need to open a new window with no toolbar and specific height & width onclick of the link. I also want to pass the PK to this new window. <ASP:HYPERLINK ID="lnkNewWin" RUNAT="server" NAVIGATEURL="#" ONCLICK="javascript:window.open('NewWin.aspx?PK=<%# DataBinder.Eval(Container.DataItem,"PK")%>','','toolbar=0,width=600,height=600,scollbars=1')" TEXT="Click"></ASP:HYPERLINK> ...
1
2520
by: Paul W Smith | last post by:
The text below is a GridView I am trying to use to display some data from a database. I am using one templatefield of grid because I want the contents of the record fields to appear on three different lines. Everything works except I now want to add an image with which acts as a hyperlink to another page. The querystring to the new page is a field from the database. What I cannot get right is the syntax to build the Hyperlink to the...
6
1541
by: wonijack | last post by:
Long time listener first time poster I have a link that I need to put into the if statement. Here is my hyperlink <a href="notify.aspid=<%# DataBinder.Eval(Container.DataItem, "theid") %>">Test</a> This works perfect if its on the page by itself and shows as just a regular hyperlink and goes to the notify page. However when I go to insert it as a value of my if statement I get "Comma, ')', or a valid expression continuation...
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9849
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.