Zugriff auf und Setzen von Variablen in einer Klasse einer anderen Klasse
Ich habe eine shopping_cart.aspx.cs-Datei und auch eine Klassendatei spcart.cs.
shopping_cart.aspx.cs
public partial class Ui_ShoppingCart : System.Web.UI.Page
{
public int tax = 0;
public int subtotal = 0;
public int granttotal = 0;
protected void Page_Load(object sender, EventArgs e)
{
-------------------------/////some code
}
--------------------------------/////some code
}
spcart.cs
public class Spcart
{
public void updatecart(int pid,int qty)
{
---------/////some code
}
}
Jetzt möchte ich einige Werte in setzenclass Ui_ShoppingCart
Variablen tax, subtoal & granttotals aus der Klasse Spcart, also hatte ich versucht ->
Ui_ShoppingCart.tax
aber es hat nicht funktioniert .........
Gibt es eine andere Möglichkeit, diese Variablen zu setzen?
kann mir jemand dabei helfen ???