|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disappearing Web Part TrickHello, I'm pretty new to web part development. On playing around with this,
pretty much for the first time, I noticed that when I ran the page and closed the web part, on subsequent runs of the page, the web part remains resolutely closed. I also noticed that resetting the controls ID property at design time, and re-running the page caused them to reappear. Is this normal behaviour for web parts or am I cracking up? Is there a more elegant way to get your part to reappear after inadvertantly closing it during testing? -- Intrigued, Al Hi Al,
I hear ya! I ran into that same issue when I was working on the Web part chapter of ASP.NET 2.0 All-In-One Desk Reference For Dummies http://www.wiley.com/WileyCDA/WileyTitle/productCd-0471785989.html I added a button to the page and a little code to reset (ResetAllState) the state whenever I lost the parts. Here's the code from the book: <%@ Page Language="VB" %> <script runat="server"> Protected Sub Button1_Click _ (ByVal sender As Object, _ ByVal e As System.EventArgs) Dim intCount As Integer intCount = _ PersonalizationAdministration.ResetAllState _ (PersonalizationScope.User) Response.Redirect("starterpart.aspx") End Sub </script> <html> <head runat="server"> <title>Reset Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:button id="Button1" runat="server" onclick="Button1_Click" text="Reset" /> </div> </form> </body> </html> Let us know if this helps? Ken Microsoft MVP [ASP.NET] Show quoteHide quote "AL" <A*@discussions.microsoft.com> wrote in message news:517110A3-CBC8-4550-B24D-A582879FA6F7@microsoft.com... > Hello, I'm pretty new to web part development. On playing around with > this, > pretty much for the first time, I noticed that when I ran the page and > closed > the web part, on subsequent runs of the page, the web part remains > resolutely > closed. > > I also noticed that resetting the controls ID property at design time, and > re-running the page caused them to reappear. Is this normal behaviour for > web > parts or am I cracking up? Is there a more elegant way to get your part > to > reappear after inadvertantly closing it during testing? > -- > Intrigued, > > Al
Conditional True/False output for datalist item
error: can't find control 'mylabel' which expert can finally solve this? data inserted again after refresh Center Login Control and Firefox Admin front end generator How to access a server control within a repeater control Using Control.Render() from a page with a MasterPage tabbed pane mailing labels with asp.net report tool |
|||||||||||||||||||||||