Question

im new to ASP.NET and i have a problem with the Viewstate and Clientscript. I have created a Custom ASP Panel with some Javascript (this is just an example):

public class MyPopup : Panel {
        string Script = "$(#'{0}').dialog();";
        protected override void OnLoad( EventArgs e ) {
            base.OnLoad( e );
            ScriptManager.RegisterStartupScript( this, this.GetType(), "MyKey", string.format(this.Script, this.Id), true );
        }
    }

<myControl:MyPopup id="test" runat="server">
   <asp:TextBox id="test2" runat="server" />
</myControl:MyPopup>

when a event is raised the value from the Textbox isnt persited in the viewstate / always empty. All other working correctly. When i remove scriptmanager all works fine.

i hope someone can help me...

btw: i dont have problems with jquery the dialog is showing correctly just the values of the child controls are not persisted in the viewstate!

Était-ce utile?

La solution

The problem here is that jquery dialog is removing your DIV from inside your form. Here is a link that should help you.

jQuery modal window removes elements from my form

Cheers

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top