View Single Post
  #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>
Reply With Quote