|
Help. New to asp.net. I have a webpage with 2 gridview grids that are populated from database.
Each grid represents 1 week of a 2 week pay period. The employees are selected from a listbox that is databound from my-aspnet-user database. I can manually select each employee and click on print button and all is good. Printout looks good. My issue is, is there a way to set it up that I can click print once and have all the separate pay info printed for each employee in the list.
|
|
|
|
|
Just create a loop that iterates through each item in the listbox, and print the data for that employee.
|
|
|
|
|
Yeah but that is the problem. Using a loop to go thru employees, do I have to bring up a webpage for each one and then hit print 50 + times. Need a way to do it once. Example would be awesome as am fairly new to asp. Thank you in advance.
|
|
|
|
|
Sorry I cannot answer that as I have no idea how your code works. It should be possible to capture all the data from your server, and build the print document without going to the server more than once.
|
|
|
|
|
Unfortunately I do not know a way to open 50 pages automatically and have them print automatically. The best you could do if it needs to be done on web pages is to use simple javascript command:
window.onload = function() { window.print(); }
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
This sounds to me like you want to generate a report.
You would use the values in the listbox and some date range to generate the report.
Do you have Crystal Reports or something installed ?
What version of Visual Studio are you using? Where are you storing your data? SQL server?
|
|
|
|
|
I'm using vs2013 ultimate. Don't have crystal reports though. Looking at reportviewer but can only figure out on how to do one payday report. Not sure if possible either way. Was thinking it would be nice if I could some how send all pages to pdf and then print it that way. I'm using Vb as code. And Mysql for database.
|
|
|
|
|
Hi,
I have created a ASP.Net Core Application, after creating it I am getting the following build errors, I have been researching about the errors, so far not much help. If anyone before have gone through the same and can help me, it would be a great help.
And when I compile the application I am getting the following error:
Error CS0234 The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Error CS0246 The type or namespace name 'IWebHost' could not be found (are you missing a using directive or an assembly reference?)
Error CS0103 The name 'WebHost' does not exist in the current context
Anybody can please help me what can I do to run the application smoothly. Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
I'm new to ASP.Net MVC and EF. I had been doing ASP.Net WebForms for years. I think I have a simple question around EF strategies.
I have an existing db and I don't remember which article I followed but I ended up with an edmx file and auto generated models. If I want to make changes (like add annotations (DisplayName, StringLength, etc)) I have to do a separate mapping class that is partial and has the same name as the autogenerated class and point to another class where I make the changes. It's a little annoying but this way I can update the autogenerated classes any time I want from the edmx and not lose my code changes.
However, in a separate project I used the Reverse Engineer Code First tool to generate POCO and mappings because I like the idea of control over my c# classes. However, if I make changes to them and re-run the tool I lose the changes again.
What I would like, I think, is a mix of code first and database first. I like control over the c# files and also control over the database without losing changes on either side.
Does this make sense? Is there an alternative I am not aware of? Any advice?
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hello Guys,
I am building a web application of company payroll management,
Where multiple companies will register and payroll will be maintained.
I also have to use ESB for the security of the application and have to build APIs between client and server.
-- modified 13-Apr-18 6:39am.
|
|
|
|
|
So, what is your question?
|
|
|
|
|
I need some code references based on requirement
|
|
|
|
|
What do you mean? If you want samples or tutorials then you need to search for them yourself.
|
|
|
|
|
Thanks Richard i have done that some already, but as here will be some code group or individual, who can suggest me better.
So that's why i asked for the same
|
|
|
|
|
|
|
Hi All,
We have a large number of infopath forms that where setup by some consultants. They are bulky and well only sort of work. Just wondering if anyone has encountered a tool to convert them to a webforms project (I'm lazy). I have spent some time searching for such a tool, and not really found anything. It would be nice, not to have to try manually converting them all (I know I will have to fix all the code behind, mostly cause its a spaghetti mess).
Thanks
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|
|
I have seen some programmer in favor of generic and some in favor of concrete repository.
What i feel concrete repository would be more readable & maintainable & understandable than generic one.Although we have to write more code for concrete repository than generic repository.
what you guys think which one is the best and why ?
|
|
|
|
|
|
I changed the way my store handles querystrings by switching to route attr. Everything works fine with the routes, but I had custom error pages for the shopping pages that worked fine but don't route there anymore.
Guess my question is, when a page request that doesn't qualify with the route attr, where does the code go?
I don't even get the Global.asax Application Error any more. That's where I was handling page errors.
If it ain't broke don't fix it
|
|
|
|
|
So it's called when [Route()] constraints fail.
You add another route for the action without querystring.
None of the documentation said this was possible, and only showed examples of one route attribute. Guess you can add as many as you need.
[HttpGet]
[Route("Dp")]
[Route("Dp/{parameter:int?}/{name}")]
[HandleStoreError]
public ActionResult Dp(int? parameter, string name)
If it ain't broke don't fix it
|
|
|
|
|
one rest principal is not clear to me that is Uniform Interface
what is Uniform Interface and how to explain this with points. thanks
|
|
|
|
|
"Object reference not set to an instance of an object."
Hello Friends, i want suggestions for this problem. In ASP.net MVC am Using entity framework and trying to get a list of employees using the model class itself generated by system,now its showing me this error, how to handle it please suggest.
//Here is my index.cshtml code.
@model IEnumerable
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
Index
@Html.ActionLink("Create New", "Create")
@Html.DisplayNameFor(model => model.EmpName)
@Html.DisplayNameFor(model => model.Designation)
@Html.DisplayNameFor(model => model.Salary)
@Html.DisplayNameFor(model => model.Email)
@Html.DisplayNameFor(model => model.Mobile)
@Html.DisplayNameFor(model => model.Qualification)
@Html.DisplayNameFor(model => model.Manager)
@foreach (var item in Model) {
@Html.DisplayFor(modelItem => item.EmpName)
@Html.DisplayFor(modelItem => item.Designation)
@Html.DisplayFor(modelItem => item.Salary)
@Html.DisplayFor(modelItem => item.Email)
@Html.DisplayFor(modelItem => item.Mobile)
@Html.DisplayFor(modelItem => item.Qualification)
@Html.DisplayFor(modelItem => item.Manager)
@Html.ActionLink("Edit", "Edit", new { id=item.Eid }) |
@Html.ActionLink("Details", "Details", new { id=item.Eid }) |
@Html.ActionLink("Delete", "Delete", new { id=item.Eid })
}
|
|
|
|
|
Something is null somewhere in your code when it shouldn't be.
Since you haven't told us which line of your view the exception is thrown from, we can't give you any more details.
Debug your code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello sir am attaching my homeController code to this file check it and let me know where should i make the changes and how at_least give me code_snippet for making changes into my code instead.
//HomeController
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TestMvcApplication.Models;
namespace TestMvcApplication.Controllers
{
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
return View();
}
// get regester
public ActionResult Register()
{
return View();
}
public ActionResult Login()
{
return View();
}
[HttpPost]
public ActionResult Register(tblEmployee obj)
{
if (ModelState.IsValid)
{
MYDBEntities1 db = new MYDBEntities1();
db.tblEmployees.Add(obj);
db.SaveChanges();
}
return View(obj);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login(UserProfile objUser)
{
if (ModelState.IsValid)
{
using (MYDBEntities1 db = new MYDBEntities1())
{
var obj = db.UserProfiles.Where(a => a.UserName.Equals(objUser.UserName) && a.Password.Equals(objUser.Password)).FirstOrDefault();
if (obj != null)
{
Session["UserID"] = obj.UserId.ToString();
Session["UserName"] = obj.UserName.ToString();
return RedirectToAction("Register");
}
}
}
return View(objUser);
}
[HttpGet]
public ActionResult Edit(int id)
{
return View();
}
|
|
|
|