|
Hi every one
I am a beginner in ASP.NET
I am working on sending Email, but unable to get it...
I am screwed up........., i have tried many codes in google but i am confused.
Please any one can give me steps to follow from beginning to end.
|
|
|
|
|
Hi kiranreddy,
Try this:
using System.Net.Mail;
protected void btnSendMessage_Click(object sender, EventArgs e)
{
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAdress = new MailAddress("YourSenderEmail", "NameThatSendTheMessage");
smtpClient.Host = "YoursmptClientHost";
smtpClient.Port = 25;
message.From = fromAdress;
message.To.Add("MailAdressToWhoShouldRecieveTheMail");
message.Subject = "The message subject";
message.IsBodyHtml = false;
message.Body = "The message went here";
smtpClient.Send(message);
lblSendOk.Visible = true;
}
catch (Exception ex)
{
lblSendError.Visible = true;
lblSendError.Text = lblSendError.Text + " .<br />" + ex.Message;
}
}
If you have any trouble with the above code, you have to tell what exactly the error gives and copy your code, so we can see, if you have done anything else.
Kind regards,
simsen
|
|
|
|
|
you have to use System.Net namesapce and use
MailMessage Class.
cheers,
Abhijit
|
|
|
|
|
Hi all,
How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ?
i tried it by
System.Web.UI.WebControls.Table t=new System.Web.UI.WebControls.Table();
System.Data.DataTable dt = new System.Data.DataTable();
dt = (System.Data.DataTable)t;
Its giving Error.
Error 9 Argument '1': cannot convert from 'System.Web.UI.WebControls.Table' to 'System.Data.DataTable'
Please suggest me how to do that.
Thanks in advance.
|
|
|
|
|
There is no direct method for that. You have to implement a loop to copy values.
|
|
|
|
|
|
if you are trying to display the data in the page then use datagrid
Thanks & Regards
Pete
|
|
|
|
|
|
Hi,
I am using .net 2.0. I want to use Autocomplete TextBox in my project. Why it is necessary to use webservice in Autocomplete TextBox? Is there any way to use Autocomplete TextBox without webservice? Please refer me some useful sites to learn about webservice.
Thanks.
|
|
|
|
|
|
Hi,
Thanks a lot for your reply. I will go through your codings and implement that.
Thanks.
|
|
|
|
|
kandalu wrote: Why it is necessary to use webservice in Autocomplete TextBox?
I dont think so it is necessary.
kandalu wrote: Is there any way to use Autocomplete TextBox without webservice?
Purpose of Web Services is diiferent. we can use it as a layer and use in multiple application . Go thorugh Google to learn use of webservices.
kandalu wrote: Is there any way to use Autocomplete TextBox without webservice?
Use Simply AJAX
kandalu wrote: Please refer me some useful sites to learn about webservice.
W3School, CodeProject.com
cheers,
Abhijit
|
|
|
|
|
Hi,
Thanks for your reply. First I will try without webservice and then I will try with webservice. Thanks for the hint given for webservice.
Thanks.
|
|
|
|
|
Webservice is not needed. If you haven't specified the webservice path, AutocompleteTextBox will pick the method from page. See what documentation says
ServicePath - The path to the web service that the extender will pull the word\sentence completions from. If this is not provided, the service method should be a page method.
|
|
|
|
|
Hi,
If I use a Function in .cs file that function is not called. If I use the same method using webservice it works well. The code is given below :
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1"
ServiceMethod="GetRegC" TargetControlID="TextBox1">
The "GetRegC" is coded as a function in the default.cs file.
I don't know how to specify that function. So, I am using webservice.
Thanks.
|
|
|
|
|
HI,
I want to store the Image files in sql table and after inserting, I want to read and display the same in gridview.....
For storing ImagePath what is the datatype used and for Imagedata what is the datatype.......please help me..
Best Regards
Mcmilan
|
|
|
|
|
|
mcmilan wrote: For storing ImagePath what is the datatype used
Varchar
mcmilan wrote: for Imagedata what is the datatype.
VARBINARY(MAX)
|
|
|
|
|
I'm trying to set up an object data source which will be used to populate a text box for instance. The problem that I'm running into is that the object's method that does the actual query takes a parameter (ID). So I need to set
<pre>
&lt;asp:ObjectDataSource ID="odsCities" runat="server" SelectMethod="CitiesList" TypeName="WEBSWAPP_BLL.Demos"&gt;
&lt;SelectParameters&gt;
&lt;asp:ControlParameter ControlID="?????" Name="ProvinceID" PropertyName="AssemblyID"
Type="Int32" /&gt;
&lt;/SelectParameters&gt;
&lt;/asp:ObjectDataSource&gt;
</pre>
Now the problem is that the value that needs to be passed to the object is the assembly id but it's been retrieved from a drop down list which is located on the page itself. Now this new datasource that I'm setting is on a separate user conrol (.ascx file). So I can't use the drop down list from the page itself...whats the best way to accomplish that?
Thanks
|
|
|
|
|
make a public property in the user control and pass the parameter to that user control.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Hello,
anyone out there who can help ?
Page1
MenuControl with different Hyperlinks to Page2
Page2
Multiview - which should now change from default-view to hyperlink-related views.
Normally it should work with a script on page_load of Page2 and a session variable. But I really don't get the script working fine.
Thanks in advance
Lothar
|
|
|
|
|
Hi
We've developed open-source ASP.NET shopping cart. nopCommerce is a open source e-commerce solution that is ASP.NET 3.5 based with a MS SQL 2005 (or higher) backend database. nopCommerce is available for free. If somebody will be interested in reviewing it please visit http://www.nopCommerce.com
Thank you!
nopCommerce is the open-source eCommerce solution. nopCommerce is available for free.
http://www.nopCommerce.com
|
|
|
|
|
I have had a quick overview of it. And i must say i am impressed by the way you have handled the project. Will look in detail some other time.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Ahsan
Thank you
nopCommerce is the open-source eCommerce solution. nopCommerce is available for free.
http://www.nopCommerce.com
|
|
|
|
|
Sorry for my ignorance but im an ASP.net newbie
my question is why am i always get the initial value of an html control attribute and not the modified one
I got the following defintion in my html -
In the client side i changed the "someval" to 'B' and submiting the form.
But ,checking the attribute value in server side return A while im expecting to get the new modified value
string test = imgFooter.Attributes["newval"].ToString()
|
|
|
|