|
ZurdoDev, I was not asking you or anyone to wrote the code for me. Maybe my question could have been rewritten to make more sense. I am working on the app and I will be asking simpler questions as I get stuck. I made a mistake and seems you are offended. That was not my intention to offend you and other or to be rude. Moving forward, I will post better questions. Everyone makes mistakes. I am sure you might agree with me. Accept my sincere apology.
|
|
|
|
|
I was asked to make a new web app based on a desktop client app which uses forms. My question today is, since some of the code I need help with is lengthy, is there a way to add code in my question by attaching a file?
|
|
|
|
|
No, when you ask a question just post the relevant code. It should never be very long.
Post a clear question showing the relevant code and we'll be happy to help.
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.
|
|
|
|
|
Hello to everyone!
I need your support in coding that how should I add the speech audio to the paragraph texts/script in web-page by clicking on Read Button it should be played the audio and text should be appeared by type animation based on the audio.
Appreciate having your support in this regards!
|
|
|
|
|
I have not done this before; however, a quick google search gave me this, Add Free Text-to-Speech to Your Site | WebsiteVoice[^]
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.
|
|
|
|
|
Thank you very much for the sharing the link ZurdoDev! I want it a little professional, I have the script and recorded audio and I have problem in coding that how it should be displayed in Web page that audio should be played with script simultaneously or the same time.
|
|
|
|
|
Suppose I have a website written in asp.net and the database is SQL Server, after I "Publish the web site" and I want to encode this code for smartphones (both android and Android operating systems) iphone) what software do I use? Note that I only packaged the code in "Publish web site" and the SQL Server data I still kept on the server (not packing the SQL Server data)
|
|
|
|
|
Why do you want the website installed on a phone? The usual action for phones is that they access the website through their browsers.
|
|
|
|
|
Because I see several smartphone applications that can access SQL Server data, I don't know what programming language they use to do this.
|
|
|
|
|
That really does not make any sense. Applications can use SQL in just about any programming language. As to your original question, it is far from clear what you are trying to do with a phone app.
|
|
|
|
|
I can seem to get to what I need. Below is a portion of my code. I can get the table Id data but I need to get above the table and need
<div class="panel panel-primary" style="margin-top: 10px">
<div class="panel-heading">
Work Opportunities Available
</div>
<div class="panel-body">
<p id="noWorkopportunities" class="text-info">
No available work opportunities found.
</p>
</div></div>
I can get the table Id data but I need to get above the table and need Project Name/Work Order | Date | Time | Location | Pay Rate | Pay Type | Tech | Actions |
modified 7-Jan-20 11:09am.
|
|
|
|
|
Member 1753250 wrote: I can get the table Id data I would suggest you edit your question and show the code that can get the table id. Getting the table's parent is likely very trivial after 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.
|
|
|
|
|
Thank You for the reply. Here is my code.
' Get all tables in the document
Dim tables As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table")
' Iterate all rows in the first table
Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("//table[@id='workorders']//tr")
' Dim rows As HtmlAgilityPack.HtmlNodeCollection = main.DocumentNode.SelectNodes("tr")
' Iterate all rows in the first table
For k = 0 To rows.Count - 1
' Iterate all columns in this row
Dim cols As HtmlAgilityPack.HtmlNodeCollection = rows(k).SelectNodes("th|td")
' Dim cols As HtmlAgilityPack.HtmlNodeCollection = rows(k).SelectNodes("tr")
If cols IsNot Nothing Then
For j = 0 To cols.Count - 1
' Get the value of the column and print it
Dim value As String = cols(j).InnerText
If value = "Project Name/Work Order" Then
Foundwork = True
End If
Next
End If
Next
Here is the web source
div class="panel panel-primary" style="margin-top:10px;">
Work Opportunities Available
No available work opportunities found.
I want to check when
Project Name/Work Order Date Time Location Pay Rate Pay Type Tech Actions
|
|
|
|
|
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.
|
|
|
|