|
I actually have tried to add <--Please Select a Requestor--> but I do not know how to add that text.
Do I add that text message in ASP code for the DropDownList or code behind that is populating dropdownlist? I really do not know how to add it but I want to add it with your help.
When I debug, requestorItem = (ListItem)RequestorDropDwonList.SelectedItem is showing first name on the list. I want it to show null or nothing.
|
|
|
|
|
Member 11403304 wrote: but I do not know how to add that text. Whatever code is creating the list just have it add in the blank one.
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.
|
|
|
|
|
You insert a new object into the first position in the list populating the drop down. You now know what the content of that item is so when you process the selection you check for the inserted item and deal with that.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
My code for EmailButton_Click is not working. I am getting an error System.Net.Mail.SmtpException: 'SSL must not be enabled for pickup-directory delivery methods.' so email is not sent.
How can I fix this?
Here is the code
protected void EmailButton_Click(object sender, EventArgs e)
{
string requestor = RequestorDropDownList.SelectedValue.ToString();
string message = "The following records have been prepped for processing. Valid cases will be processed.";
if (requestor.Length > 0)
message = string.Format(message);
using (MailMessage mailMessage = new MailMessage())
{
mailMessage.From = new MailAddress("NoReply_FTA@courts.state.mn.us");
MailAddress to = new MailAddress("okaymy1112@gmail.com");
mailMessage.To.Add(to);
string ccEmailAddress = "okaymy1112@mail.com";
if (ccEmailAddress.Length > 0)
{
MailAddress ccto = new MailAddress(ccEmailAddress);
mailMessage.CC.Add(ccto);
}
mailMessage.Subject = "FTA Case Reset Notice";
mailMessage.Body = message;
mailMessage.IsBodyHtml = true;
SmtpClient smtpClient = new SmtpClient();
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
smtpClient.PickupDirectoryLocation = @"c:\smtp";
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = true;
smtpClient.Timeout = 60000;
smtpClient.Send(mailMessage);
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('An email has been sent to '" + requestorName + "');", true);
}
|
|
|
|
|
|
The error is self-explanatory. You are using both SSL and a pickup folder, you can't use both. You either send over the network and use SSL, or write to the pickup folder which has no support for SSL. If you want to use the pickup folder don't set EnableSsl to true.
|
|
|
|
|
Can you kindly help or guide me on doing it the way you described? For example based on my code how can I can it so that 1. I can send email over the network and use SSL or 2. write to the pickup folder which has no support for SSL
|
|
|
|
|
The solution depends on if you want to use the pick-up folder or send over the network, something you haven't indicated.
|
|
|
|
|
The code below is from a desktop app that uses forms. I was asked to create a new web app to replace old desktop client app.
How can I change the following code to work in web app which does not have forms instead has aspx?
Please help.
private async void GetCasesButton_Click(object sender, EventArgs e)
{
if (CaseNumbersTextBox.Text.Length < 1)
{
MessageBox.Show("Casenumber textbox cannot be empty.", "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
ComboboxItem requestorItem = new ComboboxItem();
requestorItem = (ComboboxItem)RequestorComboBox.SelectedItem;
ComboboxItem reasonItem = new ComboboxItem();
reasonItem = (ComboboxItem)ReasonComboBox.SelectedItem;
if (requestorItem.Value < 1)
{
MessageBox.Show("Please select a Requestor.", "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (reasonItem.Value < 1)
{
MessageBox.Show("Please select a Reason.", "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string userEnteredCaseNumbers = CaseNumbersTextBox.Text;
userEnteredCaseNumbers = userEnteredCaseNumbers.Replace("\r", ",");
userEnteredCaseNumbers = userEnteredCaseNumbers.Replace("\n", ",");
while (userEnteredCaseNumbers.Contains(",,"))
userEnteredCaseNumbers = userEnteredCaseNumbers.Replace(",,", ",");
List<string> userEnteredCaseNumberList = new List<string>();
userEnteredCaseNumberList = userEnteredCaseNumbers.Split(',').Where(x => x.Length > 0).ToList();
userEnteredCaseNumberList = userEnteredCaseNumberList.Select(s => s.Trim()).ToList();
try
{
int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
foreach (string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.RequestorInfoID = requestorItem.Value;
newCandidate.ReasonID = reasonItem.Value;
newCandidate.BatchNumber = newBatchNumber;
newCandidate.EntryStaffUserName = this._loggedInUserName;
await CandidateCaseController.PostCandidate(newCandidate);
}
List<GetCandidateCaseModel> candidateList = await CandidateCaseController.GetAllCandidates();
candidateList = candidateList.Where(x => x.BatchNumber == newBatchNumber).ToList();
string candidateCasesString = string.Empty;
Regex rgxDash = new Regex("[^a-zA-Z0-9 ,]");
candidateCasesString = string.Join(",", candidateList.Select(p => p.CaseNbr.ToString()));
candidateCasesString = rgxDash.Replace(candidateCasesString, "").ToString();
List<string> smallEnoughStrings = new List<string>();
while (candidateCasesString.Length > 0)
{
int sendLength = 200;
bool isLastString = false;
if (candidateCasesString.Length < sendLength)
{
sendLength = candidateCasesString.Length;
isLastString = true;
}
string smallChunk = candidateCasesString.Substring(0, sendLength);
if (!isLastString)
{
int lastComma = smallChunk.LastIndexOf(',');
smallChunk = smallChunk.Substring(0, lastComma);
candidateCasesString = candidateCasesString.Remove(0, lastComma);
if (candidateCasesString[0] == ',')
candidateCasesString = candidateCasesString.Remove(0, 1);
}
else
candidateCasesString = candidateCasesString.Remove(0, sendLength);
smallEnoughStrings.Add(smallChunk);
}
List<AcceptCaseNumbersModel> mncisDetailList = new List<AcceptCaseNumbersModel>();
List<AcceptCaseNumbersModel> smallEnoughMncisDetailList = new List<AcceptCaseNumbersModel>();
foreach (string smallEnoughString in smallEnoughStrings)
{
smallEnoughMncisDetailList = await FTACaseReset.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
mncisDetailList.AddRange(smallEnoughMncisDetailList);
}
foreach (GetCandidateCaseModel candidateCase in candidateList)
{
string caseNbrWODash = rgxDash.Replace(candidateCase.CaseNbr, "").ToString();
AcceptCaseNumbersModel mncisDetail = mncisDetailList.Where(x => x.CaseNbrSrch.ToLower() == caseNbrWODash.ToLower()).FirstOrDefault();
if (mncisDetail != null)
{
candidateCase.FirstPenalty = mncisDetail.FirstPenaltyFlag == 1 ? true : false;
candidateCase.SecondPenalty = mncisDetail.SecondPenaltyFlag == 1 ? true : false;
if (candidateCase.CaseNbr.ToLower().Contains("vb") == false)
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.No_Records_To_Reset.ToString().Replace("_", " "));
else if (candidateCase.FirstPenalty == false && candidateCase.SecondPenalty == false)
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.No_Records_To_Reset.ToString().Replace("_", " "));
if (candidateCase.RejectionReason == null)
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.Valid.ToString());
candidateCase.Title = mncisDetail.Style;
await FTACaseReset.Controllers.CandidateCaseController.PutCandidate(candidateCase);
}
else
{
candidateCase.RejectionReason = await FTACaseReset.Controllers.RejectionController.GetRejectionByDescription(Enumerations.Rejections.Invalid_Case_Number.ToString().Replace("_", " "));
await FTACaseReset.Controllers.CandidateCaseController.PutCandidate(candidateCase);
}
}
GetCasesProgressBar.PerformStep();
this.ClearForm();
ValidTabPage.Controls.Clear();
InvalidTabPage.Controls.Clear();
ValidTabPage.Text = "Valid Cases";
InvalidTabPage.Text = "Invalid Cases";
this.PopulateBatchComboBox();
List<GetCandidateCaseModel> thisBatchCasesList = new List<GetCandidateCaseModel>();
thisBatchCasesList = await Controllers.CandidateCaseController.GetCandidateByBatchID(newBatchNumber);
if (thisBatchCasesList.Count > 0)
this.EmailButton.Enabled = true;
else
{
this.EmailButton.Enabled = false;
return;
}
this.PopulateTabs(thisBatchCasesList, true);
this.GetCasesPanel.Visible = false;
this.UpdateExistingPanel.Visible = true;
ComboboxItem batchItem = new ComboboxItem(thisBatchCasesList[0].BatchNumber);
SelectBatch(batchItem);
ComboboxItem requestorUpdateItem = new ComboboxItem(thisBatchCasesList[0].RequestorInfo);
SelectRequestorUpdate(requestorUpdateItem);
ComboboxItem reasonUpdateItem = new ComboboxItem(thisBatchCasesList[0].Reason);
SelectReasonUpdate(reasonUpdateItem);
}
catch (Exception ex)
{
string errorMsg = string.Format("An error has occured in {0}. \nException:\n{1}", "GetCasesButton_Click()", ex.Message);
MessageBox.Show(errorMsg, "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
|
|
|
|
|
No one is going to rewrite all of your code for you and quite frankly, it's very rude for you to ask us to. Converting desktop app to web app is not a trivial task.
Step 1. Learn the basics of web development. How and where code runs can be very different than desktop development.
Step 2. Rewrite the code. Figure out what the code does and then rewrite it for the web.
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, 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
|
|
|
|