{"id":45,"date":"2015-09-11T08:54:22","date_gmt":"2015-09-11T08:54:22","guid":{"rendered":"http:\/\/uysalyilmaz.com\/wordpress\/?p=45"},"modified":"2015-09-11T09:39:59","modified_gmt":"2015-09-11T09:39:59","slug":"public-list-in-viewstate","status":"publish","type":"post","link":"http:\/\/uysalyilmaz.com\/index.php\/2015\/09\/11\/public-list-in-viewstate\/","title":{"rendered":"public List<int> in viewstate"},"content":{"rendered":"<p>Do?ru Yaz?m:<\/p>\n<pre class=\"lang:c# decode:true\">public List&lt;int&gt; ImageString {\r\nget {\r\n    if (this.ViewState[\"ImageString\"] == null) {\r\n        this.ViewState[\"ImageString\"] = new List&lt;int&gt;();\r\n    }\r\n    return (List&lt;int&gt;)(this.ViewState[\"ImageString\"]);\r\n}\r\n set { this.ViewState[\"ImageString\"] = value; } \r\n}<\/pre>\n<p>Yanl?? Yaz?m:<\/p>\n<pre class=\"lang:c# decode:true \">public List&lt;int&gt; ImageString {\r\n    get {\r\n        if (this.ViewState[\"ImageString\"] != null) {\r\n            return (List&lt;int&gt;)(this.ViewState[\"ImageString\"]);\r\n        }\r\n        return new List&lt;int&gt;();\r\n    }\r\n    set { this.ViewState[\"ImageString\"] = value; }\r\n}<\/pre>\n<p>Bu listeye herhangi bir ekleme olmas? i\u00e7in ViewState&#8217;in \u00f6nceden var olmas? gerekir. E?er Bo??a olu?turulmas? gerekiyor. Daha sonra listeye istenen int de?erleri eklenebilir.<\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/7346203\/storing-an-listint-in-viewstate\" target=\"_blank\">Kaynak : Stackoverflow<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do?ru Yaz?m: public List&lt;int&gt; ImageString { get { if (this.ViewState[&#8220;ImageString&#8221;] == null) { this.ViewState[&#8220;ImageString&#8221;] = new List&lt;int&gt;(); } return (List&lt;int&gt;)(this.ViewState[&#8220;ImageString&#8221;]); } set { this.ViewState[&#8220;ImageString&#8221;] = value; } } Yanl?? Yaz?m: public List&lt;int&gt; ImageString { get { if (this.ViewState[&#8220;ImageString&#8221;] != null) { return (List&lt;int&gt;)(this.ViewState[&#8220;ImageString&#8221;]); } return new List&lt;int&gt;(); } set { this.ViewState[&#8220;ImageString&#8221;] = value; } } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17,18],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-asp-net-c","tag-list","tag-viewstate"],"_links":{"self":[{"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":5,"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":50,"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/posts\/45\/revisions\/50"}],"wp:attachment":[{"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/uysalyilmaz.com\/index.php\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}