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 expected."
This is my complete statement
<%# iif(DataBinder.Eval(Container.DataItem,"stockmessa ge")<>"Out of Stock","In Stock","<a href="notify.asp?id=<%# DataBinder.Eval(Container.DataItem, "theid") %>">Test</a>")%>
So basically this just lets them know if its in stock. If so it just says "In Stock". If it is out of stock I need to refer them to the notify page passing the itemid variable. Then they sign up for an alert when it becomes avaialable. I know Im missing something in my syntax...I just cannot figure this baby out!
any help would be appreciated.
Jack
6 1520
It looks like you are nesting <% calls, you might need to restructure it to not do that? -
<%# iif(DataBinder.Eval(Container.DataItem,"stockmessage")<>"Out of Stock","In Stock","<a href="notify.asp?id=<%# DataBinder.Eval(Container.DataItem, "theid") %>">Test</a>")%>
-
The <%# puts you into "code" mode and not in "html" mode so maybe try something like this: -
<%# iif(DataBinder.Eval(Container.DataItem,"stockmessage")<>"Out of Stock","In Stock","<a href="notify.asp?id="+DataBinder.Eval(Container.DataItem, "theid").ToString()+">Test</a>")%>
-
I looked at the mentioned link and id did not seem to help me out.
Here is the code I have so Far and I get a "Microsoft.VisualBasic Exception: Conversion from string " error.
<%# IIF(DataBinder.Eval(Container.DataItem,"stockmessa ge")<>"Out of Stock","In Stock","<a href=notify.asp?item='"+ Container.DataItem("theid")+"'>Out of Stock</a>")%>
Any help would be appreciated
Plater I tried your code and getting the error message "BC32017: Comma, ')', or a valid expression continuation expected."
I knows its gotta be somewhere in the syntax. Thats whats killing me!
I appreciate your help with this guys.
I got it!
<%# iif(DataBinder.Eval(Container.DataItem,"stockmessa ge")<>"Out of Stock","In Stock","<a href=notify.asp?id="+DataBinder.Eval(Container.Dat aItem, "theid").ToString()+">Test</a>")%>
Had to remove the first set of quotes in front of notify!
THANK YOU SOOOO MUCH for this.
take care and Ill be back to help out anyone I can.
I got it!
<%# iif(DataBinder.Eval(Container.DataItem,"stockmessa ge")<>"Out of Stock","In Stock","<a href=notify.asp?id="+DataBinder.Eval(Container.Dat aItem, "theid").ToString()+">Test</a>")%>
Had to remove the first set of quotes in front of notify!
THANK YOU SOOOO MUCH for this.
take care and Ill be back to help out anyone I can.
Ooops, I forgot to escape the ", it's a good idea to enclose your attribue's values (such as href) in quotes, I think it's part of the standards somewhere. -
<%# iif(DataBinder.Eval(Container.DataItem,"stockmessage")<>"Out of Stock","In Stock","<a href=\"notify.asp?id="+DataBinder.Eval(Container.DataItem, "theid").ToString()+"\">Test</a>")%
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andreas Meffert |
last post by:
Hello,
How can I change the Type of a field in a table from Memo to hyperlink? I
import a table from Oracle to Access 2003. After that, the field type of
some hyperlink-fields is "Memo".
How...
|
by: compuglobalhypermeganetz0r |
last post by:
I am having trouble getting an adapter to update my access database, it
gives the error Syntax error in INSERT INTO statement. for
Line 98: Adapter.Update(WineDS, "tblWines")
Below is my...
|
by: Raja |
last post by:
I have a datagrid, it has dropdown box as a column and i have one more column
that has hyperlink. The NavigateURL for the hyperlink is to open a new window
with a query stirng parameter as the...
|
by: epigram |
last post by:
I'm using the DataGrid with AutoGenerateColumns set to false and choosing
which columns I want in the grid by using the <Columns> attribute. What I
want to do is to create a hyperlink out of one...
|
by: Fabrice |
last post by:
Hello,
First, thanks to felix for his answer.
But :-( , I'm feeling newbie :! I' don't understand all the situation.
The trouble :
Always in the road whith my Datagrid and my ItemTemplate...
|
by: Bob Sanderson |
last post by:
I have a php page which contains the code:
echo "<tr>";
echo "<th>$JobNumber</th>";
echo "<td>$Description</td>";
echo "<td>$NSN</td>";
echo "<td>$Manufacturer</td>";
echo...
|
by: kkuniya |
last post by:
Situation :
- A form (method : POST, action : itself, onsubmit : alert 'Submit' )
- Got 2 submit button ( 'Save' , 'View')
- Got navigation 1|2|3|4
What I want to do :
- Once clicked on the...
|
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...
|
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...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |