|
So, what exactly is your question right now?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
My question is.. how do I find when No available work opportunities found. Thank you !!
<div class="panel panel-primary" style="margin-top:10px;">
<div class="panel-heading">
Work Opportunities Available
</div>
<div class="panel-body">
<img id="pw_workopportunities" src="/Images/pleaseWait.gif" alt="Please Wait" style="margin-left:10px" />
<p id="noWorkopportunities" class="text-info" style="display:none;">
No available work opportunities found.
</p>
<table id="workopportunities" style="display:none;" class="table table-bordered">
<tr>
<th>Project Name/Work Order</th>
' Get all tables in the document
Dim tables As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table") <---- this statements successfully gets all the tables
Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//p[@id='noWorkopportunities'") <---I get an error/nothing
' Iterate all rows in the first table
For k = 0 To rows.Count - 1
|
|
|
|
|
so I have the following code which I would like to adapt to take data straight from my sql database.
The code so far is:
@{
Layout = "~/Views/Shared/_Layout.cshtml";
var myChart = new Chart(width: 600, height: 400, theme: ChartTheme.Green)
.AddTitle("Product Life Cycle")
.AddSeries(
name: "Employee",
chartType: "Spline",
xValue: new[] { "2003", "2004", "2005", "2006", "2007", "2008", "2009", "20010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2022", "2023", "2024", "2025", "2026" },
yValues: new[] { "5.40", "16.17", "109.46", "347.87", "791.62", "1865.88", "2899.26", "4083.32", "4693.27", "6442.52", "8053.77", "9388.84", "9964.89", "10776.18", "4931.34", "2582.54", "752.53", "150.83", "77.87", "31.21", "0.33", "0", "0" })
.Write();
}
I would like to assign xValue and yValue to a table example TBL_MYdata and with the fields ConDate and ConUnits. I am very new to C# and realy need to sort this soon. Many thanks for any help available
|
|
|
|
|
Loading data from the database is best done in the controller, rather than the view.
Assuming you're using raw ADO.NET to access the database, something like this should work:
Controller:
public ActionResult YourAction()
{
var xValues = new List<string>();
var yValues = new List<string>();
using (var connection = new SqlConnection("... YOUR CONNECTION STRING HERE ..."))
using (var command = new SqlCommand("SELECT ConDate, ConUnits FROM TBL_MYdata ORDER BY ConDate", connection))
{
connection.Open();
using (var reader = command.ExecuteReader(CommandBehavior.CloseConnection))
{
while (reader.Read())
{
xValues.Add(Convert.ToString(reader["ConDate"]));
yValues.Add(Convert.ToString(reader["ConUnits"]));
}
}
}
var model = new Chart(width: 600, height: 400, theme: ChartTheme.Green)
.AddTitle("Product Life Cycle")
.AddSeries(name: "Employee", chartType: "Spline", xValues: xValues.ToArray(), yValues: yValues.ToArray());
return View(model);
} View:
@model Chart
@{
Layout = "~/Views/Shared/_Layout.cshtml";
Model.Write();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi every one...
Can i use timer control without use java sicrpt?
I want to use it directly by vb.net code only without anymore java sicrpt
|
|
|
|
|
VB.NET has several specialized timers of its own; no need for the language of Mordor.
What are you trying to do? Show us some code, makes talking about it easier
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I have Get Method which I am expecting to open a pdf file in a new browser tab, but its not happening - below is the code
public void GetDoc(int id)
{
string fileInfo = "ID=[" + id + "] ";
try
{
var file = this.DomainLogicUnitOfWork.UploadedDocumentManager.GetById(id);
fileInfo = "FILENAME=[" + file.FileName + "]";
Response.Clear();
Response.ContentType = file.FileContentType;
Response.AppendHeader("content-disposition", "attachment; filename=" + file.FileName);
Response.OutputStream.Write(file.DocumentImage, 0, file.DocumentImage.Length);
Response.Output.Flush();
Response.End();
}
catch (Exception ex)
{
LogHandler.LogError(4617, "Error Downloading Document " + fileInfo, ex);
throw ex;
}
}
My url is opening correctly: http://localhost:xcxcxcx/Upload/GetDoc?id=1088 and it gives a warning when click on the start of the browser address and one more thing is the Word and other documents are being downloaded fine - means they are working fine but problem is just with PDF files. Any suggestions or ideas -
thank you all friends.
|
|
|
|
|
There are some browser settings that can control whether or not files are opened in a new tab so you don't have complete control over it.
Also, this code runs in the context of the existing page and will return to the same page. I do not think there is a way to do it with code like this.
You can create a hyperlink and set it to open in a new tab.
You can also change the button or whatever it is that fires this event to open a new window and pass in a url that then calls this code.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
It is fixed by change the AppendHeader as below
if (file.FileContentType.ToLower() != "application/pdf")
Response.AppendHeader("content-disposition", "attachment; filename=" + file.FileName);
But I got another question - is there any way I can let the user when saving the file - give him the file name that has come by default - any help please? Thank you.
|
|
|
|
|
simpledeveloper wrote: Response.AppendHeader("content-disposition", "attachment; filename=" + file.FileName); It's my understand that will make it download as an attachment rather than display inline. If that made it open in a new tab for you, that's good, but like I said I don't think you can control it 100%. Someone's browser settings can change that behavior.
simpledeveloper wrote: give him the file name that has come by default I'm not sure what you mean. In your code you specified a file name.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
ZurdoDev wrote: I'm not sure what you mean. In your code you specified a file name.
I want to give the option when saving file name with the file name that comes with FileInfo object.
ZurdoDev wrote: It's my understand that will make it download as an attachment rather than display inline
OK - nice, is there anyway I can allow the user to download the file rather than opening in a new browser? How can I do that? It will be a great help for me.
simpledeveloper wrote: Response.AppendHeader("content-disposition", "attachment; filename=" + file.FileName);
How can I change this statement for pdf to be able to download? Any help regarding this buddy? It will be a great help - thank you.
|
|
|
|
|
Attachment means it will download. But again, some browsers have settings that can affect that.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
If it is chrome? Is there something we can do it from server side code buddy? Yeah now I am getting it - why isn't it doing it - thanks for helping me my friend.
And just saying I like this - its true
ZurdoDev wrote: Social Media - A platform that makes it easier for the crazies to find each other.
|
|
|
|
|
simpledeveloper wrote: If it is chrome? Sorry, I do not know. It's been years since I worried about this issue so I don't know what the settings look like today.
simpledeveloper wrote: Is there something we can do it from server side I believe the only thing you can do is to add the attachment header info which you already did.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
ZurdoDev wrote: I believe the only thing you can do is to add the attachment header info which you already did.
Yes I did see it - its working fine with IE, its only giving problem with Chrome - so any ideas from other users here also helpful - I will investigate a little bit about it.
|
|
|
|
|
Enclosing within the double quotes resolved the problem like in this one:
Response.AppendHeader("content-disposition", $"attachment; filename=\"{file.FileName}\"");
|
|
|
|
|
Hi...
How I can insert data into gridview without use data source???
|
|
|
|
|
|
Thank you for your answer,
But I don’t want use data source,
I want directly add the data from textbox without use DataTable
|
|
|
|
|
|
The website is working fine now I added MenuLeft.ascx into the folder "C:\WebSite2010\WebMaster\Controls\" when pressing the Rebuild website button with the error "Error: C:\WebSite2010\WebMaster\Controls\MenuTop.ascx.cs(14): error ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl)". Note that the folder "C:\WebSite2010\Controls\" already has a file with the same file name: MenuLeft.ascx now I copy the declaration of 2 files with the same name, how do I change the code ?
in the file: C:\WebSite2010\Controls\MenuLeft.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuLeft.ascx.cs" Inherits="MenuLeft" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register Src="~/Controls/ThuvienHinhAnh.ascx" TagPrefix="uc" TagName="ThuvienHinhAnh" %>
<%@ Register Src="~/Controls/QuangCaoLeft.ascx" TagPrefix="uc" TagName="QuangCaoLeft" %>
<%@ Register Src="~/Controls/WebURL.ascx" TagPrefix="uc" TagName="WebURL" %>
<%@ Register Src="~/Controls/Newsletter.ascx" TagPrefix="uc" TagName="Newsletter" %>
<%@ Register src="DanhMucBDS.ascx" tagname="DanhMucBDS" tagprefix="uc" %>
<%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>
<table cellspacing="0" cellpadding="0" width="180" border="0">
...
</table>
in the file: C:\WebSite2010\WebMaster\Controls\MenuLeft.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuLeft.ascx.cs" Inherits="MenuLeft" %>
<%@ Import Namespace="webapp4U" %>
<table width="185px" border="0" cellpadding="0" cellspacing="0">
...
</table>
|
|
|
|
|
You need to first understand how code files work and then fix them. I'm not sure how to tell you to fix it because I don't know what you need or don't need. You said you have two files with the same name, so start with removing one or changing the name of one. But then make sure the codefile matches the class.
For example, in what you posted, you need to have a class in the MenuLeft.ascx.cs file that is named MenuLeft.
Just go through your files and get it cleaned up properly.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I have fixed it, thank you for reading my post.
|
|
|
|
|
I am displaying a list of textboxes on top of an image on an ASP .NET Master/Content webpage. The image is the width of the page and has 6 even spaced white blocks. What I am trying to do is put a number in each image box white space using the CSS and HTML below. What is happening is all of the textboxes are being displayed in the same image box which is the first. In the first, the textboxes are only about 2px apart from each other and not spreading across the image 20px apart as defined it the left CSS tag. Why is my style is not correct?
Master:
<style>
.floating_label1 {
position: absolute;
z-index: 200;
top: 65px;
**left: 115px;**
}
.floating_label2 {
position: absolute;
z-index: 200;
top: 65px;
**left: 130px;**
}
.floating_label3 {
position: absolute;
z-index: 200;
top: 65px;
**left: 150px;**
}
.floating_label4 {
position: absolute;
z-index: 200;
top: 65px;
**left: 170px;**
}
.floating_label5 {
position: absolute;
z-index: 200;
top: 65px;
**left: 190px;**
}
.floating_label6 {
position: absolute;
z-index: 200;
top: 65px;
**left: 210px;**
border: hidden;
}
}
</style>
Content:
<div style="position:relative;">
<img src="Images/PAXSummary.jpg" />
<asp:TextBox ID="TextBox1" runat="server" Text="1" style="height:25px; width:25px; vertical-align:central; text-align:center" CssClass="floating_label1" />
<asp:TextBox ID="TextBox2" runat="server" Text="2" style="height:25px; width:25px; vertical-align:central; text-align:center" CssClass="floating_label2" />
<asp:TextBox ID="TextBox3" runat="server" Text="3" style="height:25px; width:25px; vertical-align:central; text-align:center" CssClass="floating_label3" />
<asp:TextBox ID="TextBox4" runat="server" Text="4" style="height:25px; width:25px; vertical-align:central; text-align:center" CssClass="floating_label4" />
<asp:TextBox ID="TextBox5" runat="server" Text="5" style="height:25px; width:25px; vertical-align:central; text-align:center" CssClass="floating_label5" />
<asp:TextBox ID="TextBox6" runat="server" Text="6" style="height:25px; width:25px; vertical-align:central; text-align:center" CssClass="floating_label6" />
</div>
|
|
|
|
|
The answer was simple. The only thing that needed to be done was increase the values of each TextBox's CSS left and I was able to move the controls over to the desired location. I was only increasing the px value by 20 which was way to small of a value.
|
|
|
|