|
Thanks Navaneeth. ProgressHelper is my internal DAL responsible for udpating the progress table (sorry I should have explained). I agree with you that BackgroundWorker is a bad idea that's why I was wondering if there might be a better way to accomplish this.
Also, what are your thoughts about Async Delegates? Have you seen any adverse effects of using them in ASP.NET?
Appreciate your hlep!
|
|
|
|
|
student_rhr wrote: I agree with you that BackgroundWorker is a bad idea that's why I was wondering if there might be a better way to accomplish this.
See the point 1 in my first reply.
student_rhr wrote: Also, what are your thoughts about Async Delegates? Have you seen any adverse effects of using them in ASP.NET?
Asynchronous pattern will make your code unnecessarily complicated. So I'd stay away from it unless there is a strong need for using it. As I said, work with Thread or ThreadPool directly.
Best wishes,
Navaneeth
|
|
|
|
|
Hi,
I need to develope web site which connect to the pop3 mail server and populate all emails in a grid.
so after user can select emails from grid and can delete unnecessary mails through grid.
i have search lot of samples most of them are windows based.does any body know or can direct me to correct path.
i'm using .net 3.5 with sql server 2008.
thankx
|
|
|
|
|
It makes no difference. your web page, on postback, can use the same code to check mail and populate the page with the results.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can any u provide few examples...
|
|
|
|
|
You said you found lots of them on the web, so why would you need more ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You can connect to a pop3 server using a TCP connection. Once the connection established, there are a set of commands to communicate with pop3 server. There is an RFC[^] for these commands.
|
|
|
|
|
Hi All,
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.
Thank you.
|
|
|
|
|
What is the problem with that. Use hiddenfield to get it.
Or rather you could get the group where the user clicked from its url as well...
|
|
|
|
|
Hi
I have en Asp file lcon.asp in my website project, where I use an Iframe. I want to be able to use the iframe in the code behind from another aspx page.
<iframe runat =server id="left" src="ShowGroups.aspx" scrolling="no" frameborder="0" width="100%" height="1000"></iframe>
I would like to do something like this.
protected System.Web.UI.HtmlControls.HtmlGenericControl frame1;
HtmlControl frame1 = (HtmlControl)this.FindControl("left");
frame1.Attributes["src"] = "http://search.msn.com";
But if there is another way to refresh the iframe, please tell me.
Fia
|
|
|
|
|
I don't want to use javascript.
|
|
|
|
|
AFAIK ... no wayout other than javascript. At least the page should be posted back to the aspx page to get the iframe.
You need to use custom handler to do this as your actual page is asp.
Why dont you convert the asp page to aspx then.
|
|
|
|
|
Thank's for your answer, but I can't convert or not allowed to convert tha asp page to aspx. What do you mean by post back to the aspx page. And what is custom handler.
Fia
|
|
|
|
|
I mean say you have a page called submitRequest.aspx
Now from your Asp page use:
<br />
<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.
On the other hand, how could you access the iframe from the server side, if your actual parent page is made using asp. You better use javascript to get reference from Iframe if you do require.
I hope you got my point.
|
|
|
|
|
Hi again
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.
Hope you have time to help me more
Fia
|
|
|
|
|
I think you need to use Javascript to communicate between the two pages, one the page that is loaded in iFrame and another is what is written in asp.
If you can submit the asp page in a handler custom handler and access Request.Params to get the controls.
|
|
|
|
|
Hi again
Do you have any code so I can see what I have to do. I don't know how to submit a page and I don't know how to use a custom handler. I have googled, but havent found anything I can use.
Regards
Fia
|
|
|
|
|
I m new in web application also in asp dotnet application .... In my Test application , i would like to create a chat application... Give some tips and valid tutorial
Thanks
|
|
|
|
|
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.
Use this tutorial for help :
Simple Chat Application in ASP.NET[^]
Cheers
|
|
|
|
|
Abhishek Sur wrote: 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.
Best wishes,
Navaneeth
|
|
|
|
|
By the sentence I meant to create one XmlHttp object and ping the server for the update. From the other end if some update is made to the server, it will get it .
N a v a n e e t h wrote: 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.
So, this is what exactly I meant.
Cheers.
|
|
|
|
|
Google[^] would be a good place to start. Plenty of samples out there if you are prepared to do a tiny bit of research.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hello fellow coders,
I am having a strange problem which I've never run in to previously.
The Problem:
I am getting back the new HTML in the AJAX postback, but the DOM / page isn't updating.
How it happens::
Whenever a user clicks the button 'Add Comment' the the following code is called:
<br />
button_click(...)<br />
{<br />
...<br />
IXmsComment cmt = new IXmsComment();<br />
cmt.content = content;<br />
cmt.date = DateTime.Now;<br />
cmt.username = tbxUsername.Text;<br />
AddComment(cmt);<br />
if (divComments.Visible == false)<br />
divComments.Visible = true;<br />
updateComments.Update();<br />
}<br />
<br />
... AddComment(IXmsComment cmt)<br />
{<br />
HtmlGenericControl divComment = new HtmlGenericControl("div");<br />
HtmlGenericControl divAuthor = new HtmlGenericControl("div");<br />
HtmlGenericControl divDate = new HtmlGenericControl("div");<br />
HtmlGenericControl divDescrip = new HtmlGenericControl("div");<br />
divComment.Attributes.Add("class", "comment");<br />
divAuthor.Attributes.Add("class", "commentAuthor");<br />
divDate.Attributes.Add("class", "commentDate");<br />
divDescrip.Attributes.Add("class", "commentDescription");<br />
divAuthor.InnerText = cmt.username;
divDate.InnerText = cmt.date.ToString();
divDescrip.InnerHtml = cmt.content;
divComment.Controls.Add(divAuthor);<br />
divComment.Controls.Add(divDate);<br />
divComment.Controls.Add(divDescrip);<br />
divComments.Controls.Add(divComment);<br />
xms.Utils.scriptCalls.AnimateStatus(divComment.ClientID, updateComments);<br />
UpdateProgress1.Visible = false;<br />
}<br />
Here is the update panel html:
<br />
<asp:UpdatePanel ID="updateComments" runat="server" UpdateMode="Conditional"><br />
<Triggers><br />
<asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" /><br />
</Triggers><br />
<ContentTemplate><br />
<div id="divComments" class="commentCollection" runat="server"></div><br />
<div id="divNewComment" class="newComment" runat="server" visible="false"><br />
<fieldset><br />
<legend id="addCommentTitle" runat="server">Add Your Comment:</legend><br />
<table><br />
<tr><br />
<td><br />
<asp:Label ID="lblUsername" AssociatedControlID="tbxUsername" runat="server" Text="Your Username: "></asp:Label></td><br />
<td><br />
<asp:TextBox ID="tbxUsername" Enabled="false" runat="server"></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td><br />
<asp:Label ID="lblEmail" AssociatedControlID="tbxEmail" runat="server" Text="Your Email: "></asp:Label></td><br />
<td><br />
<asp:TextBox ID="tbxEmail" runat="server"></asp:TextBox><br />
<asp:RequiredFieldValidator ID="rfvEmail" runat="server" <br />
ControlToValidate="tbxEmail" ValidationGroup="CommentGroup"<br />
ErrorMessage="Email Address is required." Display="Dynamic" <br />
SetFocusOnError="True"></asp:RequiredFieldValidator><br />
<asp:RegularExpressionValidator ID="revEmail" runat="server"<br />
ControlToValidate="tbxEmail" ValidationGroup="CommentGroup" <br />
ErrorMessage="Invalid Email Address" Display="Dynamic" <br />
SetFocusOnError="True" <br />
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator><br />
<asp:CustomValidator ID="cvEmail" runat="server" Display="Dynamic" ControlToValidate="tbxEmail" ValidationGroup="CommentGroup" <br />
ErrorMessage="Email Address provided does not match the email address in our records for your user account. Please re-enter your email address." <br />
onservervalidate="cvEmail_ServerValidate" SetFocusOnError="True" ValidateEmptyText="true"></asp:CustomValidator><br />
<span class="req"></span></td><br />
</tr><br />
<tr><br />
<td><br />
<asp:Label ID="lblCaptcha" AssociatedControlID="imgCaptcha" runat="server" Text="Enter the text in the image:"></asp:Label></td><br />
<td><asp:Image ID="imgCaptcha" runat="server" /></td><br />
</tr><br />
<tr><br />
<td><br />
<asp:Label ID="lblCaptchaBox" AssociatedControlID="tbxCaptcha" runat="server" Text="Enter image text here:"></asp:Label></td><br />
<td><br />
<asp:TextBox ID="tbxCaptcha" runat="server"></asp:TextBox><br />
<asp:CustomValidator ID="cvCaptcha" runat="server" <br />
ControlToValidate="tbxCaptcha" ValidateEmptyText="true" ValidationGroup="CommentGroup"<br />
ErrorMessage="You must enter the text exactly as it appears in the image above." <br />
Display="Dynamic" onservervalidate="cvCaptcha_ServerValidate" <br />
SetFocusOnError="True"></asp:CustomValidator><br />
<asp:RequiredFieldValidator ID="rfCaptcha" ValidationGroup="CommentGroup" ControlToValidate="tbxCaptcha" SetFocusOnError="true" runat="server" ErrorMessage="Image verification is required."></asp:RequiredFieldValidator><br />
<span class="req"></span></td><br />
</tr><br />
<tr><br />
<td colspan="2" style="text-align:center;"><asp:Label ID="lblContent" AssociatedControlID="xmsRichEditor1" runat="server" Text="Your Comment:"></asp:Label></td><br />
</tr><br />
<tr><br />
<td colspan="2"><br />
<uc1:xmsRichEditor ID="xmsRichEditor1" runat="server" UseFullEditor="false" /><br />
</td><br />
</tr><br />
<tr><br />
<td> </td><br />
<td><br />
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="updateComments" runat="server"><br />
<ProgressTemplate><br />
<div style="width:100%; margin:0 auto;"><br />
<img runat="server" id="imgLoader" src="~/App_Themes/default/images/ajax-mini-loader.gif" alt="loading... please wait." title="loading... please wait." /><br />
</div><br />
</ProgressTemplate><br />
</asp:UpdateProgress> <br />
<asp:Button ID="btnSubmit" ValidationGroup="CommentGroup" CausesValidation="true" runat="server" Text="Add Comment" <br />
onclick="btnSubmit_Click" OnClientClick="Save();" /></td><br />
</tr><br />
</table><br />
<div id="divResult" class="status" runat="server" style="font-weight:bold;"></div><br />
</fieldset><br />
</div><br />
</ContentTemplate><br />
</asp:UpdatePanel><br />
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?
Thanks,
Shawn
|
|
|
|
|
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?
|
|
|
|
|
Hi Student
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:
<br />
document.getElementById("aspnetForm").elements["<%= xmsRichEditor1.UniqueID %>"].value = tinyMCE.get('<%= xmsRichEditor1.ClientID %>').getContent();
If you want to see this page in its live environment you can see it here: http://blabberjax.com/singlePage.aspx?id=3[^]
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.
modified on Monday, November 9, 2009 7:45 PM
|
|
|
|