|
easy
First, you must to install All the SMTP features to IIS, Control Panel>>add remove windows programs>>
Second ,
using System.Web.Mail;
try{
MailMessage message = new MailMessage();
string from = "FROM E-Mail"
string to = "TO E-MAIL"
string subject = "Subject text";
string bodyMessage = "HELLO WORLD"
message.From = from;
message.To = to;
message.Subject = subject;
message.Body = bodyMessage;
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(message);
Estate.Text = "Message was send to" + to;
}
catch(System.Web.HttpException)
{
Estate.Text = "Receiver Email Error";
}
catch(IndexOutOfRangeException)
{
Estate.Text = "Someone of the fields is out of range (To big)";
}
Gracias!!
ff
|
|
|
|
|
when i use
webclint.downloadfile(strURL,"c:\abc.zip")
i get following error message:-
"The underlying connection was closed: The remote name could not be resolved"
|
|
|
|
|
Hello all,
In our web application we are providing date format as dd/mm/yyyy. If user has entered 2 dates like start date and end date, we want to validate in javascript or vbscript at client side.
If anyone knows, reply ASAP.
Regards,
S Kumar
|
|
|
|
|
|
Hi Apurva,
Thanks a lot for sharing link.
Regards,
S Kumar
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi Friends,
This is HariBabu, I want to drag items from one listbox & drop it in another listbox and viceversa. I want code for this fuctionality in asp.net with c#. i know so many talented guys are here to help me.
Thankyou to one and all
Regds,
Hari.
HariBabu Kuricheti
|
|
|
|
|
DON'T REPOST THE SAME QUESTION
only two letters away from being an asset
|
|
|
|
|
Hi Friends,
This is HariBabu, I want to drag items from one listbox and drop it in another listbox. I want code for this fuctionality in asp.net with c#. i know so many talented guys are here to help me.
Thankyou Guys(Also Ladies)
Regds,
Hari.
HariBabu Kuricheti
|
|
|
|
|
Kuricheti wrote: I want code for this fuctionality in asp.net with c#.
If you are looking for someone to write the code for you, then you have come to the wrong place.
only two letters away from being an asset
|
|
|
|
|
Hi everyone
Need help or ideas for the problem i am facing. right now i have a lot of record in the dataset. once fill the datagrid with the dataset, my data grid will be extremly long. So i need to create a datagrid with a scroll bar with in the data so i can just scroll in the datagrid itself no need to whole page
Any ideas pls help. need it urgently for works
Thanks A million
KaKaShi HaTaKe
|
|
|
|
|
Try paging the data instead of trying to display it all at once. You will get better performance also.
only two letters away from being an asset
|
|
|
|
|
i have linked a datagrid to a table. Now i want to use a nested structure to show the followin format:-
PVR SAKET
movie shows
golmaal 12:00 2:00 4:00 6:00
PVR SPICE
movie shows
superman 12:00 6:00 11:00
.
.
.
.
considerin the table is in the followin format:-
PVR movie show1 show2 show3 show4 show5
Now the conditions r as follows:-
1. the timings should be links
2. the links should pass the showtiming, d movie and the PVR to a buy.aspx page
plz plz help if neone can...
|
|
|
|
|
You need to work arround from the example below.
Define your datagrid as below
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<P>
<asp:Label id="lblName" runat="server" Width="144px">Label</asp:Label></P>
<P>
<asp:Label id="lblCountry" runat="server" Width="144px">Label</asp:Label></P>
<P> </P>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn Visible="False" DataField="Firstname"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="Lastname"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="Country"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
Finally DataGrid1_ItemDataBound :
Dim lblName As Label
Dim lblCountry As Label
If e.Item.ItemType <> ListItemType.Header And _
e.Item.ItemType <> ListItemType.Footer Then
lblName = CType(e.Item.FindControl("lblName"), Label)
lblName.Text = e.Item.Cells(1).Text & " " & e.Item.Cells(2).Text
lblCountry = CType(e.Item.FindControl("lblCountry"), Label)
lblCountry.Text = e.Item.Cells(3).Text
End If
==postmaster
www.programmingknowledge.com
|
|
|
|
|
Ok, I found this article that showed me the right way to solve a problem I had a long time ago. I was using VS 2003 then and the solution involved .inc files ( the article is here http://msdn.microsoft.com/library/en-us/dnpatterns/html/ImpPageController.asp[^] search for basepage.inc to see what I'm talking about )
Are .inc files in VS 2005? (I couldn't find them) and if not what is the equivalent to .inc files or what is the equivalent approach in VS 2005?
|
|
|
|
|
Hi there. In the ASP.NET 2.0, you might want to look at the MasterPage[^] concept.
|
|
|
|
|
Hello,
I need a little bit of help. I cant seem to figure out how to do this. Here is my current situation:
I have a DataSet that holds all the data needed for the current webpage. It contains a customers information as well as the customers order information. What i need to do now, is seperate the order information into 2 GridViews; Delivery and Pick Up.
The two gridview are based on a Date and a Type (being Del or Pick). All the order items for the given Delivery Date need to go into one GV and the Pickup order items into the other based on its Date.
In addition, there is customer information that needs to be seperated out and put into different Labels throughout the page.
How do i seperate all the data to do what i need?
If you use example, i would appresiate if they are in C#, but anything helps
Cheers,
Steve
|
|
|
|
|
DataSet.Tables[0].Select("Type = Del");
DataSet.Tables[0].Select("Type = Pick");
or
DataSet.Tables[0].DefaultView.RowFilter = "Type = Del";
DataSet.Tables[0].DefaultView.RowFilter = "Type = Pick";
only two letters away from being an asset
|
|
|
|
|
Wow seems easy enough, thank you.
Few questions about your answer, which of the two methods is the prefered way of doing this operation? Does one create less overhead than another or execute faster?
Cheers,
Dev Djinnx
|
|
|
|
|
The first method returns an array of DataRows, the second just filters the DataView on the table. For overhead considerations then the first has more. Performance-wise, I haven't measured it, but I don't believe there is any significant difference.
only two letters away from being an asset
|
|
|
|
|
I'm having a problem creating a cookie for a website.
I want to set a cookie on the browser that is destroyed when the user closes the browser.
I'm using the code below and if I dont set the Expires property (which is what I read makes a cookie a 'session cookie'), the cookie is never created.
I tried putting the code in a Try Catch statement but it doesnt produce an error.
If I set the date to be in the past, I get an error when I try to access the cookie in the same session (presumably because the cookie is expired).
What is the proper way of creating a session cookie ?
Dim UserCookie As New HttpCookie("UserValidation")
Dim RandomClass As New Random
Dim RandomNumber As String
Dim Index As Integer
For Index = 0 To 37
RandomNumber += RandomClass.Next(0, 9).ToString()
Next Index
Dim UserID As String = DataBinder.Eval(Dsuserdetails1, "Tables[users].DefaultView.[0].user_id")
Dim CookieString As String
CookieString = UserID + "-" + RandomNumber
UserCookie.Value = CookieString
Dim ExpireDate As DateTime = Date.Now.AddHours(12)
UserCookie.Expires = ExpireDate
Response.Cookies.Add(UserCookie)
|
|
|
|
|
IMHO, the article[^] about the ASP.NET cookie posted here on CP might give you an idea.
|
|
|
|
|
Hi
I am using datagrid in asp.net 2.0 , I have a EditCommandColumn in it , in item databound event of the grid i have to find edit button in EditCommandColumn and set the visible false
can any one help me , how i can find edit button EditCommandColumn in datagird.
Thanks in advance
Deepak
-- modified at 14:44 Thursday 31st August, 2006
|
|
|
|
|
There are many ways to get reference to a child control in a data-bound control like the DataGrid, you can see from the link:
http://msdn2.microsoft.com/en-us/library/ms178509.aspx[^]
Also, just curious that you want to use the EditCommandButton, but you also want to hide the Edit button then how you can fire the edit command, or you may consider a template column where you are flexible in controlling the UI.
|
|
|
|
|