Update and read fast a list in Sharepoint
I have a webpart with this behaviour:
To read the value I have a function inside CreateChildControls
protected override void CreateChildControls() {
readList()
...
otherStuff
}
and to save the value I have a hiddenField, that executes the save function when changes the value:
hiddenField.ValueChanged += new System.EventHandler(functionThatSavesTheValue);
Then when the user accept the message of the popup, I change the value of the hiddenField via javascript, to execute the functionThatSavesTheValue
button.value = '1' + button.value;
Since here, all works fine.
The problem is if I reload the page just after push the button.
In that case, the function that reads the list executes before the function that saves the value, and I get wrong values. What can I do to fix this?
您可以使用CreateChildControls来初始化您的控件并阅读OnPreRender中的列表。
链接地址: http://www.djcxy.com/p/57814.html上一篇: 无法读取Cookie