Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 11369001

@User 11369001
About
Posts
25
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How do I make table data red in <td>?
    U User 11369001

    Hi everybody who tried to help me on this problem. I wanted to thank you for trying to help. However after hours of try and error, I found a solution that works. Just wanted to let you know this is now fixed. Here is my solution. Looks pretty simple! So the logic is, if AttorneyPartyID = PartyID that is Pro Se, else if fActive is false that means the attorney is inactive. Use inactiveAttorney css class to display attorney name with red font else the attorney is active and no need to display name in red font. Display in bold font.

    <%#
    Eval("AttorneyPartyID").ToString() == Eval("PartyID").ToString()
    ? "Pro Se"
    : (bool) Eval("fActive") == false
    ? "" /*This is inactive attorney*/
    :"

    " + Eval("AttorneyFullName") + "

    " /*This is Active attorney*/
    %>

    " + Eval("AttorneyFullName") + "

    C# question csharp

  • How do I make table data red in <td>?
    U User 11369001

    Here is the code behind that have the fActive

    private bool _fActive;
    public bool fActive
    {
    get { return this._fActive; }
    set { this._fActive = value; }
    }
    bool parsefActive = false;Boolean.TryParse(row["fActive"].ToString(), out parsefActive);
    this._fActive = parsefActive == true ? true : false; //This is how it is called or populated

    C# question csharp

  • How do I make table data red in <td>?
    U User 11369001

    Hi Homer, Thanks for your reply. When I tried the code you gave me, I am getting an error The name "fActive" does not exist in the current context

    C# question csharp

  • How do I make table data red in <td>?
    U User 11369001

    Thank for your help on trying to figure this out. I did add css class to existing css file.

    .inactiveAttorney
    {
    color: #AD0000;
    font-weight:bold
    }

    The product owner have asked me to only make the attorney name red when fActive = 0 (false). The code behind have this code

    private bool _fActive;
    public bool fActive
    {
    get { return this._fActive; }
    set { this._fActive = value; }
    }
    this._fActive = parsefActive == true ? true : false; //This is how it is called or populated

    I have successfully been able to use css class to make attorney name red. However, I need help to add a condition so that the name is red only when fActive =false (0). Here is my code which is working and needs adding condition

    "

    " + Eval("AttorneyFullName") + "

    "

    The fActive is a Boolean and else where in the code I see something done when a Boolean is true. I need to do something similar but I do not know how. Here is that example.

    <%# (bool)Eval("PartyConfidentialHomePhone") == true ? "Home":"" %><%#Eval("PartyHomePhone").ToString() != "" && Eval("PartyHomePhone") != null ? "" + Eval("PartyHomePhone") + "":string.Empty%>

    C# question csharp

  • How do I make table data red in <td>?
    U User 11369001

    It is not a single-cell. I did not paste the whole table (ItemTemplate). The table has 5 rows and each row has a single (cell) Here is the whole table

            <%# 
                        Eval("AttorneyPartyID").ToString() != Eval("PartyID").ToString() ? 
                        ""
                        : 
                        "**Pro Se**" 
                    %>
                    <%# 
                        Eval("AttorneyPartyID").ToString() != Eval("PartyID").ToString() && Eval("AttorneyPhoneNumber") != "" && Eval("AttorneyPhoneNumber") != null ? 
                        ""
                        : 
                        string.Empty 
                    %>
                    <%# 
                        Eval("AttorneyPartyID").ToString() != Eval("PartyID").ToString() && Eval("AttorneyEmail") != "" && Eval("AttorneyEmail") != null ? 
                        ""
                        : 
                        string.Empty 
                    %>
                    <%# 
                        Eval("AttorneyPartyID").ToString() != Eval("PartyID").ToString() ? 
                        "
    

    " + Eval("AttorneyFullName") + "

    Phone:" + ' ' + Eval("AttorneyPhoneNumber") + "

    Email:" + Eval("AttorneyEmail") + "

    "
    :
    string.Empty
    %>

    C# question csharp

  • How do I make table data red in <td>?
    U User 11369001

    There is this code that have a name in the table data and I have been asked to make that data red. Right now it is bold (strong). I need to add code to also make it appear read. How do I do this? Here is the code in C#

    <%# 
        Eval("AttorneyPartyID").ToString() != Eval("PartyID").ToString() ? 
        ""
        : 
        "**Pro Se**" 
    %>
    

    " + Eval("AttorneyFullName") + "

    C# question csharp

  • When string in a cell has double quotes those appear in Excel after export. How do I remove them?
    U User 11369001

    I still need help with this one please

    ASP.NET help question database tutorial

  • When string in a cell has double quotes those appear in Excel after export. How do I remove them?
    U User 11369001

    I need help to fix an issue where when data from web application is exported to Excel by clicking a button export to excel, if the data in a cell contains double quotes, that data should be displayed without the double quotes visible. Also I want preceding zeros not to be removed e.g. 081 should not be exported to Excel as 81. This is why I have the line of code sw.Write("=""" & row(column).ToString().Trim() & """" & vbTab) Previously I made a change to the application code in VB so that the output exports text fields with formulas (="") to force Excel to treat those values as a string. This has been working except some instances where the output actually displays the formula characters (="") within the cell as text, rather than as hidden formulas. It appears when a cell contains text with an actual double quotes that is when after export to Excel is done, those quotes appear in Excel. I need help to figure out if there is a way to suppress those. For example. A cell with the following data Allows the user the abilities to Add, View, Modify and Delete Notes on the Notes Tab of the Case Record. "View" allows the user to view the Notes Tab of the Case Record. When this is exported to Excel the data is displayed as follows ="Allows the user the abilities to Add, View, Modify and Delete Notes on the Notes Tab of the Case Record. "View" allows the user to view the Notes Tab of the Case Record. I do not want to quotes to appear in Excel. On the other hand, a cell with the following data Maintain Victim Classification Types. when this is exported to Excel there are no visible quotes. It displays as Maintain Victim Classification Types. Here is my VB code that needed changing

    Protected Sub WriteToExcelFile(dt As DataTable)
    'This method exports the resulting query datatable to an instance of Excel using StringWriter
    If Not dt Is Nothing Then
    Dim sw As New StringWriter()
    'Loop through the column names and output those first
    For Each datacol As DataColumn In dt.Columns
    sw.Write(datacol.ColumnName + vbTab)
    Next
    Dim row As DataRow
    'Loop through the datatable's rows
    For Each row In dt.Rows
    'Newline between the previous row and the next row
    sw.Write(vbNewLine)
    Dim column As New DataColumn()
    'Loop through each column and write the cell the the stringwriter
    For Each column In dt.Columns

    ASP.NET help question database tutorial

  • How do I remove double quotes from Excel cell when data is exported to Excel in VB code?
    U User 11369001

    I need help to fix an issue where when data from web application is exported to Excel by clicking a button export to excel, if the data in a cell contains double quotes, that data should be displayed without the double quotes visible. Previously I made a change to the application code in VB so that the output exports text fields with formulas (="") to force Excel to treat those values as a string. This has been working except some instances where the output actually displays the formula characters (="") within the cell as text, rather than as hidden formulas. It appears when a cell contains text with an actual double quotes that is when after export to Excel is done, those quotes appear in Excel. I need help to figure out if there is a way to suppress those. For example. A cell with the following data Allows the user the abilities to Add, View, Modify and Delete Notes on the Notes Tab of the Case Record. "View" allows the user to view the Notes Tab of the Case Record. When this is exported to Excel the data is displayed as follows ="Allows the user the abilities to Add, View, Modify and Delete Notes on the Notes Tab of the Case Record. "View" allows the user to view the Notes Tab of the Case Record. I do not want to quotes to appear in Excel. On the other hand, a cell with the following data Maintain Victim Classification Types. when this is exported to Excel there are no visible quotes. It displays as Maintain Victim Classification Types. Here is my VB code that needed changing

    Dim row As DataRow
    'Loop through the datatable's rows
    For Each row In dt.Rows
    'Newline between the previous row and the next row
    sw.Write(vbNewLine)

                Dim column As New DataColumn()
                'Loop through each column and write the cell the the stringwriter
                For Each column In dt.Columns
                    'If the cell isn't empty write it, else write an empty cell
                    If Not row(column.ColumnName) Is Nothing Then
                        'WK Old code sw.Write(row(column).ToString().Trim() + vbTab)
                        'WK new 10/03/2019 
                        'To fix Marsha issue where preceding zero is truncated when export to Excel is processed. 
                        'This line of code enables the SQL query to return the numbers as unchanged strings, not numbers
                        sw.Write("=""" & row(column).ToString().Trim() & """"
    
    C# help database question tutorial

  • How do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override
    U User 11369001

    Thank you for your help. For now this seems to work. I will do more testing as I continue to add to the code.

    ASP.NET question asp-net design debugging help

  • How do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override
    U User 11369001

    I am creating a usercontrol named InvalidCaseUserControl in web forms for a web app. When I run the code in debug mode I am getting the following errors CS0079 The event 'Control.Disposed' can only appear on the left hand side of += or -= Error CS7036 There is no argument given that corresponds to the required formal parameter 'e' of 'EventHandler' Error CS0115 'InvalidCaseUserControl.Dispose(bool)': no suitable method found to override How do I solve this?

    public partial class InvalidCaseUserControl : System.Web.UI.UserControl
    {
    private int _batchNumber;
    private System.ComponentModel.IContainer components = null;
    /// /// Clean up any resources being used.
    ///
    /// true if managed resources should be disposed; otherwise, false.
    protected override void Dispose(bool disposing)//Getting 'InvalidCaseUserControl.Dispose(bool)':no suitable method found to override
    {
    if (disposing && (components != null))
    {
    components.Dispose();
    }
    base.Disposed(disposing);
    }
    }

    ASP.NET question asp-net design debugging help

  • How do I solve error StatusCode: 500?
    U User 11369001

    Thank you for your response. You are exactly right. I did talk to someone and I need to get username and password the app need to use to connect to the server.

    ASP.NET asp-net json help question csharp

  • How do I solve error StatusCode: 500?
    U User 11369001

    I am getting an error when I try to get case information from a database (Justice) Here is the error: {StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: {Pragma: no-cache Cache-Control: no-cache Date: Wed, 29 Jan 2020 22:07:12 GMT Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Content-Length: 6066 Content-Type: application/json; charset=utf-8 Expires: -1 }} I need help to solve the error StatusCode: 500 When button is clicked JusticeContoller class is called. This is where I am getting an error on line response=await client.GetAsync("api/GetAllAcceptCAseNumbers/" + candidateCases);

    protected async void GetCasesButton_Click(object sender, EventArgs e)
    {
    //#region Required Field Validation
    if (CaseNumbersTextBox.Text.Length < 1)
    {
    string myStringVariable = "Case number textbox cannot be empty.";
    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
    return;
    }
    try
    {
    #region Get Batch Number
    int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
    #endregion
    #region Insert entered case numbers in database
    foreach (string caseNumber in userEnteredCaseNumberList)
    {
    EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
    newCandidate.CaseNbr = caseNumber;
    newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail();
    await CandidateCaseController.PostCandidate(newCandidate);
    }
    #region Get MNCIS info on cases
    //candidateCasesString
    List smallEnoughStrings = new List();
    List mncisDetailList = new List();
    List smallEnoughMncisDetailList = new List();
    foreach (string smallEnoughString in smallEnoughStrings)
    {
    smallEnoughMncisDetailList = await FTACaseReseting.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
    mncisDetailList.AddRange(smallEnoughMncisDetailList);
    }
    #endregion

        }
        catch (Exception ex)
        {
            string errorMsg = string.Format("An error has occured in {0}. \\nException:\\n{1}"
    
    ASP.NET asp-net json help question csharp

  • How to I fix "The method or operation is not implemented"?
    U User 11369001

    When I run my code, when I want to check the user who is logged in (this is a web application), the method called is having an error saying The method or operation is not implemented. I need help to fix it by implementing the method. Here is where the error occurs

    try
    {
    foreach (string caseNumber in userEnteredCaseNumberList)
    {
    EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
    newCandidate.CaseNbr = caseNumber;
    newCandidate.RequestorInfoID = Convert.ToInt32(requestorItem.Value);
    newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail(); //Calls public static string GetADEmmail method
    await CandidateCaseController.PostCandidate(newCandidate);
    }
    }
    catch (Exception ex)//shows The method or operation is not implemented.
    {
    string errorMsg = string.Format("An error has occured in {0}. \nException:\n{1}", "GetCasesButton_Click()", ex.Message);
    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + errorMsg + "');", true);
    }

    Method that is called by line 8 with EntryStaffUserName. The error on on this method on line 7

    public static string GetADEmail()
    {
    string retVal = string.Empty;
    using (var context = new PrincipalContext(ContextType, "COURTS"))
    {
    UserPrincipal user = new UserPrincipal(context);
    user = UserPrincipal.FindByIdentity(context, IdentityType, Environment.UserName);//this is where there is an issue. I can see UserName has a value
    retVal = user.EmailAddress;
    }
    return retVal;
    }

    ASP.NET help security tutorial question workspace

  • How do I fix System.Net.Mail.SmtException: 'Cannot get IIS pickup directory' error?
    U User 11369001

    I am trying to send email using the EmailButton_Click code. However I am getting the error on this line smtp.Send(mailMessage) The error is System.Net.Mail.SmtpException: 'Cannot get IIS pickup directory.' Can someone help me fix it please?

    protected void EmailButton_Click(object sender, EventArgs e)
    {
    //get selected email
    EmailButton.Visible = true;
    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");
    //Uncomment after testing in Deve June 2019
    MailAddress to = new MailAddress(requestor);
    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;
    SmtpClient smtp = new SmtpClient();
    smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
    smtp.Send(mailMessage);//Error on this line
    }
    string msg = "No batches were found";
    Response.Write("alert('" + msg + "')");
    }

    ASP.NET help question csharp com windows-admin

  • How do I fix 'object' does not contain a definition for 'Value'?
    U User 11369001

    I have a foreach statement. When I run my code in debug mode, I am getting the following error. I am not sure how to fix it. Google search shows may ways of doing it. Error: 'object' does not contain a definition for 'Value' and no accessible method 'Value' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) My code behind

    foreach(string caseNumber in userEnteredCaseNumberList)
    {
    EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
    newCandidate.CaseNbr = caseNumber;
    newCandidate.RequestorInfoID = requestorItem.Value;//Error here
    //newCandidate.RequestorInfoID = (ListItem)RequestorDropDownList.SelectedItem.Value;
    //newCandidate.ReasonID = requestorItem.Value;
    newCandidate.BatchNumber = newBatchNumber;
    newCandidate.EntryStaffUserName = this._loggedInUserName;
    await CandidateCaseController.PostCandidate(newCandidate);
    }

    ASP.NET help question debugging tutorial

  • How do you have a DropDownList populated without default selected item?
    U User 11369001

    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.

    ASP.NET help question

  • How do you have a DropDownList populated without default selected item?
    U User 11369001

    I have a RequestorDropDownList which is populated with a list of names from a GetRequestorInfoModel. I need help to make a change so that when this list is populated, the first name is not automatically selected until a user selects it. How do I do this based on my code below? ASP code for the dropdownlist

    Code behind that is populating the dropdownlist

    #region Requestor dropdownlist
    public async Task> GetRequestorEmail()
    {
    try
    {
    var requestors = await FTACaseReseting.Controllers.RequestorInfoController.GetAllRequestorInfoes();
    //Show first name as selected
    return requestors.OrderBy(x => x.DisplayName);
    }
    catch (Exception ex)
    {
    string errorMsg = string.Format("An error has occured in {0}. \nException:\n{1}", "PopulateRequestorComboBox()", ex.Message);
    Response.Write("alert(" + HttpUtility.JavaScriptStringEncode(errorMsg, true) + ")");
    return Enumerable.Empty();
    }
    }
    #endregion

    Here is code for RequestorDropDownList_SelectedIndexChanged

    protected void RequestorDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
    if (RequestorDropDownList.SelectedItem ==null)
    {
    ListItem requestorItem = new ListItem();
    requestorItem = (ListItem)RequestorDropDownList.SelectedItem;

        if (requestorItem.Text.Length < 0)
        {
           string selectRequestor = "Please select a Requestor.";
           ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + selectRequestor + "');", true);
         }
         this.EmailButton.Enabled = false;
         RequestorDropDownList.SelectedValue = RequestorDropDownList.SelectedItem.Value;
     }
    

    }

    ASP.NET help question

  • How to I make EmailButton_Click work?
    U User 11369001

    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

    ASP.NET help question csharp com sysadmin

  • How do I make my GetCasesButton_Click work?
    U User 11369001

    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.

    ASP.NET question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups