XSLT and asp.NET mixture
-
Hello there. My question is kinda hard to explain, I know. But I'll give it a shot. Hope it works:) I have a page(product.aspx) with is formed by an xslt and this xslt gets the values from product.xml.
protected void Page\_Load(object sender, EventArgs e) { string bebek = Request.QueryString\["id"\]; XmlDocument xdoc = new XmlDocument(); xdoc.Load(Server.MapPath("product.xml")); XslCompiledTransform xsltran = new XslCompiledTransform(); xsltran.Load(Server.MapPath("pdetail.xsl")); xsltran.Transform(xdoc, null, Response.Output);
Not, somehow I managed to link the products with a link like detail.aspx?id={product id, lets say 2}. Now I created a page named detail.aspx, getting the id of the product and trying the same method to construct the sheet. Here is my code at pdetail.xsl which need some aid:) <xsl:for-each select="root/product/pid="'id'"> i tried <xsl:for-each select="root/product/pid="{id}"> but i wont work. I will sort the data with the id which I aim to retrieve by the link. Some of you might say, "dont be a noob, just use asp.net facilities to make it." :) you might be right but I am not that hard coder here. phew...hope I made it clear:confused: ps: I use C# for .Net.
-
Hello there. My question is kinda hard to explain, I know. But I'll give it a shot. Hope it works:) I have a page(product.aspx) with is formed by an xslt and this xslt gets the values from product.xml.
protected void Page\_Load(object sender, EventArgs e) { string bebek = Request.QueryString\["id"\]; XmlDocument xdoc = new XmlDocument(); xdoc.Load(Server.MapPath("product.xml")); XslCompiledTransform xsltran = new XslCompiledTransform(); xsltran.Load(Server.MapPath("pdetail.xsl")); xsltran.Transform(xdoc, null, Response.Output);
Not, somehow I managed to link the products with a link like detail.aspx?id={product id, lets say 2}. Now I created a page named detail.aspx, getting the id of the product and trying the same method to construct the sheet. Here is my code at pdetail.xsl which need some aid:) <xsl:for-each select="root/product/pid="'id'"> i tried <xsl:for-each select="root/product/pid="{id}"> but i wont work. I will sort the data with the id which I aim to retrieve by the link. Some of you might say, "dont be a noob, just use asp.net facilities to make it." :) you might be right but I am not that hard coder here. phew...hope I made it clear:confused: ps: I use C# for .Net.
ceviz wrote:
"dont be a noob, just use asp.net facilities to make it."
Yes, exactly. Use a repeater, datalist, datagrid, whatever and set the datasource to your xml file.
ceviz wrote:
am not that hard coder here.
Then learn. The tools are there to help you work smarter so you don't have to do it the hard way.
I know the language. I've read a book. - _Madmatt
-
Hello there. My question is kinda hard to explain, I know. But I'll give it a shot. Hope it works:) I have a page(product.aspx) with is formed by an xslt and this xslt gets the values from product.xml.
protected void Page\_Load(object sender, EventArgs e) { string bebek = Request.QueryString\["id"\]; XmlDocument xdoc = new XmlDocument(); xdoc.Load(Server.MapPath("product.xml")); XslCompiledTransform xsltran = new XslCompiledTransform(); xsltran.Load(Server.MapPath("pdetail.xsl")); xsltran.Transform(xdoc, null, Response.Output);
Not, somehow I managed to link the products with a link like detail.aspx?id={product id, lets say 2}. Now I created a page named detail.aspx, getting the id of the product and trying the same method to construct the sheet. Here is my code at pdetail.xsl which need some aid:) <xsl:for-each select="root/product/pid="'id'"> i tried <xsl:for-each select="root/product/pid="{id}"> but i wont work. I will sort the data with the id which I aim to retrieve by the link. Some of you might say, "dont be a noob, just use asp.net facilities to make it." :) you might be right but I am not that hard coder here. phew...hope I made it clear:confused: ps: I use C# for .Net.