Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Compiler Error Message: CS1026: ) expected

Compiler Error Message: CS1026: ) expected

Reply
  #1 (permalink)  
Old 05-13-09, 06:50 AM
FitScorp FitScorp is offline
New Member
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Compiler Error Message: CS1026: ) expected

Line 30: writer.WriteWhitespace("\n");
Line 31: writer.WriteWhitespace("\n");
Line 32: writer.WriteRaw("<imagePath value="product.jpg"/>");
Line 33: writer.WriteWhitespace("\n");
Line 34: // writer.WriteRaw("<imagePath value = "product.jpg" />");


I am using ASP.NET and C# to make a dynamic XML file

The XML file has to print that line like:

<imagePath value= "product.jpg" />

But it does not like spaces nor additional " speech marks that are called
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-13-09, 08:47 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 2,655
Thanks: 0
Thanked 21 Times in 21 Posts
I think ASP syntax is similar to PHP or Javascript.
When quoting a value that has quoted values you must use different style quotes.

Like this:
Code:
Line 30:         writer.WriteWhitespace("\n");
Line 31:         writer.WriteWhitespace("\n");
Line 32:         writer.WriteRaw("<imagePath value='product.jpg' />");
Line 33:         writer.WriteWhitespace("\n");
Line 34:        // writer.WriteRaw("<imagePath value = 'product.jpg' />");
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-13-09, 09:37 AM
FitScorp FitScorp is offline
New Member
 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi

I managed to fix this before using that!

What I want to also know is that if I can declare an ASP function in C#

I have a products page, when someone clicks an item image it loads a popup like this

link.com/zoompage.aspx?image=http://www.product-large.com/image-big-no-thumbnail.jpg

On this page zoompage.aspx - I have it like

Declare ASP C# page
HTML
FORM runat server
Java/Flash product zoom
End


Now the C# is a seperate script which rights a XML file on the page load.

The XML file has to load the Image inside of it. I normally use

<%=Replace(Request.QueryString, "image=", "")%>

That prints the address of the image and removes the www.image.com/zoompage.aspx?image=

How do I display that command in C#

Example


zoomer.aspx

Code:
<%@ Page Language="C#" AutoEventWireup="true" Debug="true"  CodeFile="feedgen.aspx.cs" Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body bgcolor="#ffffff">
    <form id="form1" runat="server">

    </form> all other code etc etc

feedgen.aspx.cs which writes the XML file (the xml is needed for flash to display the image as zoom)

Code:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
etc etc
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MakeCode();
    
    protected void MakeCode()
    {
        XmlTextWriter writer = new
		XmlTextWriter(Server.MapPath("product.xml"), Encoding.UTF8);
        //writer.WriteStartDocument();
        //writer.WriteWhitespace("\n");
		//writer.WriteStartElement("zoomer");
        writer.WriteRaw("<zoomer>");
        writer.WriteWhitespace("\n");
        writer.WriteWhitespace("\n");
		writer.WriteRaw("<imagePath value =   <%=Replace(Request.QueryString, "image=", "")%> ); etc etc
This has to right the XML

Code:
<zoomer>
<imagePath value="product.jpg"/>
<viewportWidth value="275"/>
<viewportHeight value="254"/>
etc etc
</zoomer>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-18-09, 05:03 AM
omniman's Avatar
omniman omniman is offline
Coding Addict
 
Join Date: Aug 2006
Location: Baltimore, MD
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
You can use the double quotes, but you need to escape them with a backslash:


Code:
 writer.WriteRaw("<imagePath value=\"product.jpg\" />");
__________________
"Political Correctness is a doctrine, fostered by a delusionary, illogical, liberal minority and rabidly promoted by an unscrupulous mainstream media, which holds forth the proposition that it is entirely possible to pick up a turd by the clean end."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

Tags
writeraw, xml, xmltextwriter


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ and MSSQL tutorials? scott2500uk C/C++ 8 05-11-09 03:33 AM
Need free compiler suggestion leoneo11 C/C++ 3 05-19-06 06:12 AM
Help me Choose a Compiler MaxS C/C++ 2 12-02-04 09:35 AM
C++ Compiler Lowell C/C++ 5 09-04-04 03:30 PM
C++ compiler Lowell C/C++ 2 08-11-04 12:16 AM


All times are GMT -5. The time now is 05:00 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.