Forums
This topic is locked
Constructing Variables in Dreamweaver and ASP.NET
Posted 24 Sep 2007 19:04:53
1
has voted
24 Sep 2007 19:04:53 Robert Iveson posted:
<font face='Arial'>Hello! Firstly, I'll have to apologise for asking a potentially dumbass question - I've been a long time user of Dreamweaver and ASP, but I've recently been asked to develop a site in ASP.NET, and things are going a bit rubbish.
Generally, if I am calling a recordset item from Dreamweaver, I may use something like this:
<% myvariable = (RSPages.Fields.Item("PageID".Value) %>
Then I can use 'myvariable' along the lines of :
<% if myvariable = "1" then
... do something ...
end if %>
However, I want to use a similar procedure in ASP.NET, but it doesn't quite work according to plan. I'm using the variable in a Repeating Region, and want to do something like:
<% myvariable = (RSPages.Fields.Item("PageID".Value) %>
But (RSPages.Fields.Item("PageID".Value) on it's own doesn't work in this case.
<%#(RSPages.Fields.Item("PageID".Value)%> does work in the Repeating Region, however, but I'm unable to 'use' it as a variable.
Obviously I can't use:
<% myvariable = <%#(RSPages.Fields.Item("PageID".Value)%> %>
So now I'm stuck. What would the correct syntax be in this case?
Many thanks!
Bert.
</font id='Arial'>