|
I have a requirement to read the view file, please help me out ?
How to access FoxPro .VUE (view file) using asp.net to read the data ?
Kind Regards,
Madhusudan Kushwaha
|
|
|
|
|
please don't double post.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
I have a requirement to read the view file, please help me out ?
How to access FoxPro .VUE (view file) using asp.net to read the data ?
Kind Regards,
Madhusudan Kushwaha
|
|
|
|
|
Hi,
I have page in which user will fill the data by clicking submit....once he click submit button it goes to the next page and I want when user wants to go back to previous the content of previous page must be clear and he get the message "Page expire".
Regards,
KBM
|
|
|
|
|
ASP.NET 1:
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
Response.CacheControl = "no-cache";
Response.Expires = -500;
ASP.NET 2:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); //or a date much earlier than current time
-----
|
|
|
|
|
I have a Master Page and would like to be able to allow each page pull meta tag keyword and description information from an SQL database. How would I add these to each page, pulling that information from an SQL table?
Matthew Hansel
|
|
|
|
|
A MasterPage still supports code-behind. Add a literal control to the master page and set the text as you would on any other data driven page.
only two letters away from being an asset
|
|
|
|
|
I am still new to this. Could you possibly post a sample piece of code to show how this is done? Thank you.
Matthew Hansel
|
|
|
|
|
<br />
<head runat="server"><br />
<asp:literal runat="server" id="meta"></asp:literal><br />
</head><br />
<br />
protected void SetMetaTag()<br />
{<br />
meta.Text = GetMetaTagsFromDb();<br />
}<br />
only two letters away from being an asset
|
|
|
|
|
My question is this:
I have been able to get a feedback form w/ Captcha working and redirecting to a page after successful completion; now I need to send the information gathered in the form to an email address. How can I get this to happen?
Thanks for your help!
----- feedback.aspx.cs -----
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
Response.Redirect("http://www.talligewi62.org");
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
----- End of File -----
|
|
|
|
|
google?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes; but where do I put it in the file?
|
|
|
|
|
nickabradley wrote: where do I put it in the file?
Which file are you talking about?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Here is a copy of my feedback.aspx.cs file...
--- feedback.aspx.cs ---
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
Response.Redirect("http://www.talligewi62.org");
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
--- End of File ---
I believe that the below bit of code will allow me to send the form info back to me in a email (I’m not sure), and I think it would go somewhere in the OnSuccess section of the feedback.aspx.cs file; I just don’t know how to format it to make it work. After they complete the form I need it to send the info back to me and then redirect them to a different page.
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("nickbradley@talligewi62.org");
message.Subject = "Talligewi 62 Website Feedback";
message.Bcc.Add(new MailAddress("winterbanquet@talligewi62.org"));
message.IsBodyHtml = false;
message.Body = txtMessage.Text;
smtpClient.Send(message);
}
|
|
|
|
|
No idea about OnSuccess event or OnFailure event.. Where do you get those events??
SmtpClient smtpClient = new SmtpClient("YourSMTPServer");<br />
MailMessage message = new MailMessage();<br />
<br />
try<br />
{<br />
MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);<br />
smtpClient.Host = "localhost";<br />
smtpClient.Port = 25;<br />
message.From = fromAddress;<br />
message.To.Add("nickbradley@talligewi62.org");<br />
message.Subject = "Talligewi 62 Website Feedback";<br />
message.Bcc.Add(new MailAddress("winterbanquet@talligewi62.org"));<br />
message.IsBodyHtml = false;<br />
message.Body = txtMessage.Text;<br />
smtpClient.Send(message);<br />
<br />
Response.Redirect("http://www.talligewi62.org");<br />
}<br />
catch(Exception ex){<br />
}<br />
You can redirect after sending the mail
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
OnSuccess event and OnFailure event were included in the example file that I’m using to try and make work.
Below is a copy of two of the files that are part of my feedback form:
Something’s wrong I just don’t know what…
Is there a way I can send you a zip file with every thing so maybe you can see what’s going on here?
--- feedback.aspx ---
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="feedback.aspx.cs" Inherits="_Default" %>
<%@ Register TagName="Captcha" TagPrefix="Controls" Src="~/Control/Captcha.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Burning Issues</title>
</head>
<body><form id="form1" runat="server">
<br />
<table width="100%" border="0" cellpadding="10">
<tr>
<td width="22%"><div align="right">
Name:</div></td>
<td width="78%">
<asp:TextBox ID="name" runat="server" Width="475px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="name"
ErrorMessage="Please enter your Name">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td><div align="right">Email Address: </div></td>
<td>
<asp:TextBox ID="email" runat="server" Width="475px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="email"
ErrorMessage="Please enter your Email address">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="email"
ErrorMessage="Please enter a valid Email address (Bob@example.com)" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></td>
</tr>
<tr>
<td><div align="right">OA Lodge Name and Number:</div></td>
<td>
<asp:TextBox ID="lodge" runat="server" Width="475px"></asp:TextBox>
</td>
</tr>
<tr>
<td><div align="right">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="Status"
ErrorMessage="Please Slect your Status">*</asp:RequiredFieldValidator>Membership Status:</div></td>
<td><p>
<asp:RadioButtonList ID="Status" runat="server">
<asp:ListItem>Non Member</asp:ListItem>
<asp:ListItem>Ordeal</asp:ListItem>
<asp:ListItem>Brotherhood</asp:ListItem>
<asp:ListItem>Vigil</asp:ListItem>
</asp:RadioButtonList></p>
</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p>Please leave us any questions or comments that you may have. In order for us to be able to reply via e-mail be sure we have you e-mail address above and please keep you questions or comments to fewer than 1000 characters.<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server" ControlToValidate="Remarks" ErrorMessage="Please keep your Comments to 1000 chars or less">*</asp:RequiredFieldValidator></p>
<p>
<asp:TextBox ID="Remarks" runat="server" Height="100px" MaxLength="1000" TextMode="MultiLine"
Width="750px"></asp:TextBox></p>
</div></td>
</tr>
</table>
<p> </p>
<Controls:Captcha ID="captcha" Message="Please enter text shown below:" runat="server"
OnSuccess="OnSuccess" OnFailure="OnFailure" BackgroundColor="#ffffff" />
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
</form>
</body>
</html>
--- End of File ---
--- feedback.aspx.cs ---
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
SmtpClient smtpClient = new SmtpClient("mail.talligewi62.org");
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("nickbradley@talligewi62.org");
message.Subject = "Talligewi 62 Website Feedback";
message.Bcc.Add(new MailAddress("winterbanquet@talligewi62.org"));
message.IsBodyHtml = false;
message.Body = lodge.Text; remarks.Text; Status.Text;
smtpClient.Send(message);
Response.Redirect("http://www.talligewi62.org");
}
catch (Exception ex)
{
}
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
--- End of File ---
|
|
|
|
|
Okay. I understand about the OnSuccess and OnFailure.
nickabradley wrote: message.Body = lodge.Text; remarks.Text; Status.Text;
What is this code?? You should set like that message.Body = lodge.Text + " " + remarks.Text + " " + Status.Text; ..
Except this line, your code should work fine. So, please change the code as I suggested. and try again.. Let us know the result... If you still have the problems after updating, show us the error message..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Server Error in '/feedback' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Email' does not exist in the current context
Source Error:
Line 23: try
Line 24: {
Line 25: MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
Line 26: smtpClient.Host = "localhost";
Line 27: smtpClient.Port = 25;
Source File: c:\Documents and Settings\Nick\Desktop\form\feedback\feedback.aspx.cs Line: 25
Show Detailed Compiler Output:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\App_Web_vylzudcx.dll" /R:"C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\App_Code.civsghgv.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /out:"C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\App_Web_ibwg1szs.dll" /debug- /optimize+ /win32res:"C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\ibwg1szs.res" /w:4 /nowarn:1659;1699 "C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\App_Web_ibwg1szs.0.cs" "C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\App_Web_ibwg1szs.1.cs" "C:\Documents and Settings\Nick\Local Settings\Temp\Temporary ASP.NET Files\feedback\32aabdd3\593d0850\App_Web_ibwg1szs.2.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
c:\Documents and Settings\Nick\Desktop\form\feedback\feedback.aspx.cs(25,55): error CS0103: The name 'Email' does not exist in the current context
c:\Documents and Settings\Nick\Desktop\form\feedback\feedback.aspx.cs(25,67): error CS0103: The name 'Name' does not exist in the current context
c:\Documents and Settings\Nick\Desktop\form\feedback\feedback.aspx.cs(33,47): error CS0103: The name 'remarks' does not exist in the current context
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727
|
|
|
|
|
nickabradley wrote: MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
The variables Email and Name do not exist. Neither does remarks, where-ever you use that.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I got the code to run (no errors and the page redirects after hitting submit) yet I do not get a email; any idea why?
--- feedback.aspx.cs ---
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
SmtpClient smtpClient = new SmtpClient("mail.talligewi62.org");
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(email.Text, name.Text);
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("nickbradley@talligewi62.org");
message.Subject = "Talligewi 62 Website Feedback";
message.Bcc.Add(new MailAddress("banquet@talligewi62.org"));
message.IsBodyHtml = false;
message.Body = lodge.Text + " " + Remarks.Text + " " + Status.Text;
smtpClient.Send(message);
}
catch (Exception ex)
{
}
Response.Redirect("http://www.talligewi62.org");
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
--- End of File ---
Thanks for your help!
|
|
|
|
|
Set the breakpoint at the "Console.Write".
catch (Exception ex)<br />
{<br />
Console.Write(ex.Message);<br />
}
Show the ex.Message and ex.InnerException.Message .
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Here is what i have now; still no email. What am i doing wrong?
Still no error message and no email recived...
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
SmtpClient smtpClient = new SmtpClient("mail.talligewi62.org");
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(email.Text, name.Text);
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("nickbradley@talligewi62.org");
message.Subject = "Talligewi 62 Website Feedback";
message.Bcc.Add(new MailAddress("banquet@talligewi62.org"));
message.IsBodyHtml = false;
message.Body = lodge.Text + " " + Remarks.Text + " " + Status.Text;
smtpClient.Send(message);
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
Response.Redirect("http://www.talligewi62.org");
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
|
|
|
|
|
Hello,
How can I send mails to all users at a time? Means I dont want to write all users mail addresses like "( mail To = new mail (user@..net)" until the end.
And which ways can I send mails to different mail servers? Now I can send e-mails to users only with same mail server (host).
Please give me any ways I do need to follow.
Thanks!
-- modified at 11:19 Sunday 18th November, 2007
|
|
|
|
|
Create a mailing list (aka mailing group) and add all the email accounts to that list. Your mail server will then take care of the rest for you.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi,
I have a serious problem. I'm currently developing an application in which the user should upload many files (600-700 xml files). I've searched the web for a while and so far I realized that there's no way to use the HtmlInputFile class to achive the desired effect just because I can't set programatically the property of the class that stores the path of the selected file.
My first approach was to write some javascript code which would generate
tags but that seemed useless because firstly, in code-behind I can't access them and secondly, I can't set the path of the specified files. On the web I've found some articles which explain how to upload multiple files using the htmlinputfile class but in every case the number of htmlinputfile objects is static and the user should select manually the files he wants to upload. That's fine if you permit 3-5 files to be uploaded but when you want to handle a larger number of files, it is inconvenient.
In my case, the user should provide a folder on the drive and the application should handle the uploading of contents of that folder.
Any help is very, very appreciated!!!
|
|
|
|