|
You can create Sql job which executes in every say 5 minutes and fetch entry from database which mail to send.
To send the mail, you can use Clr Stored procedure.
Another approach is:
send mail using Windows/Other scheduler.
|
|
|
|
|
Create a windows application/service that will be sending emails at your chosen time. That way you have more control on other functionalities to add before and after sending your e-mails.
Good luck,
Morgs
|
|
|
|
|
Hi, I was creating a login form in visual web developer express. In my web.config, I have inserted these codes for the connection of my database:
<connectionStrings>
<clear />
<add name="LocalSQLServer"
connectionString="Server=.;Database=youtubelogin;Trusted_Connection=Yes;" />
</connectionStrings>
The problem is when I add a Login control on my page, and click on the ASP.Net configuration website for the security to add roles, I got this error:
The connection name 'ApplicationServices' was not found in the applications configuration or the connection string is empty. (c:\documents and settings\ali\my documents\visual studio 2010\Projects\Youtube\Youtube\web.config line 25)
Here is my entire web.config below:
="1.0"
<configuration>
<connectionStrings>
<clear />
<add name="LocalSQLServer"
connectionString="Server=.;Database=youtubelogin;Trusted_Connection=Yes;" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Help me, I'm a beginner..
|
|
|
|
|
Hello,
Problem 1:
I am developing a website. The start page is index.html, it redirects a user to the 'destination.aspx' page.
While the site is in development I have a 'coming soon' page that has a login form to restrict access to the main page.
I set windows forms authentication in web.config and the user is redirected to 'destination.aspx' page after login and the default login page is the 'coming soon' page.
The problem:
when I ented the sitename intothe addressbar I see the 'coming soon' page. Then I login but instead of seeing the 'destination.aspx' page it opens the login page again instead and opens the 'destination.aspx' page after the second-time login.
How to fix it?
Problem 2:
how to change how the address of the site looks in the address bar?
- I need it to be sitename.com instead of www.sitename.com
- I need it to look like sitename.com/itemname instead of sitename.com/destdir/destination.aspx?itemname
- need sitename.com instead of sitename.com/destdir/destination.aspx
How to do that?
I am using asp.Net framework 4.0 and windows hosting/Plesk control panel.
Thank you
EDIT:
my web.config login part:
<forms name=".ASPXAUTH" loginUrl="./ComingSoon/index.aspx" timeout="180" requireSSL="false"
defaultUrl="./Destination/destination.aspx" protection="All" cookieless="UseUri" >
Clarification on problem 1:
I enter the sitename and index.html opens 'coming soon' login page http://www.sitename.com/ComingSoon/i...?ReturnUrl=%2f. I enter the password and instead of being redirected to 'destination.aspx' main page the login page is opened again. (http://www.sitename.com/ComingSoon/i...stination.aspx) Then I enter the password again and after this attempt it redirects me to the main page - 'destination.aspx'.
-- modified 4-Oct-11 20:26pm.
|
|
|
|
|
|
Thank you!
My first problem is that after a user has logged in he is redirected to login page again instead of being redirected to the post-login (default) page.
|
|
|
|
|
Gathering from the original post you said you have set "windows forms" authentication?
But to my understanding those are two different authentication types:
1. Windows Authentication
- http://msdn.microsoft.com/en-us/library/ff647405.aspx[^]
2. Forms Authentication
- http://msdn.microsoft.com/en-us/library/ff647070.aspx[^]
But likewise, there are many ways you can resolve figuring out as to whether or not a user is logged, simply create lets say a Session["user"] when user logs in. e.g.
Session[ "user" ] = "ValueToIdentifyUser";
To check if requesting user has logged in, check like so:
if( Session[ "user" ] != null )
{
}
else
{
}
Hope that helps,
Morgs
|
|
|
|
|
Hi
we have 8 usercontrols on .aspx page and we are getting data through restapi(Webservice Htttp singel Url for all 8 user controls) once we get the data from restapi and we are storing data into "Session" .Session data will be loaded for all user controls,We need to improve performance of page , how can we achieve this .Please suggest me better way.
Regards,
Vishnu.
|
|
|
|
|
We don't have idea about code performance but we can suggest here that use caching on service side OR Aps side.
Parwej Ahamad
|
|
|
|
|
You have left many question unanswered. What type of data? How much? How often is it used/accessed? What are your metrics for performance? How will you tell if there is an improvement? Is the data shared by users or unique to an individual user? Are the servers load balanced?
No comment
|
|
|
|
|
Hey Guys,
Sorry for posting this in the wrong section, don't really know where else to post this.
My website sends a confirmation email to registered delegates with a navy blue background color,
Is there a way to change the reply font color to white when they reply on the email?
Thanks in advance.
|
|
|
|
|
Not possible from other side when anyone replying because you don't have control over other aps.
Parwej Ahamad
|
|
|
|
|
hi,i have a Grid view with 3 textbox in it and put iy in a Update Panel.When User Pressed Tab Key In current Text Box Of Grid View,Onblur Event Runs And In this Case According to my Java Script Function,Page Get Refresh,hence,GridView Lose Its textbox Focus.I Want When User Pressed Tab Key And Page Get Refreshed,Next TextBox In Gridview Get Focus.Can Help Me whats The Easiest Way To DO It?
thanks in advance
|
|
|
|
|
Hello,
I'm necessary need to create a project that only display CCTV in a webPage, please help me that i must what to do and need it and if you have any article about this i will happy for give me.
Thank you for all.
|
|
|
|
|
|
I have a C# 2010 web forms application that uses master pages, themes, and cascading styles sheets on the same web pages. Since I am new to master pages, can you tell me how I would know what part of the web pages uses css and what part uses master pages, and the base master page, and what part uses themes? If there some kind of a rule on what takes precedence if the same part of the master page is access? Does css, theme,and or master page precendence. If there is no precendence, can you tell me how I would knowwhat part uses css, what part uses themes, and what part uses themes?
|
|
|
|
|
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 Admin_NhanVien_Admin : System.Web.UI.Page
{
CTH51Cls.NhanVien nv = new CTH51Cls.NhanVien();
CTH51Cls.PhongBan ph = new CTH51Cls.PhongBan();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
griNhanVien.DataSource = nv.DS();
griNhanVien.DataBind();
droPhongBan.DataSource = ph.DS();
droPhongBan.DataBind();
}
}
protected void btnThem_Click(object sender, EventArgs e)
{
CTH51Cls.NhanVien nv = new CTH51Cls.NhanVien();
txtHoTen.Text = txtHoTen.Text.Trim();
while (txtHoTen.Text.IndexOf(" ") >= 0)
{
txtHoTen.Text = txtHoTen.Text.Replace(" ", " ");
}
nv.HoNV = txtHoTen.Text.Substring(0, txtHoTen.Text.LastIndexOf(" "));
nv.TenNV = txtHoTen.Text.Substring(txtHoTen.Text.LastIndexOf(" ") + 1);
nv.DienThoai = txtDienThoai.Text;
nv.GioiTinh = chkGioiTinh.Checked;
nv.DiaChi = txtDiaChi.Text;
if (fileAnhNV.HasFile)
if (System.IO.File.Exists(Server.MapPath("~/Resource/Staff/") + fileAnhNV.FileName))
nv.AnhNV = "";
else
{
nv.AnhNV = fileAnhNV.FileName;
string duongdan = Server.MapPath("~/Resource/Staff/");
fileAnhNV.SaveAs(duongdan + fileAnhNV.FileName);
}
else
nv.AnhNV = "";
nv.Email = txtEmail.Text;
nv.MatKhau = txtEmail.Text;
nv.MaPB = int.Parse(droPhongBan.SelectedValue);
nv.Them();
griNhanVien.DataSource = nv.DS();
griNhanVien.DataBind();
txtMaNV.Text = "";
txtHoTen.Text = "";
txtDienThoai.Text = "";
txtDiaChi.Text = "";
txtEmail.Text = "";
imgAnhNV.ImageUrl = "";
chkGioiTinh.Checked = false;
}
protected void griNhanVien_SelectedIndexChanged(object sender, EventArgs e)
{
nv.MaNV = int.Parse(griNhanVien.SelectedValue.ToString());
nv.CT();
txtMaNV.Text = nv.MaNV.ToString();
txtHoTen.Text = nv.HoNV + " " + nv.TenNV;
txtDienThoai.Text = nv.DienThoai;
chkGioiTinh.Checked = nv.GioiTinh;
txtDiaChi.Text = nv.DiaChi;
if (nv.AnhNV != "")
imgAnhNV.ImageUrl = "~/Resource/Staff/" + nv.AnhNV;
else imgAnhNV.ImageUrl = "";
txtEmail.Text = nv.Email;
droPhongBan.SelectedValue = nv.MaPB.ToString();
imgAnhNV.ToolTip = imgAnhNV.ImageUrl.Substring(imgAnhNV.ImageUrl.LastIndexOf("/") + 1);
}
protected void btnXoa_Click(object sender, EventArgs e)
{
CTH51Cls.NhanVien nv = new CTH51Cls.NhanVien();
nv.MaNV = int.Parse(txtMaNV.Text);
nv.Xoa();
griNhanVien.DataSource = nv.DS();
griNhanVien.DataBind();
if (System.IO.File.Exists(Server.MapPath(imgAnhNV.ImageUrl)))
System.IO.File.Delete(Server.MapPath(imgAnhNV.ImageUrl));
txtMaNV.Text = "";
txtHoTen.Text = "";
txtDienThoai.Text = "";
txtDiaChi.Text = "";
txtEmail.Text = "";
chkGioiTinh.Checked = false;
}
protected void btnSua_Click(object sender, EventArgs e)
{
CTH51Cls.NhanVien nv = new CTH51Cls.NhanVien();
nv.MaNV = int.Parse(txtMaNV.Text);
nv.HoNV = txtHoTen.Text.Substring(0, txtHoTen.Text.LastIndexOf(" "));
nv.TenNV = txtHoTen.Text.Substring(txtHoTen.Text.LastIndexOf(" ") + 1);
nv.DienThoai = txtDienThoai.Text;
nv.GioiTinh = chkGioiTinh.Checked;
nv.DiaChi = txtDiaChi.Text;
if (fileAnhNV.HasFile)
{
if (System.IO.File.Exists(Server.MapPath(imgAnhNV.ImageUrl)))
System.IO.File.Delete(Server.MapPath(imgAnhNV.ImageUrl));
if (System.IO.File.Exists(Server.MapPath("~/Resource/Staff/") + fileAnhNV.FileName))
nv.AnhNV = "";
else
{
nv.AnhNV = fileAnhNV.FileName;
string duongdan = Server.MapPath("~/Resource/Staff/");
fileAnhNV.SaveAs(duongdan + fileAnhNV.FileName);
}
}
else
nv.AnhNV = imgAnhNV.ImageUrl.Substring(imgAnhNV.ImageUrl.LastIndexOf("/") + 1);
nv.Email = txtEmail.Text;
nv.MatKhau = txtEmail.Text;
nv.MaPB = int.Parse(droPhongBan.SelectedValue);
nv.Sua();
griNhanVien.DataSource = nv.DS();
griNhanVien.DataBind();
txtMaNV.Text = "";
txtHoTen.Text = "";
txtDienThoai.Text = "";
txtDiaChi.Text = "";
txtEmail.Text = "";
imgAnhNV.ImageUrl = "";
chkGioiTinh.Checked = false;
}
}
modified 3-Oct-11 19:15pm.
|
|
|
|
|
This is an English Speaking Site.
Please Translate otherwise no help can be given.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
|
How to fetch records as
OTH
IA
LE
from table using Like query without using OR.as
select *from Issue where ReqControlNo like '%i%' or ReqControlNo like '%h%' or ReqControlNo like '%l%'
query should be as
select *from Issue where ReqControlNo like 'condition'
the condition should be in one string.
is there any solution please?
|
|
|
|
|
This has nothing to do with ASP.NET, please use a forum more appropriate to your subject.
|
|
|
|
|
I have submitted this in database forum.
thanks.
|
|
|
|
|
i have in @page directive assign master page . how do I override this at run time?
|
|
|
|
|
Page object raised event called "PreInit" and this event call the method "OnPreInit()", so in any places you can set it.
protected void Page_PreInit(object sender, EventArgs e)
{
}
protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "/Site.master";
}
Parwej Ahamad
|
|
|
|
|
I try that... but in case where @page directive master page is not found it's throw ex prior to do preIn event
|
|
|
|