Is the Format of my ASP.NET C# Script Ok? -
new c# working within construction of programme called "pageflex" has construction placed within of code below. main reason posting here create sure formatted script. please allow me know if looks formatted correctly. there site jsfiddle.net can utilize c#?
<script language="c#" runat="server"> string getuserid(pageflex.ur.storefront.data.storefrontapi isini) { homecoming isini.getvalue("systemproperty", "loggedonuserid", null); } int getshoppingcartcount() { pageflex.ur.storefront.data.storefrontapi isini = new pageflex.ur.storefront.data.storefrontapi(); string userid = getuserid(isini); string[] docsincart = isini.getlistvalue("userlistproperty", "documentsinshoppingcart", userid); homecoming (docsincart != null) ? docsincart.length : 0; } int getshoppingcarttotal() { pageflex.ur.storefront.data.storefrontapi isini = new pageflex.ur.storefront.data.storefrontapi(); string userid = getuserid(isini); string[] docstotalprice = isini.getlistvalue("documentproperty", "documentprice", userid); homecoming (docstotalprice != null) ? docstotalprice.length : 0; } void page_load(object sender, eventargs e) { if (!page.ispostback) { int documentprice = getshoppingcarttotal(); pricecart.text = shoppingprice.tostring(); int shoppingcount = getshoppingcartcount(); numcart.text = shoppingcount.tostring(); itemoritems.text = (shoppingcount == 1) ? "item" : "items"; } } </script>
things looks right me. may need declare methods public:
public int getshoppingcarttotal() { // logic }
but, may not have when you're code @ page level.
c# asp.net format
No comments:
Post a Comment