views:

95

answers:

0

Hello all,

My problem is this, I'm a student, working on northwind. I've created an aspx page that deals with deferent xml/xsl results by just using sqlparams.

I need to preserve the state of the last querystring so that I could preserve the result set from the last aspx page in the next...and I just can't find a way to do it.....looking for it for a very long time before bothering you all..... The story is this:

  1. When pushing ComapanyID or SupplierID I'm getting all the categories or companies with that ID (working perfectly)

  2. when pushing one of the headlines I need to do the "order by" for that field (working in the SP. The problem is not over there) but need also to preserve the last state of the aspx page (the querystring before the actual one that is going to parse???) so I will not get all the 77 products from tblProducts, just the ones that when displayed before firing this page (not working...getting all the time, all the 77 records). I've tried deferent things in the "headlines" string, like: and more things like that (people write weird thing over the net) and nothing is working.....I don't know yet how to work with xsl templates or objects or anything like that (got the idea to pass the last querystring into the XSL File (CategoyID="ANY KING OF QUERYSTRING PASSING" but can't make it work)....

Can anyone please help me.....have any idea, in the XSL or in the ASPX files.... Last thing, The aspx file has a self biuld XMLHelper file and DBHelper file that get all the parameters and do the XML Transformation (just don't think the problem is over there). Thank you all in advance.....a lot :-)

Xsl File:

<xsl:template match="/">

    <table class="P10 AC">
        <tr class="B">
            <td><a href="Products.aspx?OrderBy=1">Product Id</a></td>
            <td><a href="Products.aspx?OrderBy=2">Product Name</a></td>
            <td><a href="Products.aspx?OrderBy=3">Unit Price</a></td>
            <td><a href="Products.aspx?OrderBy=4">Category Name</a></td>
            <td><a href="Products.aspx?OrderBy=5">Company Name</a></td>
        </tr>
        <xsl:for-each select="Products/Product">
            <tr>
                <td><xsl:value-of select="@ID"/></td>
                <td><xsl:value-of select="@Name"/></td>
                <td><xsl:value-of select="@Price"/></td>
                <td><a href="Products.aspx?CategoryID={@CategoryID}">
                    <xsl:value-of select="@CategoryName"/></a></td>
                <td><a href="Products.aspx?SupplierID={@SupplierID}">
                    <xsl:value-of select="@CompanyName"/></a></td>
            </tr>
        </xsl:for-each>

Aspx File:

protected void Page_Load(object sender, EventArgs e)
{

    XmlHelper.XslTransformation(
            sqlConn1.home,
            "spProductsByDynamicFiltersAndOrderBy_Select_XML",
            "XSLs/Products.xslt",
            XmlProducts,
            new SqlParameter("@OrderBy",Request.QueryString["OrderBy"]),
            new SqlParameter("@CategoryID",Request.QueryString["CategoryID"]),
            new SqlParameter("@SupplierID",Request.QueryString["SupplierID"])
            );
}