HighDots Forums  

ASP.NET C# writer.WriteAttributeString

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss ASP.NET C# writer.WriteAttributeString in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Shaine Fisher
 
Posts: n/a

Default ASP.NET C# writer.WriteAttributeString - 08-07-2004 , 12:53 PM






Please help, it's prob really easy but I can't get this to work. I
want to put a database field result value into a WriteAttributeString,
but I keep getting the error:


Here is the code, I know where the problem is (marked with ***) but
not how to fix it!

<%@ Page Language="C#" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,culture=neutral"
%>
<MMataSet
id="dsProductList"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_STRING_connCAXaspx"]
%>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_DATABASETYPE_connCAXaspx"]
%>'
CommandText='<%# "SELECT * FROM products" %>'
Debug="true"
Quote:
/MMataSet
MM:PageBind runat="server" PostBackBind="true" /
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Text" %>
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e){
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream,
Encoding.UTF8);
writer.WriteStartDocument();
writer.Formatting = Formatting.Indented;
writer.WriteComment("XML Output from ASPX C# Page. Designed by Shaine
Fisher");
writer.WriteStartElement("products");
writer.WriteStartElement("product");
writer.WriteAttributeString("itemname", Request.UserAgent);
writer.WriteAttributeString("id", <%#***
dsProductList.FieldValue("productid", Container) %>);
writer.WriteAttributeString("man", "Kustom Kit");
writer.WriteAttributeString("descsm", "This is a small
description.");
writer.WriteAttributeString("dateadded", "31/07/2004");
writer.WriteAttributeString("price", "10.49");
writer.WriteAttributeString("img", "kk109.jpg");
writer.WriteAttributeString("isnew", "f");
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
}
</script>


There must be a way to do this, I just can't find the solution right
now!!


Cheers

Shaine


Reply With Quote
  #2  
Old   
Julian Roberts
 
Posts: n/a

Default Re: ASP.NET C# writer.WriteAttributeString - 08-07-2004 , 01:26 PM






Try

writer.WriteAttributeString("id",dsProductList.Fie ldValue("productid",
null));

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004



Reply With Quote
  #3  
Old   
Shaine Fisher
 
Posts: n/a

Default Re: ASP.NET C# writer.WriteAttributeString - 08-08-2004 , 04:58 AM



"Julian Roberts" <newsg (AT) charon (DOT) co.uk> wrote

Quote:
Try

writer.WriteAttributeString("id",dsProductList.Fie ldValue("productid",
null));
Thanks, I'll give that a go.

Shaine


Reply With Quote
  #4  
Old   
Shaine Fisher
 
Posts: n/a

Default Re: ASP.NET C# writer.WriteAttributeString - 08-08-2004 , 05:05 AM



"Julian Roberts" <newsg (AT) charon (DOT) co.uk> wrote

Quote:
Try

writer.WriteAttributeString("id",dsProductList.Fie ldValue("productid",
null));
These 2 messages may turn up in the worng order, but who cares.
Thanks, that worked, perfect.

Shaine


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.