Wednesday, March 28, 2012

Difference betwwen CTP and beta 1 with GetPostBackEventReference

Hello,

Last week I have create a page with a gridview with textbox in the header row create dynamically.

For each textbox, I had this code in the creating code :

PostBackOptions postBackOptions =new PostBackOptions(oTextBox);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));

With this code, when I make a keyup in a textbox, the gridview is refresh in "Ajax mode" but now, with the Beta 1, the entire page is postaback.

Can you know why ?

PostBackOptions postBackOptions =new PostBackOptions(oGridView);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));


hello,

can you show us the code that is not working?


Hi,

I had a similar problem, but after stepping through the new JavaScript libraries, I came to the conclusion that it was because the control passed to the PostBackOption constructor is not itself inside the UpdatePanel.

Moving it inside the UpdatePanel solved the problem.

Hope this helps,

Bo

No comments:

Post a Comment