Ljudi pomagajte,treba mi dobar ASP.NET programer za savet,ne mogu da provalim gde gre

Vselak

Obećava
Poruka
68
Evo i koda koji me muci,znam da je prost,ali crkoh nervirajuci se:

Evo problema:
Xml kod izgleda ovako:

<?xml version="1.0"?>
<Entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Title>Hello!</Title>
<Details>These are the details of the ulaza</Details>
<Entry>

Koda za Global.asax,ovako:

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.IO;
using System.Xml.Serialization;

namespace WebApplication1
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// Required designer variable.
/// </summary>
/// members...
public static String EntryFilePath;
private System.ComponentModel.IContainer components = null;

public Global()
{
InitializeComponent();
}

protected void Application_Start(Object sender, EventArgs e)
{
//postavljamo putanju deljenog clana...
EntryFilePath=Server.MapPath("Entries");

}

protected void Session_Start(Object sender, EventArgs e)
{

}

protected void Application_BeginRequest(Object sender, EventArgs e)
{

}

protected void Application_EndRequest(Object sender, EventArgs e)
{

}

protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{

}

protected void Application_Error(Object sender, EventArgs e)
{

}

protected void Session_End(Object sender, EventArgs e)
{

}

protected void Application_End(Object sender, EventArgs e)
{

}
public static Entry LoadEntry(String filename)
{
String filepath=EntryFilePath+"\\" +filename;
FileStream file = new FileStream(filepath,FileMode.Open);
XmlSerializer serializer=new XmlSerializer(typeof(Entry));
Entry newEntry=(Entry)serializer.Deserialize(file);
file.Close();

return newEntry;
}

Za klasu Entry.cs,ovako:

using System;
using System.IO;
using System.Xml.Serialization;

namespace WebApplication1
{
/// <summary>
/// Summary description for Entry.
/// </summary>
public class Entry
{
//members...
public DateTime_timestamp;
public String_title;
public String_details;
[XmlIgnore()] public DateTime Timestamp
{
get
{
return_timestamp;
}
set
{
_timestamp=value;
}
}
public String Title
{
get
{
return_title;
}
set
{
_title=value;
}
}
public String Details
{
get
{
return_details;
}
set
{
_details=value;
}
}
public Entry()
{
//
// TODO: Add constructor logic here
//
}

Za WebForm1.aspx.cs ovako:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebApplication1
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label labelServerPath;
protected System.Web.UI.WebControls.Label labelEntryTitle;
protected System.Web.UI.WebControls.Label labelEntryDetails;
protected System.Web.UI.WebControls.Label labelCopyright;

private void Page_Load(object sender, System.EventArgs e)
{
// koja je godina?
int year = DateTime.Now.Year;
if(year==2001)
labelCopyright.Text="Copyright &copy; Disraeli "+year;
else
labelCopyright.Text="Copyright &copy;Disraeli 2001-"+year;
//Postavljamo putanju servera...
labelServerPath.Text=Global.EntryFilePath;
Entry entry=Global.LoadEntry("Entry.xml");
labelEntryTitle.Text=entry.Title;
labelEntryDetails.Text=entry.Details;

}

Za WebForm1.aspx,ovako:

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<div>Disraeli's Weblog
</div>
<br>
<div>
<asp:Label id="labelEntryTitle" runat="server">entryTitle</asp:Label></div>
<div>
<asp:Label id="labelEntryDetails" runat="server">entryDetails</asp:Label></div>
<div>&nbsp;
<asp:label id="labelCopyright" runat="server">copyright</asp:label></div>
<br>
<div>
<asp:Label id="labelServerPath" runat="server">serverpath</asp:Label>
</div>
</form>
</body>
</HTML>

Dobijam izvestaj o gresci ovakav:

c:\inetpub\wwwroot\WebApplication1\Entry.cs(15): Invalid token ';' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\Entry.cs(14): Invalid token ';' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\Entry.cs(13): Invalid token ';' in class, struct, or interface member declaration

A u explorer-u to izgleda ovako:

Disraeli's Weblog

entryTitle
entryDetails
Copyright ©Disraeli 2001-2007

c:\inetpub\wwwroot\WebApplication1


Zasto mi necita podatke iz Xml-koda: <Title>Hello!</Title>
<Details>These are the details of the ulaza</Details>
Nego mi izbacuje:

entryTitle
entryDetails

Upomoc!!!!! :confused:
 

Back
Top