|
C# Code for sending the mail automatically if the given time period is about to expire.Is there any option to send like that in asp.net,if there is an option,send it with explanation.
Thanks In advance
|
|
|
|
|
susmithansgi wrote: C# Code for sending the mail automatically if the given time period is about to expire.
What time period?
susmithansgi wrote: ,if there is an option,send it with explanation.
WOW! that's rude. Can't you be polite?
Now rephrase your question, so that we can understand it.
|
|
|
|
|
I am really very very sorry.I hurt u people very much.I was in such a hurry that,i did not notify that my question is missing the politeness.It was not at all my intention to hurt you people
I am sorry,Please don't mind.
|
|
|
|
|
Well, from what I understood from your question, you are looking some kind of scheduled tasks, right? ASP.NET can't do that. You can use any of the following option
1 - Create a windows service, install it on the server. This service should check for the period and send mail if required
2 - Create a console application which does this and exits automatically. Now schedule it using windows scheduler.
I'd prefer the second one and I think it will be efficient than the earlier one.
|
|
|
|
|
This is not even a question, it's a command. So, get stuffed. Now, do some reading, and if you still can't work it out, ask nicely. Remember, we're doing the work, but you're getting paid for it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: Remember, we're doing the work, but you're getting paid for it.
Nice one. Probably suitable for a sig
|
|
|
|
|
*grin* I thought it would be well received.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am really very very sorry.I hurt u people very much.I was in such a hurry that,i did not notify that my question is missing the politeness.It was not at all my intention to hurt you
I am sorry,Please don't mind.
|
|
|
|
|
provide detail information
Cheers!!
Brij
|
|
|
|
|
Why do you have a habit of posting after other people have helped, and saying the exact same thing that's already been said ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Modal dialog - can tite bar and status bar be removed? This is not doing the job.
<br />
var WinSettings = "center:yes;resizable:no;dialogWidth:750px;dialogHeight:250px;titlebar:No;status:no;help:no;"<br />
var MyArgs = window.showModalDialog("conventionalPopup.html?dest=Page1", MyArgs, WinSettings);<br />
dev
|
|
|
|
|
As for as ,I know the Title bar can not be removed.there are some security reasons invovlved.If you don't want title and status bar you can use normal popups using window.open.
Check this link too
[^]">
Cheers!!
Brij
|
|
|
|
|
hello - I've launched a modal dialog but opacity setting dont seems to work...
<br />
function showConventionalModalDialog()<br />
{<br />
var ParmA = retvalA.value;<br />
var ParmB = retvalB.value;<br />
var ParmC = retvalC.value;<br />
var MyArgs = new Array(ParmA, ParmB, ParmC);<br />
var WinSettings = "center:yes;resizable:no;dialogWidth:750px;dialogHeight:200px;filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;"<br />
var MyArgs = window.showModalDialog("conventionalPopup.html?dest=Page1", MyArgs, WinSettings);<br />
<br />
return;<br />
}<br />
Now in modal dialog body tag, I've added:
<br />
style="float:left;filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;"<br />
This seems to have made dialog "transparent" that content on the dialog is greyed out - but the modal dialog itself is 100% opaque.
Thanks!
dev
|
|
|
|
|
Hi All,
Im using C# , Visual Studio 2008, to learn a bit more about HTTP Modules and HTTP Handlers.
I understand why it is used for, however in trying to absorb the basics of the code it is a bit difficult.
Im trying to make a http module which recognizes session state management. Ie A user that must login with a password and if they login correctly then they have access to certain pages.
Another thing that springs to my curiousity is how you are able to establish the connection between the user interface(ie textbox values etc to what is specified in the http module), ie how do you make it work.
Can someone give me a rundown of how the above might work.
Regards
|
|
|
|
|
CrimeanTurtle2008 wrote: A user that must login with a password and if they login correctly then they have access to certain pages.
I don't think that HTTPModule is really needed for this. You can do this in the page level and I think that would be the appropriate choice than a HttpModule . This can be done by checking for the session in each page load which needs to be secured. More neat approach would be to create separate classes for secured and normal pages and derive your pages from it. You create two classes say NormalPage and SecuredPage both derived from System.Web.UI.Page
SecuredPage will have the session checking code. All the pages which needs to be secured, derive from SecuredPage . It's very easy to implement.
CrimeanTurtle2008 wrote: Another thing that springs to my curiousity is how you are able to establish the connection between the user interface
You don't access user interface elements from a HttpModule.
HttpModule sits in the request pipeline and allows programmers to examine the requests and take necessary actions if required. It is executed for every request. Most wide used example of HttpModules are URL-rewriting.
HttpHandler is responsible for handling the requests and supplying data. Assume you have to prevent access to all jpg files in your website, you can write a handler and hook the jpg extensions to this handler.
Hope this helps
|
|
|
|
|
Thanks very much for your help guys.
I understand the concepts but understanding the specific code in the event handlers is tricky.
Thanks
|
|
|
|
|
Hi All,
I have a form that has 2 datepicker controls on my form, like this -
<cc1:DatePicker id="dropoffdate" runat="server" imgDirectory="/images/" DateType="dd mmm yyyy"/>
<cc1:DatePicker id="pickupdate" runat="server" imgDirectory="/images/" DateType="dd mmm yyyy"/>
The forms method is POST and action is Backup.asp.
In Backup.asp this code loops through the forms controls that are in the forms _fieldorder.
<table cellpadding="0" cellspacing="0">
<tr>
<th colspan="2" valign="bottom">Thank you, the following information has been sent:/th>
<tr>
<% for each name in fieldOrder %>
<tr valign="top>
<td><strong><% = name %></strong></td>
<td><%= Request.Form(name) %>/td>
</tr>
<%next %>
</table>
When the code runs this is the result.
Thank you, the following information has been sent:
Fname deaanne cronin
email brownowl30@hotmail.com
homephone 02 65 433014
mobile 0427 190 676
Address 16 Edinglassie Drive Muswellbrook 2333 NSW
vehiclemake bhgv
model 123
series 456
year 1908
engine big
colour red
rego 0ld-mob
service Minor Service
comments test
dropoffdate
pickupdate
Drop_Off_Time 9:00 AM
Pick_Up_Time 12:30 PM
No dropoffdate or pickupdate is specified even though i entered one on the form datepicker controls. Can anyone help?
thanks
dee
modified on Tuesday, December 9, 2008 8:59 PM
|
|
|
|
|
Hi Everyone,
i finally found the answer on the page where i downloaded the control code.
had to refer to the control like this
request.form("dropoffdate$foo")
and it works then.
Hope this helps anyone that had the same problem.
dee
|
|
|
|
|
Thanks. Please don't use the "urgent" word when you post next time. This might be the reason that no one answered your question.
|
|
|
|
|
I've got an ASP .NET webpage with the following structure:
<asp:DataGrid ID="aGrid">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Repeater ID="aRepeater">
<HeaderTemplate>
<asp:Label ID="aLabel" Text='<%# DataBinder.Eval(Container.DataItem, "SomeColumn") %>'></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="aTextBox" AutoPostBack="true" OnTextChanged="SomeEvent"></asp:TextBox>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
The problem I'm having is that I would like to access the data that is stored in the label aLabel in the OnTextChanged event. What I'm doing to achieve this purpose is:
void SomeEvent(object sender, EventArgs e)
{
Repeater r = (sender as TextBox).Parent.Parent;
}
My assertion, however, fails, and even if I get aLabel.Text , it ends up being an empty string, since r.DataSource is null (despite the fact that in the ItemDataBound event of aGrid, I already bound the repeater to a data source). After some debugging, I noticed that Repeater r is not the same repeater as the one that I bound in the ItemDataBound event of aGrid, but how could that be? In the ItemDataBound event of aGrid, I do the following...
<br />
e.Item.FindControl("aRepeater") as Repeater;<br />
...which I assume should be equivalent to...
(sender as TextBox).Parent.Parent;
Sorry for the long post.
|
|
|
|
|
I hired a coder to take my access db to mssql db with asp.net forms. He is no longer in the
picture and I am getting errors when one of my forms generates an email.
I think I have isolated the part of the code with the problem, but please answer as if I am an idiot,
because in this area, I am. TIA
I get this error: Unable to read data from the transport connection: net_io_connectionclosed
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) If Me.ChangedLabel.Text = "Yes" Then Dim mailer As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient() If debug = False Then mailer.Send("registration@lmhsc.org", "EnrolleeUpdates@lmhsc.org", _ HttpContext.Current.User.Identity.Name &amp; ": this user has made changes to class registration for the " &amp; SessionNameLabel.Text &amp; " session.", _ "The above user has just registered for a new class. The " &amp; Me.FamLastNameLabel.Text &amp; " family has changed " &amp; numadded &amp; " student record(s).") Else mailer.Send("registration@lmhsc.org", "EnrolleeUpdates@lmhsc.org", _ HttpContext.Current.User.Identity.Name &amp; ": this user has made changes to class registration for the " &amp; SessionNameLabel.Text &amp; " session.", _ "The above user has just registered for a new class. The " &amp; Me.FamLastNameLabel.Text &amp; " family has changed " &amp; numadded &amp; " student record(s).") End If End If
--------------------------------------------------------------------------------
|
|
|
|
|
I'm afraid that hiring people via rentacoder almost always ends this way.
bjh29 wrote:
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.ChangedLabel.Text = "Yes" Then
Dim mailer As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient()
If debug = False Then mailer.Send("registration@lmhsc.org", "EnrolleeUpdates@lmhsc.org", _ HttpContext.Current.User.Identity.Name & ": this user has made changes to class registration for the " & SessionNameLabel.Text & " session.", _ "The above user has just registered for a new class. The " & Me.FamLastNameLabel.Text & " family has changed " & numadded & " student record(s).") Else mailer.Send("registration@lmhsc.org", "EnrolleeUpdates@lmhsc.org", _ HttpContext.Current.User.Identity.Name & ": this user has made changes to class registration for the " & SessionNameLabel.Text & " session.", _ "The above user has just registered for a new class. The " & Me.FamLastNameLabel.Text & " family has changed " & numadded & " student record(s).")
End If End If
Sending an email in the page unload seems a bit odd to me. I mean, I am not even sure what the control state would be at this point.
1 - You have a control called ChangedLabel and the text needs to be Yes, in that casing, yes and YES will fail. Is this right ?
2 - you have a debug flag in the program, if it's set to true, then the mail won't send.
3 - I don't see any code that sets up the mail server, so I don't think this code would work.
4 - the email addresses are all hard coded, as is the message, making it harder to change them later, this is an example of the terrible quality of work you get when you pay someone in India peanuts to do a job, especially if you're clueless about development, an Indian team needs a firm and experienced hand to keep them in line and make them deliver a decent product, or at least one that's in line with the spec. This is not because they are Indian, it's because they are remote, and usually under experienced. The same would happen if you were in New York and hired first year students in LA, which is, in essence what you probably ended up doing.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Let me clarify....I was very happy with the stateside coder. I released him from the project, thinking I had found the bugs. The project has been up and running for some time now.
In response to your list:
1. The users must click on a an agree button, so I believe this is the Yes...no option of yes or YES
2. so if I just make the debug to true, I can bypass the email sending until I figure this out?
3. The mail server set up is in my web.config file
4. The email being sent is notifying me when users enter info into my db, hence letting me know when I have accounts to process.
|
|
|
|
|
1 - sure seems strange to me, you're checking the text on a control, that seems a round about way to check if a button was checked.
2 - If you make debug true, then the email object is still created ( inefficient, but it won't break anything ) and the email just won't send. Isn't the email not sending your issue ?
3 - you can do that, and it automatically configures the server when you create the object ? OK, I didn't know that
4 - If I were you, I would set up a table in the DB that does this, you could still send an email, but then you can check the DB and it will tell you what users have entered data. I would always have a backup, in case an email is lost.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am sorry. I was not clear. It is generating emails, actually a LOT of them. It seems one is generated each time a text box updates.I get emails telling me 0 records are changed and one each time a record is changed. My problem is intermittent. About every 10 entries or so, I get the error. Perhaps if I could lesson the amount, it wouldn't error???? Could my mail server be overloading?
1. I could be wrong on what that is doing
2. What happens to the email created if it doesn't send?
3. OK
4. Hmm...will have to hire some help if I go that route.
Thanks
|
|
|
|
|