|
It is difficult to say, but I don't think it is a cache problem. How do you pass values from one page to another? Can you paste a code here (redirection and value storing/passing from page A and value reading from page B)?
Pilo
|
|
|
|
|
Hello,
Could someone tell me how to convert a XML file into another XML file using a XSL file with a parameter? I created the code to do it, and it seems ok, but it is not working.
Could somebody, please, help me out? I am on this for days.
My code is as follows:
Dim webSiteMap As XmlDocument = New XmlDocument
webSiteMap.Load(HttpContext.Current.Server.MapPath("~/INPUT.XML"))
Dim googleXsl As XslCompiledTransform = New XslCompiledTransform
googleXsl.Load(HttpContext.Current.Server.MapPath("~/CONVERT.XSL"))
Dim googleXslArguments As XsltArgumentList = New XsltArgumentList
googleXslArguments.AddParam("Domain", "", "http://www.domain.com")
Dim webSiteMapStream As MemoryStream = New MemoryStream
googleXsl.Transform(webSiteMap, googleXslArguments, webSiteMapStream)
context.Response.Clear()
context.Response.ContentType = "text/xml; charset=utf-8"
context.Response.Write(Encoding.UTF8.GetString(webSiteMapStream.GetBuffer))
context.Response.End()
Thanks,
Miguel
|
|
|
|
|
shapper wrote: but it is not working.
You'll have to provide more detail than this. Is an exception being thrown? Is the transform not happening? Is it happening but you don't get the expected results?
only two letters away from being an asset
|
|
|
|
|
Han,
C# for me is fine. I will do any conversion to VB.Net.
Anyway, I tried your suggestion and it still doesn't work.
Anyway, I am posting my XSL and XML files as well the new version of my VB.NET (I also post the conversion to C# using the VB.NET to C# converter available in http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx)
The error I am getting is:
XML Parsing Error: not well-formed
Location: http://localhost:1132/GaragemRamos%202006a/Google
Line Number 2, Column 62:<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" />
Thanks,
Miguel
--------- XSL CODE ---------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:dk="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="WebSiteUrl"/>
<xsl:template match="dk:*"/>
<xsl:template match="@*|text()|comment()"/>
<xsl:template match="/">
<xsl:element name="urlset">
<xsl:apply-templates select="//dk:siteMapNode[@google='true']"/>
</xsl:element>
</xsl:template>
<xsl:template match="dk:siteMapNode">
<xsl:element name="url">
<xsl:element name="loc">
<xsl:value-of select="$WebSiteUrl" />
<xsl:value-of select="substring(@url, 3)"/>
</xsl:element>
<xsl:element name="lastmod">
<xsl:value-of select="@lastmod"/>
</xsl:element>
<xsl:element name="changefreq">
<xsl:value-of select="@changefreq"/>
</xsl:element>
<xsl:element name="priority">
<xsl:value-of select="@priority"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
--------- VB.NET Code ---------
' Create ASP.NET web site map
Dim webSiteMap As XmlDocument = New XmlDocument
' Load ASP.NET's site map
webSiteMap.Load(HttpContext.Current.Server.MapPath("~/Web.sitemap"))
' Create google xsl document
Dim googleXsl As XslCompiledTransform = New XslCompiledTransform
' Load google xml document
googleXsl.Load(HttpContext.Current.Server.MapPath("~/SiteMap.xsl"))
' Create xsl arguments list
Dim googleXslArguments As XsltArgumentList = New XsltArgumentList
googleXslArguments.AddParam("WebSiteUrl", "", "http://www.mydomain.com")
' Create the ASP.NET's site map memory stream
Dim googleSiteMapStream As MemoryStream = New MemoryStream
' Transform Asp.Net's site map to Google's site map and add it to stream
googleXsl.Transform(CType(webSiteMap, XPath.IXPathNavigable), googleXslArguments, googleSiteMapStream)
' Flush google site map stream
googleSiteMapStream.Flush()
' Set google site map stream position to 0
googleSiteMapStream.Position = 0
' Output Google sitemap
context.Response.Clear()
context.Response.ContentType = "text/xml; charset=utf-8"
context.Response.Write(Encoding.UTF8.GetString(googleSiteMapStream.GetBuffer))
context.Response.End()
--------- C# CODE ---------
XmlDocument webSiteMap = new XmlDocument();
webSiteMap.Load(HttpContext.Current.Server.MapPath("~/Web.sitemap"));
XslCompiledTransform googleXsl = new XslCompiledTransform();
XsltArgumentList googleXslArguments = new XsltArgumentList();
googleXslArguments.AddParam("WebSiteUrl", "", "http://www.mydomain.com");
MemoryStream googleSiteMapStream = new MemoryStream();
googleXsl.Transform(((XPath.IXPathNavigable)(webSiteMap)), googleXslArguments, googleSiteMapStream);
googleSiteMapStream.Flush();
googleSiteMapStream.Position = 0;
context.Response.Clear();
context.Response.ContentType = "text/xml; charset=utf-8";
context.Response.Write(Encoding.UTF8.GetString(googleSiteMapStream.GetBuffer));
context.Response.End();
--------- XML File (Web.sitemap) ---------
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns="http://schemas.microsoft.com/ASPNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url="~/Default.aspx"
title="Home"
description="Desc1"
changefreq="daily"
lastmod="2006-11-01T20:25:42+01:00"
priority="1"
google="true" />
<siteMapNode
url="~/Company.aspx"
title="Company"
description="Desc2"
changefreq="daily"
lastmod="2006-11-01T20:25:42+01:00"
priority="0.2"
google="true" />
<siteMapNode
url="~/Contacts.aspx"
title="Contacts"
description="Contacts"
changefreq="daily"
lastmod="2006-11-01T20:25:42+01:00"
priority="0.4"
google="false" />
</siteMapNode>
</siteMap>
Well, that is all I think. I hope someone can help me out.
Thank You Very Much,
Miguel
|
|
|
|
|
Please,
Could someone help me out?
I just posted my entire code. I still wasn't able to solve my problem
Thank You Very Much,
Miguel
|
|
|
|
|
Hi,
I've created the following menu:
<asp:Menu id="Menu1" runat="server" Orientation="vertical" OnMenuItemClick="Menu1_MenuItemClick" DisappearAfter="0" StaticEnableDefaultPopOutImage="False" BorderWidth="0px" BorderStyle="None">
<DynamicHoverStyle BackColor="#6B96B5" />
<Items>
<asp:MenuItem Text="· HOME" NavigateUrl="~/index.aspx" Value="· HOME" />
<asp:MenuItem Text="· REFERENCE CENTER" Value="· REFERENCE CENTER">
<asp:MenuItem Text="· CUSTOMER TOOLS" Value="· CUSTOMER TOOLS" /> </Items>
<LevelMenuItemStyles>
<asp:MenuItemStyle BackColor="#084C82"
ItemSpacing="0px"
HorizontalPadding="6px"
VerticalPadding="4px"
BorderColor="Black"
BorderWidth="0px"
Font-Size="11px"
Font-Bold="True"
Font-Italic="False"
Font-Names="Verdana"
ForeColor="White" Font-Underline="False" />
<asp:MenuItemStyle BackColor="#084C82"
ItemSpacing="0px"
HorizontalPadding="6px"
VerticalPadding="4px"
BorderColor="Black"
BorderWidth="1px"
Font-Size="11px"
Font-Bold="True"
Font-Italic="False"
Font-Names="Verdana"
ForeColor="White" Font-Underline="False" />
</LevelMenuItemStyles>
<DynamicItemTemplate>
<%# Eval("Text") %>
</DynamicItemTemplate>
<StaticHoverStyle BackColor="#6B96B5" />
</asp:Menu>
But there's still ItemSpacing between the menu items. When I set the ItemSpacing to 10 in the MenuItemStyle above, it goes to 10 pixels, but it doesn't drop all the way down to 0 when I set it to that.
If I change the orientation to horizontal, it works correctly.
Any ideas?
Thanks.
|
|
|
|
|
Hai Friends
In my application, i have to Import the data from excel sheet to mysql and vice versa
i have one menu ,in that ,i will have too options
one is : Export
In this When i click on the Export Button, the data to be stored in Excel sheet(mysql to Excel)
Second one is : Import
when i click on it , it will show one browse button, by selecting particular excel sheet,
when i click on import in this page, that data in that excel sheet to be stored in database
please help me how to do it in asp.net
Kishore Kumar
|
|
|
|
|
|
I want to build a page like pp2g (www.pp2g.com) for school assigment.
can someone please help me? what do I need and whst is the best way to build such a site?
I have Visual Stodio .net 2003.
tinx Saeed
Saeed
|
|
|
|
|
Saeed,
It's better for you to download and install the Visual Web Developer (VWD) from Microsoft's website (it's free) as your development environment. To learn how to build a basic site, visit http://www.learnvisualstudio.net/Free.aspx[^]
Just make sure you have .Net 2.0 Framework and IIS 6.0 installed on your development machine BEFORE installing VWD. This should be enough for now!
Nila
|
|
|
|
|
I know how to build a basic site, but the problem is that i want to build a site with the follwing contents:
a page that users can edit thier profile
and that they can upload photo's
and able to chat
i have build the pages, but I dont know how to let them work properly: for examp: if they edit thier page in de edit mode, that de settings appaers on thier page.
and they should be ebale to edit thier page in HTML.
can u help me?
Saeed
|
|
|
|
|
When is your assignment due? I am in the middle of work right now but I can help you over the weekend. Let me know.
Nila
|
|
|
|
|
I have 3 weeks left. you can also add me on msn if you want to.
smgetaweh@hotmail.com , but I'm always on: thughgang@hotmail.com.
thanks.
Saeed
|
|
|
|
|
Sorry about the delays... didn't get notification email for your posting until today!
Web App Development 101 in a nutshell{
1) You have to figure out how you are going to store data.
2) Chances are, you will have to use a database of somekind... draw your tables, set your relations/PK/FK/etc.
3) Decide on how many pages you will have, and what will each do, and how they will interact with oneanother and the server.
4) ALWAYS start your design from the top, then start developing from the buttom. With that being said, start sketching your process flow charts and define data flow.
5) Start coding!
}
Now, how many pages will you have? Will you need to use a masterpage to display certain things at all times (e.g. login)? Are you going to use a theme? Take a look at this when you get a chance:
http://www.asp.net/downloads/starterkits/default.aspx?tabid=62
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
No need to say sorry
I have put few things on paper and I would like to send then to you. could I have your mail?
because I can't cant it through this MessageBOX.
my mail is smgetaweh@hotmail.com
saeed
Saeed
|
|
|
|
|
Cool, zip'em and send to NightHawk13@hotmail.com
Did you, by and chance, find a template that would work for you?
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
I have not yet find a Template..
Im not that good at designen..
saeed
Saeed
|
|
|
|
|
Out of curiosity, which school do you attend?
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
Hi guys, i have an edit LinkButton which display a update panel with some lables and textfields in it. I want to display some values in the textFields before the updatePanel comes on the screen. I am basically, creating an updatepage which should first display the exisiting values.
When i click on editQuestionLnkBtn it calls below ajax and this code display a panel.
All i want is before editQuestionLnkbtn calls this ajax i want to initialize some values of this panel and then display the page
<atlas:modalpopupproperties id="mp10" targetcontrolid="editQuestionLnkBtn" popupcontrolid="panelUpdateMcQ" cancelcontrolid="btnCancelUpdateMcQ" backgroundcssclass="modalBackground" dropshadow="True">
|
|
|
|
|
Hello,
I am trying to send an email from a form in my web page.
I have the following codes:
...
Dim mailSettings As New System.Net.Configuration.MailSettingsSectionGroup
Dim smtpClient As New System.Net.Mail.SmtpClient
smtpClient.Host = mailSettings.Smtp.Network.Host
smtpClient.UseDefaultCredentials = False
smtpClient.Port = mailSettings.Smtp.Network.Port
smtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
smtpClient.Credentials = New System.Net.NetworkCredential(mailSettings.Smtp.Network.UserName, mailSettings.Smtp.Network.Password)
smtpClient.Send(message)
...
And in my Web.Config file I have:
<system.net>
<mailSettings>
<smtp deliveryMethod = "network">
<network defaultCredentials = "true"
host = "mail.domain.com"
password = "secret"
port = "25"
userName = "user@domain.com" />
</smtp>
</mailSettings>
</system.net>
I am getting the error:
"ConfigurationSectionGroup cannot be edited before being added to a section group belonging to an instance of class Configuration"
I looked for a solution all day and I can't solve this.
Could someone tell me what am I doing wrong here?
Thanks,
Miguel
|
|
|
|
|
The error is telling you to make sure it's inside the Configuration tag. Is it wrapped?
|
|
|
|
|
If it is embedded, find the following in your config file
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
and change it to this
<configuration>
see if that works.
|
|
|
|
|
I can't see what you posted but yes it is wrapped in <configuration> tags.
|
|
|
|
|
I added spaces, so it will be displayed.
If it is embedded, find the following in your config file
< configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" >
and change it to this
< configuration >
see if that works.
|
|
|
|
|
I solved it this way:
' Create and define the SMTP client
Dim smtpClient As New System.Net.Mail.SmtpClient
' Create access to configuration file
Dim configurationFile As Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/Web.Config")
' Create mail settings section group
Dim mailSettings As System.Net.Configuration.MailSettingsSectionGroup = configurationFile.GetSectionGroup("system.net/mailSettings")
' Define smtp client properties
If Not mailSettings Is Nothing Then
With smtpClient
.Port = mailSettings.Smtp.Network.Port
.Host = mailSettings.Smtp.Network.Host
.Credentials = New System.Net.NetworkCredential(mailSettings.Smtp.Network.UserName, mailSettings.Smtp.Network.Password)
End With
End If
Thanks,
Miguel
|
|
|
|