Cevaplar
-
public void FillLibrary()
{
string aaa = ViewState[PageVariableConst.Resim1];
}
olarak denermisin olmazsa
aaa = ViewState[PageVariableConst.Resim1];
olarak deneyin.-
siyahbeyaz
daha fazlası icin :
http://msdn.microsoft.com/en-us/library/system.web.ui.control.viewstate.aspx#Y45611 yıl önce yazılmış -
oguzmusa
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; Key = "Text"; SetViewState = 1111; Key = "Text1"; SetViewState = 123123123; } private object SetViewState { get { object o = ViewState[Key]; return (o == null) ? null : o; } set { ViewState[Key] = value; } } private string Key { get; set; } protected void btnYukle1_Click(object sender, EventArgs e) { Key = "Text"; object o1 = SetViewState; Key = "Text1"; object o2 = SetViewState; }
SetViewState değerini alıyorum.
ama bunu bir başka nesneye eşitleyince değerini alamıyorum.
Neden olabilir?
Senin verdiğin link çok açıklayıcı oldu. Ama gene geldik burada tıkandık.
Herkes yapar çalışır ben yaparım olmaz :)11 yıl önce yazılmış -
siyahbeyaz
{
if (IsPostBack)
return;
Key = "Text";
SetViewState = 1111;
Key = "Text1";
SetViewState = 123123123;
}
hocam bu nasıl bir mantık ya ne yaoarsan yap alacagi degerler en sondaki deger olur..
bu araya bir tampon koyman lazım if ile kontrol etmek gibi. bunlar dizin degil string olmus.. belki asp net ten anlamam ama kod mantıgını cok iyi bilirim.11 yıl önce yazılmış
-