|
For restful urls, use friendlyurls nuget package.
For your custom url needs like www.myurl.com/profilename, use and configure routing table.
You might wish to google on routing in asp.net.
|
|
|
|
|
how to use nuget package please explain...
|
|
|
|
|
|
You can create an algorithm to encrypt the QueryString parameter and same algoritm to decrypt the query string parameter on the requested page.
|
|
|
|
|
I am using a GoDaddy's smtpou.secureserver.net account to sending email by SMTP client from asp.net website. I have cross checked all almost all the key values and setting for SMTP but application still throw an exception at production server however the same code and logic working fine at my local machine.
Error message:
"System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 173.201.192.101:25 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)"
on sending third or 4th email.
It seems it does not connecting to server(remote machine). The emails sent perfectly earlier and i have not change any setting at the server side however getting the error again and again.
below are lines of code which i am using to send email by SMTP Client..
string SMTP_UserName = ConfigurationManager.AppSettings["SMTP_Username"].ToString();
string SMTP_Password = ConfigurationManager.AppSettings["SMTP_Password"].ToString();
string SMTP_Server = ConfigurationManager.AppSettings["SMTP_Server"].ToString(); ;
string SMTP_SSLRequired = ConfigurationManager.AppSettings["SMTP_SSLRequired"].ToString();
string SMTP_Displayname = ConfigurationManager.AppSettings["SMTP_Displayname"].ToString();
string SMTP_Port = ConfigurationManager.AppSettings["SMTP_Port"].ToString();
SmtpClient sClient;
NetworkCredential SMTPUserInfo = new NetworkCredential(SMTP_UserName, SMTP_Password);
//MailMessage mMessage = new MailMessage(From, emailTo, emailSubject, emailBody);
MailMessage mMessage = new MailMessage();
MailAddress mafrom = new MailAddress(From, SMTP_Displayname);
mMessage.From = mafrom;
if (lstTo != null && lstTo.Count > 0)
{
foreach (var item in lstTo)
{
if (item.ToString() != string.Empty)
{
mMessage.To.Add(item.ToString().Trim());
}
}
}
mMessage.Subject = emailSubject.Trim();
mMessage.Body = emailBody.Trim();
if (lstCC != null && lstCC.Count > 0)
{
foreach (var item in lstCC)
{
if (item.ToString() != string.Empty)
{
mMessage.CC.Add(item.ToString().Trim());
}
}
}
mMessage.Headers.Add("Message-Id", String.Concat("<", DateTime.Now.ToString("yyMMdd"), ".", DateTime.Now.ToString("HHmmss"), ">"));
mMessage.IsBodyHtml = true;
sClient = new SmtpClient(SMTP_Server);
sClient.Port = Convert.ToInt32(SMTP_Port);
if (SMTP_SSLRequired == "0")
{
sClient.EnableSsl = false;
}
else
{ sClient.EnableSsl = true; }
sClient.UseDefaultCredentials = true;
sClient.Credentials = SMTPUserInfo;
sClient.Timeout = Convert.ToInt32(ConfigurationManager.AppSettings["SMTPTimeOut"].ToString());
sClient.Send(mMessage);
// sClient.SendAsync(mMessage, null);
result = true;
any help would be greatly appreciated.
A lot of thanks in advance.
|
|
|
|
|
|
This problem might be caused due to port is not opening for the mail server SMTP, check the firewall setting
|
|
|
|
|
consider i have a two table in Database. if i want to bring first column of both table in the single grid view table that has to be displayed in the user screen, how do i do that..?
|
|
|
|
|
|
|
consider i have 3 table. the solution i need is
T1 C1-T2 C2 = T3 C3
T- Table C- column
i tried this but doesnt work
SELECT advamt,expamt,balance from [advance],[expense],[details] where (advamt-expamt)=balance;
|
|
|
|
|
Sorry for the late reply.I didn't get quite clearly but you have to try something like this
select T1.C1,T2.C2,T3.C3 from Table1 as T1 inner join Table2 as T2
on T1.id = T2.id inner join Table3 as T3 on T2.id =T3.id
Use the common columns in between two tables to make joins for your query
You have to learn to think like a computer or teach him to think like a human.
-Kornfeld Eliyahu Peter
|
|
|
|
|
thanq so much.
|
|
|
|
|
I have a scatter chart plot in my project. The values to plot contains double values with less precision like 72.34, 70.43 etc.. But when plotted the values on the label is showing 72.34857554748 which look wierd. Could anyone please help me how to resolve this.
|
|
|
|
|
Can any one send me the code for asp.net life insurance project please.pleasesend it me to varunk1109@gmail.com
|
|
|
|
|
This is not the type of place where you would post such a request, this is a place where people help each other out with problems. You must make some sort of attempt to solve your own problem.
If you need help designing or implementing an insurance system, hire a consultant. If this is a homework assignment, then start doing your own work.
The folks here are very knowledgeable and very helpful, but you must make an attempt to solving your problem.
Good luck.
|
|
|
|
|
Message Removed
modified 24-Apr-14 6:41am.
|
|
|
|
|
this code will tell me that my update was successful but will not update my database. I have stripped the code down to nothing and still cannot find the problem.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace GigGuide
{
public partial class userProfile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LblUserName.Text = Convert.ToString(Session["New"]);
string fillTextBoxes = "Select FirstName, Surname,TelephoneNo,PersonalEmail,Password,ContactbyText,ContactByEmail from Personal where UserName ='" + LblUserName.Text + "'";
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ProjectDatabaseConnectionString"].ConnectionString);
SqlCommand com = new SqlCommand(fillTextBoxes, conn);
SqlDataReader reader;
try
{
conn.Open();
reader = com.ExecuteReader();
reader.Read();
TextBoxFirstName.Text = reader["FirstName"].ToString();
TextBoxSurName.Text = reader["Surname"].ToString();
TextBoxTelNo.Text = reader["TelephoneNo"].ToString();
TextBoxOldemail.Text = reader["PersonalEmail"].ToString();
TextBoxOldPassword.Text = reader["Password"].ToString();
reader.Close();
conn.Close();
}
catch (Exception ex)
{
Response.Write("ERROR" + ex.ToString());
}
}
}
protected void ButtonUpdate_Click(object sender, EventArgs e)
{
try
{
SqlConnection conn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["ProjectDatabaseConnectionString"].ConnectionString);
conn1.Open();
SqlCommand com1;
string updateQuery = "update Personal set PersonalEmail = @email,FirstName = @fname, Surname = @sname,TelephoneNo = @telno, Password = @password, ContactbyText = @conText, ContactByEmail = @conEmail Where UserName = '" + LblUserName + "'";
com1 = new SqlCommand(updateQuery, conn1);
com1.Parameters.AddWithValue("@email", TextBoxNewEmail.Text);
com1.Parameters.AddWithValue("@password", TextBoxNewPassword.Text);
com1.Parameters.AddWithValue("@fname", TextBoxFirstName.Text);
com1.Parameters.AddWithValue("@sname", TextBoxSurName.Text);
com1.Parameters.AddWithValue("@telno", TextBoxTelNo.Text);
com1.Parameters.AddWithValue("@conText", RadioButtonListText.SelectedValue);
com1.Parameters.AddWithValue("@conEmail", RadioButtonListEmail.SelectedValue);
com1.ExecuteNonQuery();
conn1.Close();
Response.Write("Update was successful");
}
catch (Exception ex)
{
Response.Write("error" + ex.ToString());
}
}
}
}
|
|
|
|
|
There is no reason to cross post. You have already posted this here.[^]
|
|
|
|
|
Hi,
In the ButtonUpdate_Click, you have mentioned only "LblUserName" in it, it should be "LblUserName.Text".
One way could be trying this way,
int updateStatus = com1.ExecuteNonQuery();
conn1.Close();
if(a > 0)
{
//updated.
}
else
{
//Not updated.
}
|
|
|
|
|
I wanna to have something like "live chat" jquery popup for download(when user click on it then it will refer yiu to download pagenot on pupop) in page
http://www.parsdata.com/services
thanks in advance!
modified 26-Apr-14 12:22pm.
|
|
|
|
|
I am using Open XML for Excel doc creation. I need to merge 2 cell while I am creating a sheetdata (row,cell). How do I do this?
Dim worksheetpart2 As WorksheetPart = spreadsheetdocument.WorkbookPart.GetPartById(HighLevelBen.Id.ToString)
spreadsheetdocument.WorkbookPart.CreateRelationshipToPart(worksheetpart2)
Dim sheetHighBenefitsData As SheetData = worksheetpart2.Worksheet.GetFirstChild(Of SheetData)()
CreateHighBenefitsData(sheetHighBenefitsData).....
Public Sub CreateHighBenefitsData(ByVal sheetData As SheetData)
Dim currentRow As Integer = 0
currentRow = currentRow + 1
With sheetData
CreateTextTableCell(HighLevelBenefitRow, 1, "High Level Benefit Information", currentRow, 182, True)
CreateTextTableCell(HighLevelBenefitRow, 2, "", currentRow, 182, True)
CreateTextTableCell(HighLevelBenefitRow, 3, "", currentRow, 182, True)...
How toI merge in here 3 cells created above?
|
|
|
|
|
I think this is not related to asp.net.
Please post it to the right forum.
|
|
|
|
|
Hello Friends..
I am new to ASP.NET. I want to use Tab Control in my web form without using AJAX.
Need your help friends.
Thank You
|
|
|
|
|
You can use a normal navigation menu and use CSS to style the menu and the content holder to look like a tab control and use JQuery or Javascript to show and hide the content. Click here to look at this sample I have found.
|
|
|
|