|
|
Hi All,
We need to develop a system which requires approve and reject button in email.
googled, but could not find proper method.
Please suggest me, how to make approve button work in email.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
What does this have to do with ASP.NET? Why not keep things simple and just have your approve/reject buttons be images in the emails that are links to your website?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
|
Hi All,
I have an asp.Net application which is using Entity Framework to connect to the Database and for DML operations. So I am using User Name and Password in my web config, now my question is, is there any way to hide these credentials or encrypt it. Which approach is best for security of Database credentials in Web config files. My ASP.Net UI is interacting with WCF service that is intern interacting with Entity Framework, in which projects I should keep these connection strings and what is the best approach for security.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
You may want to read up on Basic Security Practices for Web Applications[^]...
Specifically Access Databases Securely, there's a little bit on using integrated security. I hope this helps some.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
indian143 wrote: My ASP.Net UI is interacting with WCF service that is intern interacting with Entity Framework, in which projects I should keep these connection strings
It needs to be kept in the WCF service layer
<connectionStrings>
<add name="XYZEntities" connectionString="metadata=res://*/DataAccessStrategy.Components.PartnerRenewal.csdl|res://*/DataAccessStrategy.Components.PartnerRenewal.ssdl|res://*/DataAccessStrategy.Components.PartnerRenewal.msl;provider=System.Data.SqlClient;provider connection string="Data Source=ServerName;Initial Catalog=DBName;User ID=username;Password=password;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/>
</connectionStrings>
You can refer the article on Task Management System that uses the similar technologies that you are using in your project. That may help you.[^]
Niladri Biswas
(Code Project MVP 2012)
|
|
|
|
|
Hi,
I am using oracle and c#.net. In my application, i need to populate a dropdownlist from one oracle db of a particular server/port/schema and populate another dropdownlist from another oracle db from another server/port.
Both the connections were success while connecting using oracle sql developer tool but in my application, i could not load the second control. Invalid username/password. logon failed error comes for the same credentials.
I am new to oracle. Please help me where i have to correct. Thanks in advance.
Thanks,
Lalitha
|
|
|
|
|
That means the supplied credentials are wrong (for the second case). Provide correct credentials and it should work. Check Checking Connection to Oracle Database for testing the connectivity.
In case , the credentials are correct, then may be the connection path is wrong
e.g. in
OracleConnection connection = new OracleConnection(@connectionPath);
check the value for @connectionPath e.g.
string connectionPath = "Data Source=orcl;User Id=scott;Password=tiger;Persist Security Info=False";
Hope this will help.
[^]
Niladri Biswas
(Code Project MVP 2012)
|
|
|
|
|
Hi,
I have given ftp server (say server), username, password and virtual directory path (say xxx/yyy/zzz) and a file name(file.txt).
I need to connect to a FTP server and check that file is exists in that virtual path.
When i tried using FtpWebRequest request = (FtpWebRequest) WebRequest.Create("ftp://server/xxx/yyy/zzz/file.txt");, it say invalid directory since the directory which i mentioned is not physically present in the ftp server.
Please help me with the best approach to connect to virtual directory in ftp server. I am using dot net 2.0 & c#.
thanks in advance.
Lalitha
|
|
|
|
|
The code seems right.
// Get the object used to communicate with the server.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.testdomain.com/test.htm");
But what is wrong is the directory path. As you said, the path doesn't exists, then you should not use that.
Do one thing,
Type: ftp://server from windows explorer
enter your login details and check the right path.
Hope this helps.
cheers
|
|
|
|
|
Hi All,
I am fairly new to the MVC and am strugling with comboboxes/dropdown lists all day, but have the better part working. The following is my problem.
I have 2 models defined
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
namespace AgentBase.ContentRepository.Models
{
public class cContent
{
public int ID { get; set; }
public string CO_TITLE { get; set; }
public string CO_TAGS { get; set; }
public string CO_SUMMARY { get; set; }
public bool CO_INTEXT { get; set; }
public Int32 CO_TYPE { get; set; }
public decimal CO_SIZE { get; set; }
public string CO_NOTES { get; set; }
public string CO_COPYRIGHT { get; set; }
}
}
and
using System;
using System.Data.Entity;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace AgentBase.ContentRepository.Models
{
public class cCategory
{
public int ID { get; set; }
public string CA_DESCRIPTION { get; set; }
public Int32 CA_PARENT { get; set; }
public bool CA_ACTIVE { get; set; }
}
}
Then i have 2 controllers defined
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AgentBase.ContentRepository.Models;
namespace AgentBase.ContentRepository.Controllers
{
public class ContentRecordsController : Controller
{
private ContentRepositoryObjects db = new ContentRepositoryObjects();
public ViewResult Index()
{
var query = db.Categories.Select(c => new { c.ID, c.CA_DESCRIPTION });
ViewBag.Categories = new SelectList(query.AsEnumerable(), "ID", "CA_DESCRIPTION");
return View(db.ContentRecords.ToList());
}
public ViewResult Details(int id)
{
cContent ccontent = db.ContentRecords.Find(id);
var query = db.Categories.Select(c => new { c.ID, c.CA_DESCRIPTION });
ViewBag.Categories = new SelectList(query.AsEnumerable(), "ID", "CA_DESCRIPTION");
return View(ccontent);
}
public ActionResult Create()
{
var query = db.Categories.Select(c => new { c.ID, c.CA_DESCRIPTION });
ViewBag.Categories = new SelectList(query.AsEnumerable(),"ID", "CA_DESCRIPTION");
return View();
}
[HttpPost]
public ActionResult Create(cContent ccontent)
{
if (ModelState.IsValid)
{
db.ContentRecords.Add(ccontent);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(ccontent);
}
public ActionResult Edit(int id)
{
cContent ccontent = db.ContentRecords.Find(id);
var query = db.Categories.Select(c => new { c.ID, c.CA_DESCRIPTION });
ViewBag.Categories = new SelectList(query.AsEnumerable(), "ID", "CA_DESCRIPTION");
return View(ccontent);
}
[HttpPost]
public ActionResult Edit(cContent ccontent)
{
if (ModelState.IsValid)
{
db.Entry(ccontent).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(ccontent);
}
public ActionResult Delete(int id)
{
cContent ccontent = db.ContentRecords.Find(id);
return View(ccontent);
}
[HttpPost, ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
cContent ccontent = db.ContentRecords.Find(id);
db.ContentRecords.Remove(ccontent);
db.SaveChanges();
return RedirectToAction("Index");
}
protected override void Dispose(bool disposing)
{
db.Dispose();
base.Dispose(disposing);
}
}
}
and
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AgentBase.ContentRepository.Models;
namespace AgentBase.ContentRepository.Controllers
{
public class CategoryController : Controller
{
private ContentRepositoryObjects db = new ContentRepositoryObjects();
public ViewResult Index()
{
return View(db.Categories.ToList());
}
public ViewResult Details(int id)
{
cCategory ccategory = db.Categories.Find(id);
return View(ccategory);
}
public ActionResult Create()
{
return View();
}
[HttpPost]
public ActionResult Create(cCategory ccategory)
{
if (ModelState.IsValid)
{
db.Categories.Add(ccategory);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(ccategory);
}
public ActionResult Edit(int id)
{
cCategory ccategory = db.Categories.Find(id);
return View(ccategory);
}
[HttpPost]
public ActionResult Edit(cCategory ccategory)
{
if (ModelState.IsValid)
{
db.Entry(ccategory).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(ccategory);
}
public ActionResult Delete(int id)
{
cCategory ccategory = db.Categories.Find(id);
return View(ccategory);
}
[HttpPost, ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
cCategory ccategory = db.Categories.Find(id);
db.Categories.Remove(ccategory);
db.SaveChanges();
return RedirectToAction("Index");
}
protected override void Dispose(bool disposing)
{
db.Dispose();
base.Dispose(disposing);
}
}
}
then problem now is. That i have a list page where i call
public ViewResult Index()
{
var query = db.Categories.Select(c => new { c.ID, c.CA_DESCRIPTION });
ViewBag.Categories = new SelectList(query.AsEnumerable(), "ID","CA_DESCRIPTION");
return View(db.ContentRecords.ToList());
}
The index page shows me then all records from the ContentRecords.ToList function but that is showing me the CO_TYPE field ID, instead of the corresponding CA_DESCRIPTION from the categories entity. Because CO_TYPE is related to the CA_ID.
So how can I make it possible that the toList function:
a) returns values from two linked entities/models.
or
b) how can i create a new model based on two other more other models by joining them.
or
c) any other method i did not think of
I hope i have made a clear point of my problem. I am stuck any help will be appreciated.
Kind regards,
Marcel Vreuls
AgentBase
<<A good idea can change your life>>
|
|
|
|
|
Hi All,
I have an Asp.Net application in which I am trying to insert/upate a database table in the backend. But I am getting following message.
Unable to update the EntitySet 'message' because it has a DefiningQuery and no <insertfunction> element exists in the <modificationfunctionmapping> element to support the current operation.
Can anybody help me please by giving any suggestions, links or code snippet. Mean time I will be googling about the exception.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hope this[^] answers your problem
Niladri Biswas
(Code Project MVP 2012)
|
|
|
|
|
I have to implement a new feature in my existing asp.net website, Actually in my website one can take online test, my further requirement is after completing the test i have to capture the video of candidate for 30 sec(approx) also, store it and play it again when required
AnyOne can help me PLEASE, Thanks in Advance
|
|
|
|
|
Hi,
I've got an issue with Page.ResolveUrl and an ISA reverse proxy.
We've got an internal webserver that hosts multiple webapplications. The are therefore configured as applications.
Let's say we have:
http://internalserver/applicationX
By using an ISA2006 server this adres is being reverseproxy'd to:
https://subdomain.myorg.com
If i put this in my page
<script src="<%= Page.ResolveUrl("~/MicrosoftAjax.js") %>" ></script>
it wil stil resolve into
https://subdomain.myorg.com/applicationX/MicrosoftAjax.js
Is there a way to make .NET aware that it a reverse proxy is changing the path?
Or should the reverse-proxy solve this?
Kind regards,
Sebastiaan
|
|
|
|
|
Hi
I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute.
Thank you guys
|
|
|
|
|
For starters, don't put repetitive server code in a web application because then you will need something to trigger the process anyway.
Why not investigate using a Windows Service or an application that is setup to be run by the Windows Task Scheduler.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
thank you so much for your answer
but i only have a shared hosting plan not a dedicated server and i definitely don't have access to those kinds of resources.
|
|
|
|
|
The best way to do this is by writing a windows service and run it on the server. this windows service can be written in such a way that it will do some particular task every hour.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
thank you so much for your answer
but i only have a shared hosting plan not a dedicated server and i definitely don't have access to those kinds of resources.
|
|
|
|
|
In that case, I will have to suggest a very very dirty workaround for tackling this problem.
1. Have a page that will do the required task. do the required task only when a specific query string is present. This way you will ensure that only you know this actual link that will perform this operation.
2. Now whenever you access this page with this specific query string this task will run. you can do it manually but you can still automate it. lets see how:
3. create a simple winform application with webbrowser control in it and navigate it to the required page with the specific querystring . all hard coded in the page_load . so when application opens up your task is done. close this app in webbrowser navigated event.
4. Now configure a windows service on your PC that will run this application on a specified time.
P.S. all this assuming that the task you need to perform is not time consuming otherwise you will get timeout problem.
Note: I am not recommending this approach. it is very very bad. but in desperate times such workarounds do work.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
Put ur code as console appln. Use server task-scheduler to trigger that .exe file every hour...
|
|
|
|
|
Is this a task SQL server based?
maybe you could write a SQL job and have it scheduled. (if your hosting agreement allows it)
Just a thought.
|
|
|
|
|
As you are using shared hosting, it is not possible to connect to windows service as this will not be allowed.
Create a web page which will do the task (as per your requirement - say adding some data or sending mail etc). Use query string to specify your parameters. Don't forget to encrypt the querystring value for security concern.
Now the interesting thing, create a windows service in your local machine which calls the above mentioned aspx page with querystring value.
Thus the page is fired in background and the code behind of the page will do the rest.
Thanks,
Sandip
|
|
|
|