|
bhavna4321 wrote: beyond a certain limit my string builder does not append the string and its value becomes
null
Weird! What is the reason for appending such huge strings?
|
|
|
|
|
Is there any exception?
First check the capacity of stringbulder object if it is less than the string you are assigning to stringbuilder then increase the capacity using the property Capacity or EnsureCapacity mathod.and let me know the result too.
Cheers!!
Brij
|
|
|
|
|
Brij wrote: then increase the capacity using the property Capacity or EnsureCapacity mathod
You don't need to ensure the capacity explicitly. StringBuilder knows to grow and shrink whenever required.
|
|
|
|
|
You are right Navneeth.but the amount of memory allocated is implementation-specific, and ArgumentOutOfRangeException is thrown if the amount of memory required is greater than the maximum capacity.
Cheers!!
Brij
|
|
|
|
|
Hi all,
iam going to validate the email ID if it is already exist in DB using custom validator
Here is code
protected void ValidateEmail(object source, System.Web.UI.WebControls.ServerValidateEventArgs args)
{
string sqlCmd =
"SELECT Email FROM User_Profile WHERE Email = " +
Util.Quote(email.Value.Trim());
OdbcCommand command = new OdbcCommand(sqlCmd, con);
OdbcDataReader reader = command.ExecuteReader();
args.IsValid = !reader.HasRows;
reader.Close();
}
iam getting Error at this Place that
Util.Quote(email.Value.Trim());
'System.Web.UI.Util' is inaccessible due to its protection level
kindly guide me what iam doing wrong
best Regards
Rameez
modified on Monday, December 29, 2008 7:22 AM
|
|
|
|
|
rameez Raja wrote: 'System.Web.UI.Util' is inaccessible due to its protection level
Since I cannot find "Util" anywhere in the Microsoft documentation as a member of "System.Web.UI", nor any reference to a "System.Web.UI.Util" namespace, I would guess that it is not a public class/namespace. It is most likely something that is used internally in the .NET framework, and as such, you won't be able to use it directly.
WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated.
There are 10 kinds of people in the world: People who know binary and people who don't.
|
|
|
|
|
MailAddress from = new MailAddress("nithya.d@demo.com");
MailAddress to = new MailAddress("nithydurai@gmai.com");
MailMessage message = new MailMessage(from, to);
message.Subject = "hai dear";
message.Body = "Hello this is a test Mail";
message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure | DeliveryNotificationOptions.Delay;
SmtpClient client = new SmtpClient("75.126.193.146");
// Include credentials if the server requires them.
client.Credentials = new NetworkCredential("info@afxisi.net", "afxisi");
message.Headers.Add("Disposition-Notification-To", "nithya.d@afxisi.co.in");
//client.SendCompleted += new
// SendCompletedEventHandler((this.SendCompleted));
Boolean bTemp = true;
try
{
client.Send(message);
}
catch (SmtpFailedRecipientsException ex)
{
for (int i = 0; i < ex.InnerExceptions.Length; i++)
{
SmtpStatusCode status = ex.InnerExceptions[i].StatusCode;
if (status == SmtpStatusCode.MailboxBusy ||
status == SmtpStatusCode.MailboxUnavailable)
{
Console.WriteLine("Delivery failed - retrying in 5 seconds.");
System.Threading.Thread.Sleep(5000);
client.Send(message);
}
else
{
Console.WriteLine("Failed to deliver message to {0}",
ex.InnerExceptions[i].FailedRecipient);
}
}
}
catch (SmtpException ex)
{
Response.Write(ex.ToString());
}
catch (ObjectDisposedException ex)
{
Response.Write(ex.ToString());
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
}
i send the wrong mail id... but this program not catch the SmtpFailedRecipientsException.... pls help me
|
|
|
|
|
First of all your code is broken. You copied the MSDN example directly into an ASP.NET page? A Console can't work on ASP.NET/web applications.
|
|
|
|
|
i also download the MSDN code.... mail send perfectly but i send wrong mailid... i cannot capture the failure mailid
|
|
|
|
|
Usually the mail-box unavailable or storage size exceeded kind of errors appear hours after you send the mail. This might be the reason that exception is not throwing. To test what I said, change the server to gmail(or whatever is the recipients mail server) and send the mail. Since both are in same server, I assume the exception can be raised by the SmtpClient class.
|
|
|
|
|
can you give any example coding sir
|
|
|
|
|
The example which you got from MSDN is enough. All you have to do is change the server to a server where your recipients email exist.
|
|
|
|
|
have u define web.config file
|
|
|
|
|
No sir how to define in web.config file
|
|
|
|
|
hi u can search this kind of issues from following links
1)http://www.dreamincode.net
2.)echoecho.com
3) w3schools.com
plz let me know if u got the solution
Thanks
Jasjit Singh Jas
|
|
|
|
|
How to develop a messenger using Asp.net..
Is i have to learn networking to develop the system..
Thank you..
|
|
|
|
|
anu_anu wrote: Subject: help me
This is not a subject !!!
anu_anu wrote: How to develop a messenger using Asp.net..
Did you search google first ?
cheers,
Abhijit
|
|
|
|
|
|
I will help[^] you to learn that.
|
|
|
|
|
Fantastic Navaneeth
cheers,
Abhijit
|
|
|
|
|
Apurva Kaushal
|
|
|
|
|
Excellent
Cheers!!
Brij
|
|
|
|
|
Hi,
I am absolutely new to Web programming, so pardon me if I write something stupid in between..
And Thanks for reading the question, any pointers are most welcome
The website is in ASP.NET 2.0 / IE 6.0, 7.0
We store login details in a cookie via HTTPCookie class, when user says "Remember Me" in the login page. Now, if he doesn't log out and starts the same website via favourites (The login page loads again), the cookie doesn't get detected and he has to enter his credentials again. If he closes the page and loads the browser again, the cookie does get detected.
We have added following values in the login.aspx page, which should take care of reloading the page
< OutputCache Duration="1" VaryByParam="none" Location="None" NoStore="true" >
It seems, either cookie doesn't get stored until the page is detected or the page is not getting reloaded. Any ideas about it?
If the question is not clear, please let me know..
Thanks in advance
Misha
Evil triumphs when good people sit quiet...
|
|
|
|
|
Are your login details are saved in cookies.If yes,then when next time user ligins,read the cookie for credential and authenticate the user and send him to next page.If cookie is not found then again ask the user to give the credentials.
Cheers!!
Brij
|
|
|
|
|
Thanks so much,
It seems the query is not clear.
I store the credentials in the cookie. The logic is simple, if cookie found, redirect to next page, else ask for credentials.
The problem is that the cookie detection is not working when I do not close the browser and again open the login page in a new browser - via clicking favourites. However, if I close the browser and open the link again, the cookie gets detected.
The outputcache tag resolves the problem in some sense, that it forces the page to refresh explicitly, so that the cookie is detected once it is stored.
I hope it's understandable now.
Thanks
Evil triumphs when good people sit quiet...
|
|
|
|