|
please help me to get the diference between 2 local datetime instances(client)in minutes using javascript
|
|
|
|
|
|
var days = 0;
var difference = 0;
debugger;
StartDate = new Date(document.getElementById("txtStartDate").value);
today = new Date();
difference = StartDate - today;
days = difference/(1000*60*60*24);
|
|
|
|
|
Hello Everyone,
I want to send the email through my ASP.NET project. And it's working at localhost when i'm taking the SMTP Server as "127.0.0.1" but when i'm uploading this project on server it's throwing me an error "could not access cdo.Message object" . still i've taken my SMTPServer not as "127.0.01" but still it's throwing an error
i'm giving the url of the page where this problem is being raised....
http://www.priveejets.com/Flight_Enquiry1.aspx
in this page an auto-response is generated when a client makes an enquiry at his/her email
MailMessage mail1=new MailMessage();
mail1.To=txtEmail.Text;
mail1.From="mail@priveejets.com";
mail1.Subject="Auto Responder";
mail1.Priority=MailPriority.High;
mail1.BodyFormat=MailFormat.Html;
mail1.Body="Thanks for the Enquiry "+" "+"We'll get you soon"+" "+"------------------"+" "+"Thanks & Regards"+" "+"Priveejets Team";
SmtpMail.SmtpServer="127.0.0.1"; or other not shown here
//SmtpMail.SmtpServer="127.0.01";
SmtpMail.Send(mail1);
|
|
|
|
|
hi,
u r code is correct, but u have to specify the u r SMTP server name not ip address
Ramana
|
|
|
|
|
Well Friend i've specified my smtp server name actually this ip address is just for the localhost. Whenever i was using my smtp server for the localhost it's throwing an error like "could not access.........". But with this ip address i can send the email perfectly.......
On server i've used my smtp server...... which is "mail@priveejets.com"
but still it's throwing an error.
Plz suggest me some other way ..........
|
|
|
|
|
if u r able to access Priveejets smtp server from ur development network, then application won't gives any excption.
just check the priveejets smtp server from ur command window. if not then contact administrator for rights
Ramana
|
|
|
|
|
No, i'm not getting how to access the priveejets smtp server
If tht's mean to access their mail(priveejets) account then i would say i can access their mail account which is
mail@priveejets.com
Should i also specify other infos to send the mail if yes what can be those
|
|
|
|
|
i think the smtp server u specified is wrong
|
|
|
|
|
you have to specify the server smtp name where your application is hosted
|
|
|
|
|
hi...
MailMessage Msg = new MailMessage();
string host = mail@priveejets.com;
string username = xyz@priveejets.com;
string password = (your Password for This Mail Id);
SmtpClient MailObj = new SmtpClient(host);
MailObj.Credentials = new System.Net.NetworkCredential(username, password);
MailObj.DeliveryMethod = SmtpDeliveryMethod.Network;
Msg.To=txtEmail.Text;
Msg.From="mail@priveejets.com";
Msg.IsBodyHtml = true;
Msg.Subject = txtSubject.Text;
Msg.Body = txtMessage.Value;
MailObj.Send(Msg);
Jintal Patel
|
|
|
|
|
Hello Sir,
First of all thnx for sending me this piece of code. I want to know one question "should i include any namespace for SmtpClient". Actually i'm using ASP.NET1.1 and
SmtpClient is not being supported in it
.....
|
|
|
|
|
hi
namespace :-system.web.mail
MailMessage mail = new MailMessage();
mail.From = "jintal@abc.com";
mail.To = "jintal@abc.com";
mail.Body = "test";
mail.Subject = "test";
SmtpMail.SmtpServer.Insert(0, "mail@priveejets.com");
SmtpMail.Send(mail);
Jintal Patel
|
|
|
|
|
I have a stored procedure in mysql and I am calling it via a method and objectdatasource. I have two select methods. One that gets a list of employees and the other that gets one specific employee by passing the employee id via a parameter.
I have two gridviews, one for displaying all employees and one for displaying one employee record. The user should be able to enter the employee id in the textbox and the gridview should display the employee's record. My code is working for displaying all employees but not for displaying one specific employee. The code compiles but does not display any info. Here is my code:
asp:objectdatasource id="ObData2" runat="server" dataobjecttypename="EmpData"
typename="Employee" selectmethod="getEmployee" >
<selectparameters>
asp:controlparameter controlid="employeeid" name="eId" propertyname="text" type="string" />
</selectparameters>
</asp:ObjectDataSource>
asp:gridview id="GridView2" action="databind" runat="server" datasourceid="ObData2"
datakeynames="EmployeeID" allowpaging="True" autogenerateeditbutton="True" autogeneratecolumns="True"
emptydatatext="No Records"
allowsorting="True" >
</asp:gridview>
<asp:textbox id="employeeid" runat="server"></asp:textbox>
[DataObjectMethod(DataObjectMethodType.Select)]
public void getEmployee(string eId)
{
MySqlCommand cmd = new MySqlCommand();
try
{
DB_Connection conn = new DB_Connection();
cmd.Connection = (MySqlConnection)conn.DBConnect();
cmd.CommandText = "getEmployee";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("EMPLOYEEID", eId);
cmd.ExecuteNonQuery();
}
-- modified at 8:56 Wednesday 26th September, 2007
|
|
|
|
|
Define 'not working' Does it show lots of records ? No records ? Does the proc return the right record ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It isn't returning any records.
|
|
|
|
|
Hi there,
If I am not wrong your task is to enter some ID through Textbox and then depending on it, you want to display some records in GridView.
I am not sure if using ObjectDatasource is best method.
Try this..
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim cmd As SqlCommand = New SqlCommand("CustOrderHist", New SqlConnection("Server=localhost;Database=Northwind;Trusted_Connection=True;"))
cmd.CommandType = Data.CommandType.StoredProcedure
cmd.Parameters.AddWithValue("CustomerID", txtCustID.Text)
cmd.Connection.Open()
gvwExample.DataSource = cmd.ExecuteReader()
gvwExample.DataBind()
cmd.Connection.Close()
cmd.Connection.Dispose()
Catch ex As Exception
lblStatus.Text = ex.Message
End Try
End Sub
I hope you can manage to change the code to c#...
I wish it helps you..
Still if you find any problem... please do write back
Cheers
Menon
|
|
|
|
|
Menon,
Thanks. I will try to translate this into C#.
|
|
|
|
|
hi everyone my name is Amna im studying computer science in my final year and am sudanese girl .. so i chose to do my final project about designing website about virtual reality so just i need help anything about it or other projects and stuff like that ...
thanx alot
Amouna
|
|
|
|
|
A virtual world in a website will NOT use ASP.NET. It will embed an executable in the web page, or use flash at least.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
4 sure i'll use flash just i need anything about it or any good website or old student projetcs nd stuff like that ,,
thanx alot =)
Amouna
|
|
|
|
|
Yes ladies and gents, here it is again...
For some reason the gods at Microsoft failed to realize us Intarwebz users like to press the "enter" key after we fill out a form to "Submit" it. Instead they decided they should force us to either tab or to, god forbid, use the mouse to CLICK THE BUTTON!!
I have been over these forums, over the ASP.NET forums over at Microsoft and of course, everyone's best Coder guru, Google. Alas, I still have the same problem.
<asp:LoginView ID="LoginArea" runat="server">
<LoggedInTemplate>
<div class="homeLoggedin">
<table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
<tr>
<td>
<div class="lblLogin">
<asp:HyperLink ID="hypProfile" NavigateUrl="~/Membership/Default.aspx" runat="server">Member Home</asp:HyperLink>
|
<asp:LoginStatus runat="server" ID="LoginStatus1" LogoutPageUrl="~/Default.aspx" LogoutAction="Redirect" LoginText="" />
</div>
</td>
</tr>
</table>
</div>
</LoggedInTemplate>
<AnonymousTemplate>
<div class="homeLogin">
<asp:Login ID="memberLogin" runat="server" PasswordRecoveryText="Forgot your password?" DisplayRememberMe="False" LoginButtonImageUrl="~/images/btnLogin.jpg"
LoginButtonText="" LoginButtonType="Image" PasswordLabelText="PASSWORD:" TextLayout="TextOnTop"
TitleText="" UserNameLabelText="USERNAME:" PasswordRecoveryUrl="~/Membership/PassRecovery.aspx">
<LabelStyle CssClass="lblLogin" />
<LayoutTemplate>
<asp:Panel ID="pnlMemberArea" runat="server">
<table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
<tr>
<td>
<table border="0" cellpadding="0">
<tr>
<td class="lblLogin">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">USERNAME:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="memberLogin">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="lblLogin">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">PASSWORD:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="memberLogin">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" style="color: red">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
<tr>
<td colspan="2">
<asp:ImageButton ID="LoginImageButton" runat="server"
CommandName="Login" ImageUrl="~/images/btnLogin.jpg"
ValidationGroup="memberLogin" />
<asp:HyperLink ID="PasswordRecoveryLink" runat="server"
NavigateUrl="~/Membership/PassRecovery.aspx" CssClass="homeLoginFix">Forgot Password</asp:HyperLink>
<span class="homeLoginFix">|</span>
<asp:HyperLink ID="Register" runat="server"
NavigateUrl="~/Membership/Register.aspx" CssClass="homeLoginFix">Register
</asp:HyperLink>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</LayoutTemplate>
</asp:Login>
</div>
</AnonymousTemplate>
</asp:LoginView>
My code-behind includes the following:
if(HttpContext.Current.User.IsAuthenticated)
{
//we do some stuff here
}
else
{
Panel myPanel = (Panel)LoginArea.FindControl("memberLogin").FindControl("pnlMemberArea");
myPanel.DefaultButton = LoginArea.FindControl("memberLogin").FindControl("pnlMemberArea").FindControl("LoginImageButton").ClientID;
}
Now, I have tried putting the Panel inside the LoginView, inside the Table, inside the div, I've tried putting the panel right next to the Login and even inside the login, but NOTHING I DO will make the default button work correctly. The error I receive is:
The DefaultButton of 'pnlMemberArea' must be the ID of a control of type IButtonControl.
Through all of my research I have discovered that the ASP:LOGIN control renames all it's contianing controls to implment the INaming interface rather than the IButtonControl interface and thus the conundrum. I've done everything I can think of and cannot get this thing to work. Any ideas?
|
|
|
|
|
Nothing? No one?
Wow. Come on people, SOMEONE has had to have come along this sometime.
All I'm trying to do is make my LoginImageButton my DefaultButton of myPanel.
Any hints? Answers? Godsends?
|
|
|
|
|
Have you tried javascript?
You can capture the "Enter" key pressed in the page using javascript, and trigger the Image Button's click event.
|
|
|
|
|
How can i accsess the control that exsist in masterpage from child?
|
|
|
|