How to maintain "session" state or the like for a show/hide menu when I click a sub link from an open block of sub category, like the one The Code Project did it on the left menu panel.
For example, if I click on "Web Development" link under "ARTICLES" category, it will show many links under the "Web Development" block. Click on a link in that open block, the page will refresh and show me article I wish to view. The problem I have is I can't figure out how to maintain session of the link I just clicked. That is keep the block "Web Development" open after the page refreshes.
I mean say you have a page called submitRequest.aspx
Now from your Asp page use:
<form action ="submitRequest.aspx" >
thus when the page is posted back it goes to submitRequest.aspx. You can get each of those form elements using Request object from submitRequest.aspx (even the IFrame) where page is your custom handler.
You can also use a class which inherits from IHttpHandler to call its process request.
I'm grateful for your answers, but I'm rather new to asp.net. How should I write to get a hold of the iframe. The iframe have id="left" in the asp page. But when I try Request["left"], I get null. And how am I going to change the src of the iframe.
I have already made this using Silverlight. There are lots of examples as well.
In case of normal ASP.NET, I guess you need to use SetInterval and continuously ping to an address to get update and update the chat window accordingly.
I guess you need to use SetInterval and continuously ping to an address to get update and update the chat window accordingly.
How do you ping to an address from JS?
This is not how web chat works. There should be a server and both clients will be connected to this server. The messages sent by both clients will be updated on the server and client just have to poll the server to get the message.
In the response from the server, I can see the new comment div added but the actual HTML of the page isn't updated, even though I've explicitly called updateComments.Update();.
The strange thing is if I do not do any AJAX/partial page postbacks before adding a comment via the button click, it works fine but after any AJAX/partial page postback (like adding a second comment without refreshing the page) I will see the new comment in the AJAX Response, but the HTML on the page isn't changed. Does anyone know why this is happening?
Probably not the case but I see that your UpdatePanel is set to ConditionalUpdate referring to btnSubmit's onclick event. OnClick is set to "btnSubmit_Click" however your update logic is within "button_click"!
Also, if above is not true, what exactly is Save() function doing which is being called onClientClick?
Thank you for the fast reply, alas I just 'shortcuted' the text to make it more readable, yes the button_Click method is actually btnSubmit_Click. I was just trying to follow the guidelines and make the code as small as possible.
The update panel is set to conditional, and at the very end of the event handler you will notice I called updateComments.Update();.
I am using tinyMCE inside the update panel (<uc1:xmsRichEditor ID="xmsRichEditor1" runat="server" UseFullEditor="false" />) and in order to reset the textbox with the value inside tinyMCE I need to do the following before posting back to the server:
document.getElementById("aspnetForm").elements["<%= xmsRichEditor1.UniqueID %>"].value = tinyMCE.get('<%= xmsRichEditor1.ClientID %>').getContent(); //this code works perfectly fine, has been for a while<br />
The thing is that If I add one comment, the AJAX postback works, and the new comment is added in a new div inside of divComments (divComments.Controls.Add(divComment);). But after posting one comment, if I try to post another one the Response I receive from the server (using firebug to inspect it) has the new divComment in the response html, but the html is never actually injected into the DOM.
To make sure that there was not some unhandled exception, I debugged the code. It works identically both times, and the Response from the server is identical each time (except the second time it includes a new div with the second comment) though the html in the update is not refreshed on the second postback.
Yeah I didn't think that was the case but I just wanted to make sure. Sometimes small things like that can cause major issues
Also, I looked at your website ... nice design. Unfortunately I wasn't able to get much in terms of, behavior or test data, from the comment page as I wasn't able to add a comment at all. It seemed like it worked at first but then I kept getting a 404 error.
I have never worked with tinMCE .... but if time allows I'll try to download tinyMCE and see if I can get it to work in a relatively simpler example similar to yours. Sorry wish I could be of more help.
Last Visit: 31-Dec-99 19:00 Last Update: 2-Dec-23 18:21