|
Check ASP.NET is having write permission on c:\srcfile ? Try server.mappath for the server directory
|
|
|
|
|
when i am sending mail to a person whose domain is same like the domain name i have mentioned in the smtpserver it is sending correctly.but if i will send to a person who has a yahoo email id it's not sending it's showing an error like this
Server Error in '/' Application.
--------------------------------------------------------------------------------
The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x8004020f): The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +2500080
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +72
[HttpException (0x80004005): The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +119
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +2684
System.Web.Mail.SmtpMail.Send(MailMessage message) +131
GEthermometrics_Inquiryform.Inquiryform1.btnsendrequest_Click(Object sender, EventArgs e) in inquiryform.aspx.cs:162
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
can anyone help me.it's urgent
|
|
|
|
|
What about posting some sample code ?
|
|
|
|
|
Hi,
I need to upload all files from the given client's physical folder path to server path.
How do I upload all files to web server path without using "file" type.
Rams.
Be simple and Be sample.
|
|
|
|
|
ramskr wrote: web server path without using "file" type.
But whats the problem with File type ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
User can be able to choose only the folder, not the files.
Be simple and Be sample.
|
|
|
|
|
ramskr wrote: How do I upload all files to web server path without using "file" type.
First get the files in that directory using
System.IO.Directory.GetFiles
The above line will return all the files present in the directory as a string array.
ramskr wrote: I need to upload all files from the given client's physical folder path to server path.
Use webclient class. It is having upload method. Start a loop till end of the above string array and upload each file using webclient method in the loop. Finally dispose webclient object
|
|
|
|
|
I need the list of client side files for the selected folder.
For eg, if user choose D:\Test, my web application needs to upload all files in that client folder to web path.
If we use system.io.directory.getfiles - it searches on server and cause exception as "could't find the path"..
Is there any way to get all files on client machine and upload to server machine.
Be simple and Be sample.
|
|
|
|
|
ramskr wrote: Is there any way to get all files on client machine and upload to server machine.
Upto my knowledge there is no method to do this using server side scripting. Because this will break the security system. If a server side script can list out the files in your directory then what is the security for your files ?
|
|
|
|
|
Hi,
I need user on client machine to select path from that machine (local folder only). On Upload, my web application needs to get all the files in that folder and upload it to fixed server path.
All I need is to get files for the selected client path.
Be simple and Be sample.
|
|
|
|
|
Hi,
I have a dotnet application in which i have to import data from an excel sheet and store datas in mysql table to display those datas in my dotnet application. Iam using this datas to display datas for generating employee salary slip in my dotnet application. pls do help me with source code in C#.
Regards
Vijay.
|
|
|
|
|
|
i have a database table to store all the article content which has a field is memo data type to store all the article content(generally contains richtext). how to use asp.net to read from a word document then store the content into this field?
I am Entry level person
|
|
|
|
|
hi the below was my attempt of trying to make a new browser pop up when a button is clicked with java scipt
although it compiles it doest work instead of poping up another browser it just redirect to inself couls some1 help me see if i did anyhting wrong pls
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<script type="text/javascript"><br />
function OpenWindow()<br />
{<br />
window.open("Default.aspx", "_blank");<br />
<br />
}</script><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head runat="server"><br />
<title>Untitled Page</title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click1" /></div><br />
</form><br />
</body><br />
</html><br />
<br />
<br />
<br />
the code behind file in the form load<br />
<br />
<br />
Button1.Attributes.Add("Onclick", "<script>OpenWindow();</script>");
|
|
|
|
|
Try this, in your button click event (or even in its open function) add
Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
' Do some other processing...
Dim sb As New StringBuilder()
sb.Append("<script>")
sb.Append("window.open('http:
sb.Append("</scri");
sb.Append("pt>")
Page.RegisterStartupScript("test", sb.ToString())
End Sub
Then in your button
<asp:Button id="Button1" onclick="Button1_Click" runat="server" text="Go!"></asp:Button>
Make sure you add
Imports System.Text
To the top of your code behind as this uses the StringBuilder Class
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
my code behidn file is c# though >.<
|
|
|
|
|
Then convert the code to C#
void Button1_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("window.open('http://msdn.microsoft.com', '', '');");
sb.Append("</scri");
sb.Append("pt>");
Page.RegisterStartupScript("test", sb.ToString());
}
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
string buffer in vb means string builder in c#??
wow i didnt know >><
|
|
|
|
|
neodeaths wrote: string buffer in vb means string builder in c#?
No. StringBuffer is a Java class. It's StringBuilder both in VB.NET and C#.
---
single minded; short sighted; long gone;
|
|
|
|
|
use the following statement in your javascript
window.open("default.aspx","popupwindow","width=600,height=50px");
Koushik
|
|
|
|
|
Why do you do a postback to call the Javascript? Do it all in the browser:
<input type="button" value="Button" onclick="OpenWindow();" />
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I have a content page and I have textboxes for name, address, phoneNumber, email address.
But how can i use the following javascript for form validation because in contentpage there
is no html head and body section.
function FormValidate()
{
if(this.txtPhone.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1)
{
alert("The phone number you entered is not valid.\r\nPlease enter a phone number with the format xxx-xxx-xxxx.");
return false;
}
}
|
|
|
|
|
You can add a tag inside "asp:content" tag and call the javascript functions. e.g. -
asp:Content ID="Content1" ContentPlaceHolderID="ContentHolderID" Runat="server">
<script type="text/javascript" language="javascript">
function FormValidate()
{
....
Hope this helps.
|
|
|
|
|
Good afternoon,
I am fumbling my way thru my first ASP.NET project and I have a question about contentplaceholders.
I have a master page that has 3 contentplaceholders. Pages that derive from this master page have custom html\text content in the contentplaceholders.
I want to allow users the ability to change the customer html\text for a derived page.
The master page:
<code>
<asp:ContentPlaceHolder ID="phMain" runat="server">
<h3>News of the day!</h3>
</asp:ContentPlaceHolder>
</code>
I want to programmatically alter the content of "phMain" in the master page from "News of the day! to "News of the Hour" in a derived page. Is there a way to do this without having to add controls (a label or textbox) to the contentplaceholder?
Thanks.
|
|
|
|
|
First of all you will have to create some javascript to determine if there is a link.
Then tou add a call to this script the event "ontextchanged"
if there is a link you can style the text as a link (blue and underline), then you add some javascript to the click event on the textbox to make the link work (location.href....)
Tha disadvantage with this method is that all the text in the textbox will be treated as a link. You cant have the value "klikk on http://www.dummy.com" and make only the url a link...
Hope this helps.
|
|
|
|