|
Hey guys need ur help again. I need to check the valid email address using asp.net
Below are the code i use
hostName = "yahoo.com";
private bool ValidSMTP(string hostName)
{
bool valid = false;
try
{
TcpClient smtpTest = new TcpClient();
smtpTest.Connect(hostName, 25);
if (smtpTest.Connected)
{
NetworkStream ns = smtpTest.GetStream();
StreamReader sr = new StreamReader(ns);
if (sr.ReadLine().Contains("220"))
{ valid = true; }
smtpTest.Close();
}
}
catch (Exception e)
{
string a = e.Message;
}
return valid;
}
However the error msg i receive is this
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Any solution or other methods of validating a exist email address?
Thanks
KaKaShi HaTaKe
|
|
|
|
|
There is no way to check if a mail address is valid, apart from mailing it and seeing if you get a bounceback message. Even that is not 100% accurate.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
after I get the id of the linkbutton (as follows), then how to change the backcolor of the button
I do not know which function can be used.
function LinkBtnMouseOver() {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
?
}
thanks.
|
|
|
|
|
Why you are not putting the LnkButton inside Div/Table and change the backcolor of that on mouseover of linkbutton.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks, I did not get you, anyway, above method is suggested by you (right?)
can you help me further for this?
for your new proposal, can you give me one example, how to do it?
|
|
|
|
|
you know these codes should be rendered and then goes to the client , so if there was some thing unknown goes directly to client
so test this one :
<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="LinkBtnMouseOver();">link button</asp:LinkButton>
|
|
|
|
|
oops my text came half !!!
and add this one to java script:
NewID.style.backgroundColor = 'yourcolor';
|
|
|
|
|
thanks, unfortunately, no .style is supported by NewID.
it is strange that you can use .style?? I am using visual web developer 2008 express.
oh, unbelievable, when I type NewID.style.backgroundColor ="Blue", it does work!
but strange is that: when I type NewID. then all the functions within NewID should be automatically appear, but .style can not be found anyway.
do you know the reason? a bug or sth else?
|
|
|
|
|
yes i know it`s like this
i have visual studio enterprise , and it`s not supported very well here too !
but i think that on express mode many of features are not working
i think that just some stupid coder like me can Use these old "dhtml" commands !
but any how i love dhtml an i use it any where
|
|
|
|
|
thanks,
further question, as you know, I can solve this problem as follows, but I have many linkbuttons,
should I write different funcitons for different buttons, because the button ID is used in the funcitons,
how can I write one common function which can be used by all buttons by passing the ID or sth else?
function LinkBtnMouseOver() {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
NewID.style.backgroundColor = "Blue";
}
function LinkBtnMouseOut(obj) {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
NewID.style.backgroundColor = "Green";
}
|
|
|
|
|
ex me because it`s late night here , and i must go to bed
you can use something like this :
<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="LinkBtnMouseOver(this.id)" onmouseout="LinkBtnMouseOut(this.id)">link button </asp:LinkButton>
and change yur javascript to this mode :
function LinkBtnMouseOver(e) {
document.getElementById(e).style.backgroundColor = 'Blue';
}
function LinkBtnMouseOut(e) {
document.getElementById(e).style.backgroundColor = 'Green';
}
or maybe it works directly on your asp page totaly like this new one :
<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="this.style.backgroundColor = 'Blue';" onmouseout="this.style.backgroundColor = 'Green';">link button </asp:LinkButton>
hope that it works
|
|
|
|
|
one other thing
if you found my postes helpful rate them !!!
|
|
|
|
|
thank you very much!
I have rated 5!
|
|
|
|
|
Why do you need javascript when there is no need. Javascript is slower than actual CSS AFAIK. Just a simple fix for you.
In Head section Add
<style type="text/css">
.lnk
{
background-color:Green;
}
.lnk:hover
{
background-color:Aqua;
}
</style>
Now inside Form create these
<asp:LinkButton CssClass="lnk" runat="server" >This is link
</asp:LinkButton>
Now see it should be working. Make appropriate alteration on the CSS.
|
|
|
|
|
have you tried by yourself?
anyway, it does not work for my case, that's why I am looking for other methods.
|
|
|
|
|
Yes .. I did check myself. I have already replied to some other guy in this forum about this.
If you need me to send you the web page which render this, I can do that.
|
|
|
|
|
I published my website , but when i want to login to website it send me an error with this title : "Server Error in '/' Application."
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I dont undersetand what should i do !
Any Idea?
[]D @ []v[] []D @ []v[]
|
|
|
|
|
How did you deployed it on IIS ? Did you create virtual directory ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I Use Build ---> Publish Web Site and in target location i use my website ftp address!
so ?
[]D @ []v[] []D @ []v[]
|
|
|
|
|
pampam110 wrote: in target location i use my website ftp address!
Why FTP ? You should have to deploy on IIS.
Read this article as reference,
Deployment of a Website on IIS[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks Again! You are Profesional !
[]D @ []v[] []D @ []v[]
|
|
|
|
|
i bought a host and Domain and i publish it in my own website but I have still this problem!
Any Idea?
[]D @ []v[] []D @ []v[]
|
|
|
|
|
Your website is not properly configured. Check if web.config exists in the web site.
It also occurs when request cant be processed.
Check thoroughly...everything.
|
|
|
|
|
Hi
http://www.microsoft.com/hardware/specialoffers.mspx
Plz check this url..., i want to use the menu as shown in that page ..
whether it is a tool ? or how it is done?
Thanks in advance
Ramkumar
Ramkumar
|
|
|
|
|
Where did you find a menu? Its the old style Navigation Bar.
Use Ul,LI to make it, or make using divs.
|
|
|
|