|
From the documentation of the SmtpClient class:
If there is an e-mail transmission in progress and you call SendAsync or Send again, you will receive an InvalidOperationException.
Does that mean users can't send mail (from different threads) at the same time?
Also is there any way to get notified 'programmatically' when the mail is delivered?
Thanks
|
|
|
|
|
Waleed Eissa wrote: Also is there any way to get notified 'programmatically' when the mail is delivered?
SendAsyc has an event that fires when it has sent. It's not very reliable, you can't know it was delivered, only that it was sent.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Thanks a lot for your reply, actually I know about this event but I was hoping there's a more reliable way, basically what I'm trying to do is automate the whole process, this is why I don't want to use DeliveryOptions because I don't want to keep checking my email every now and then to make sure every message was sent, doesn't seem a very reliable way in a production environment. It seems that there's no way to communicate with the SMTP server, I wonder how all those websites with high traffic handle mail issues ..
|
|
|
|
|
No, there is literally no way to know if a mail got sent correctly, your best bet is to write a program that checks mail on the return address to see if you get a failure notice, but even that won't really work.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi
I have used the following tutorial to create an autocomplete extender.
The problem is, it is not working. When I type text in the box nothing happens.
Is there something missing from the exampl code I have used.
I'm not sure where the string value gets filled which is shown in the tuturial.
Any help would be great
thanks!
http://www.aspdotnetcodes.com/AutoComplete_From_Database.aspx
|
|
|
|
|
I think problem is in webservice.I had case like you and when I added third line (of lines down below) it worked.
Try this:
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Thanks for the reply, but that didnt work.
Below is my code for extender control
<asp:textbox id="tb_description" runat="server" xmlns:asp="#unknown">
<atlas:autocompleteextender id="AutoCompleteExtender1" minimumprefixlength="1" runat="server" xmlns:atlas="#unknown">
<atlas:autocompleteproperties targetcontrolid="tb_description" servicemethod="GetactdescInfo" servicepath="~/autocomplete.asmx" enabled="True">
Is there anything wrong with that?
|
|
|
|
|
this work for me and I am using in VS.NET 2005
<asp:ScriptManager id="ScriptManager1" runat="server"><br />
</asp:ScriptManager><br />
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtTo"<br />
ServicePath="WebService.asmx" Enabled="true" MinimumPrefixLength="1" ServiceMethod="MethodNameFromWebService"><br />
</cc1:AutoCompleteExtender>
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
OK, well there must be a problem with the web service then
The code is displayed below.When I type text in the box nothing appears
thanks
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class autocomplete : System.Web.Services.WebService {
[WebMethod(EnableSession = true)]
public string[] GetactdescInfo(string prefixText)
{
int count = 10;
string project = HttpContext.Current.Session["project"].ToString();
SqlConnection connectionString = new SqlConnection(ConfigurationManager.ConnectionStrings[project].ConnectionString);
connectionString.Open();
string sql = " SELECT description" +
" FROM act" +
" WHERE description like '" + prefixText + "' ";
//string description_condition = " AND description LIKE '%" + prefixText + "%'";
//sql += description_condition;
SqlDataAdapter dataAdapter1 = new SqlDataAdapter(sql, connectionString);
dataAdapter1.SelectCommand.Parameters.Add("@prefixText", SqlDbType.NVarChar, 2000).Value = prefixText + "%";
DataTable datatable1 = new DataTable();
dataAdapter1.Fill(datatable1);
string[] items = new string[datatable1.Rows.Count];
int i = 0;
foreach (DataRow datarow in datatable1.Rows)
{
items.SetValue(datarow["description"].ToString(), i);
i++;
}
return items;
}
}
|
|
|
|
|
.netman wrote: " WHERE description like '" + prefixText + "' ";
try to add precentage sign:
" WHERE description like '" + prefixText + "%' "
My webservice which works:
<%@ WebService Language="C#" Class="WebService" %><br />
<br />
using System;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
<br />
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService] <br />
<br />
public class WebService : System.Web.Services.WebService {<br />
<br />
[WebMethod]<br />
public string[] GetUserName(string prefixText)<br />
{<br />
<br />
System.Data.DataSet dtst = new System.Data.DataSet();<br />
<br />
System.Data.SqlClient.SqlConnection sqlCon = new System.Data.SqlClient.SqlConnection("Data Source=.;Initial Catalog=BussinesTube;Integrated Security=True");<br />
<br />
string strSql = "SELECT name+' ' +lastname +' ; < '+ username + ' > 'as [name] from users WHERE [name] LIKE '%" + prefixText + "%' ";<br />
<br />
System.Data.SqlClient.SqlCommand sqlComd = new System.Data.SqlClient.SqlCommand(strSql, sqlCon);<br />
<br />
sqlCon.Open();<br />
<br />
System.Data.SqlClient.SqlDataAdapter sqlAdpt = new System.Data.SqlClient.SqlDataAdapter();<br />
<br />
sqlAdpt.SelectCommand = sqlComd;<br />
<br />
sqlAdpt.Fill(dtst);<br />
<br />
string[] cntName = new string[dtst.Tables[0].Rows.Count];<br />
<br />
int i = 0;<br />
<br />
try<br />
{<br />
<br />
foreach (System.Data.DataRow rdr in dtst.Tables[0].Rows)<br />
{<br />
<br />
cntName.SetValue(rdr["Name"].ToString(), i);<br />
<br />
i++;<br />
<br />
}<br />
<br />
}<br />
<br />
catch { }<br />
<br />
finally<br />
{<br />
<br />
sqlCon.Close();<br />
<br />
}<br />
<br />
return cntName;<br />
<br />
}<br />
<br />
<br />
<br />
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi thanks for the response.
I have added that and it still doesnt work.
Should there be any additonal lines in my c# code for the page the textbox is on?
|
|
|
|
|
When does prefixtext get set?
|
|
|
|
|
hi i am new user of asp.net using c#
problem is that i use a mater page which fill a datalist in iframe tag so open a new page and then goes to second page now when i click a datalist link button then i open a new mater page but that page is open on same td of mater page how i show a new page. every time when i clik on linkbutton its open in new datalist as a child of that form. while i want its open in a seprate page.
thanks in advance reply soon.
|
|
|
|
|
You try to open if in a parent page.
studing is processing in this life.
|
|
|
|
|
i understood what is the problem.
problem is that i am using iframe control but if i not use ifrmae than all value are comeout from my div tag what i use insted of iframe
thanks
|
|
|
|
|
hello
i am using master form.
and so how to write webform name on internet exlorer title bar.
pls help me.
gayatri
Gayatri
|
|
|
|
|
when u insert a form using mater page then u should chnge the <title>your web page name
example
]]>
i think its helpful for u.
|
|
|
|
|
Page.Title="Here goes title of the page";
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
I am creating a Bloggings in my site, so which is the best way to create bloggings, shall i use datagrid,repeater or something else. plz give me suggestion as soon as possible. Thank you.
coolsatty
|
|
|
|
|
Use whatever you like. The question makes no sense
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
You can use datalist.For its bigger using.
studing is processing in this life.
|
|
|
|
|
Hi,
Is it possible to find the quality of the image?
How can we find the image is with good quality or not?
|
|
|
|
|
Hi,
May be using Pixels.
Cheers,
sekhar
|
|
|
|
|
Not really an asp.net question is it.
|
|
|
|
|
This queston is ridiculous. How do you define 'quality'. ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|