I've got several DevExpress DateEdit controls on my page organized into an AjaxControlToolkit Accordion along with other fields relevant to my data.

The DateEdit controls worked quite fine until I put them into the Accordion so I'm assuming the problem is some conflict between DevExpress and AjaxControlToolkit though I have no other alternative unless there's a DX accordion type control that does the same as the one from the Control Toolkit...

The error I'm getting in my browser when I try to use a date editor is

ASPx is not defined

No other details that I could find but DateEdit fields placed outside of the Accordion work perfectly.

Note that removing the accordion is not a viable solution for this project without a possible alternative being presented.

Here's my code:

<%@ Register TagPrefix="ajax" Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
    <asp:UpdatePanel runat="server" ID="upAlerts">
        <ContentTemplate>

            <ajax:Accordion runat="server" ID="Accordion1" EnableViewState="true" CssClass="panel panel-info"
                HeaderCssClass="panel-heading" ContentCssClass="panel-body">
                <Panes>

                    <ajax:AccordionPane runat="server" ID="apAlert">
                        <Header>
                            <h3>Alert Details</h3>
                        </Header>
                        <Content>
                            <div class="form-group">
                                <label for="dtDate">Date</label>
                                <dx:ASPxDateEdit ID="dtDate" runat="server" DisplayFormatString="yyyy/MM/dd" CssClass="form-control"></dx:ASPxDateEdit>
                            </div>
                        </Content>
                    </ajax:AccordionPane>

                </Panes>
            </ajax:Accordion>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

​I would normally suspect the problem to actually exist with the ViewState since I know these controls (ACT ones in particular) can mess with the ViewState quite a lot, but the Accordion isn't currently disabling the ViewState so I'm prepared to rule that out as a possibility at this point.

That said, I'm all out of ideas.

I even tried to rearrange the order in which the assemblies are registered on the page so that DevExpress is being registered after Ajax in an attempt to ensure that Ajax wasn't overriding anything that DevExpress needed.

As a last resort I tried switching the DevExpress date editors to Ajax calendar extenders but for some weird reason they don't render correctly either (no dates are visible on the calendar pop out).

How can I get these DateEdit controls working?

Hi I have a struct in a problem that i am developing an asp.net web application in my web config file I have mentioned session timeout is 30 minutes..But my application gets expired even the application is running .. I want that session gets expired if the application is Idle how can i make that work. now my session is expired every 30 minutes irrespective of whether the application running or not. I have added multiple connection strings to connect different database and in session state is it mandatory to mention the mode="In Proc"cookieless="false" .My web Config File

The image shows web-config file is used in my application...Please help me to get out of this problem. Thank you in Advance....

I have a html page created with bootstrap, and i want to create a PDF with it and for this i'm using ABCPdf. I'm trying to execute a javascript script to apply some styles to my html, but it doesn't works. Someone knows what happens?

     Doc theDoc = new Doc();
     theDoc.Rect.Inset(5, 20);
     theDoc.HtmlOptions.Timeout = 3000000; 
     theDoc.HtmlOptions.UseScript = true;
     theDoc.HtmlOptions.PageCacheEnabled = false;
     theDoc.HtmlOptions.DoMarkup = true;
     theDoc.HtmlOptions.HostWebBrowser = false;
     theDoc.HtmlOptions.Media = MediaType.Screen;
     theDoc.HtmlOptions.BrowserWidth = 1500;
     theDoc.HtmlOptions.AddLinks = true;
     string script = @"var elemento = document.getElementById('description');"
                      +"for (i = 0; i < elemento.childNodes.length; i++) {"
                      +    "if (elemento.childNodes[i].className == 'row') {"
                      +       " if (elemento.childNodes[i].offsetHeight > 200) {"                                    
                                     +            "elemento.childNodes[i].className += ' saltoPagina';  }  }  }";

    theDoc.HtmlOptions.OnLoadScript = script;
    int theID;
    theID = theDoc.AddImageUrl(url, true, 0, true);

Thanks in advance. :)

I'm trying to build and deploy ASP.NET web application via TeamCity and WebDeploy.
Before you ask - I found several similar questions, but neither of them worked in my case.
I'm trying to pass TeamCity parameters to MsBuild. I have a build template which defines the parameters as empty, and then build configuration override them.
Tried system properties, but they didn't work for me. What's even worse, TeamCity doesn't log MsBuild parameter values, so I can't take a look at them.
Here's the example of how I pass parameters to MSBuild in my build template: /property:MsDeployServiceUrl=https://$(deploy_vm_name):8172/MsDeploy.axd /property:DeployIisAppPath=$(deploy_app_name) /property:SkipExtraFilesOnServer=True /property:UserName=$(deploy_username) /property:Password=$(deploy_password).
According to the documentation, syntax is correct.
Parameters are system.deploy_app_name, system.deploy_username, system.deploy_password, system.deploy_vm_name.
The error message I get - C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4115, 5): Invalid Web Deploy service URL.
I'm using TeamCity version 10.0.2 with MsBuild version 14.
Any suggestions? What did I miss?

I'm trying to add a refresh/redirect header to my pages.

In asp.net web-forms I do this

this.Page.Header.Controls.Add(new LiteralControl(String.Format("<meta http-equiv='refresh' content='{0};url={1}'>",  "1", "http://www.google.co.uk")));

and I can see this <meta http-equiv='refresh' content='7200;url=http://www.google.co.uk'> in the page source and all is good.

I've just switched to MVC5/VS2015/C# and have tried to do the same using a global filter. This does everything else that I need the filter to do but it doesn't seem to want add the header. I have placed this in OnActionExecuting and in OnActionExecuted

filterContext.HttpContext.Response.AddHeader("refresh", string.Format("content='{0};url={1}'", "1", "http://www.google.co.uk"));

I have created filters, and applied them to the controller, action methods, global filters, pretty much anywhere I can find.

In desperation, in the page and the layout pages (pretty much everywhere I could think) of using Razor I have tried (below)

Response.AppendHeader("refresh", string.Format("content='{0};url={1}'", "1", "http://www.google.co.uk"));
Response.AddHeader("refresh", string.Format("content='{0};url={1}'", "1", "http://www.google.co.uk"));

Every article I've looked at (and I've looked at loads) suggests I am doing it correctly. I get no errors but it just doesn't seem to work. Any help would be much appreciated.

I am sending a JSON object from JavaScript to ApiController. The object contains a list in it. At first I got a circular reference problem there, because it is from my database, but then i added some annotations, to be precise [DataMember], and now it works sort of fine. This is not the only complex type list in that object, there are List, List, etc. All other lists work fine, everything i send to them is there, except for a List. List has always one element less than what i sent to the ApiController. I don`t have a clue what the problem might be, but i think this happened after i added annotation [DataMember].

EDIT

//CLASS A METADATA

 namespace Project.Models
    {
    [MetadataType(typeof(ClassAMetadata))]
    [JsonObject(IsReference =true)]
    public partial class ClassA
    {
        public string Field1 { get; set; }
        public decimal Field2 { get; set; }
    }


    public class ClassAMetadata
    {

    }
}


//CLASS A

namespace Project.Models
{
    using System;
    using System.Collections.Generic;

    public partial class ClassA
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public ClassA()
        {
            this.ClassB = new HashSet<ClassB>();
        }



        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<ClassB> ClassB { get; set; }
    }
}


//CLASS B METADATA

namespace Project.Models
{

    [MetadataType(typeof(ClassBMetadata))]
    [DataContract(IsReference =true)]
    public partial class ClassB
    {
        [DataMember]
        public bool Checked { get; set; }
        [DataMember]
        public bool Disabled { get; set; }
        [DataMember]
        public string VrstaTakse { get; set; }
        [DataMember]
        public int? Redosled { get; set; }
    }

    public class ClassBMetadata
    {
        [Key]
        public int Id { get; set; }

        [JsonIgnore]
        [IgnoreDataMember]
        public virtual ClassA ClassA { get; set; }
    }
}


//CLASS B

namespace Project.Models
{
    using System;
    using System.Collections.Generic;

    public partial class ClassB
    {
        public int Id { get; set; }

        public virtual ClassA ClassA { get; set; }
    }
}

I had to remove some code for as I am not allowed to share code from work, but the structure is there, and the problematic part is there. Sorry for the bad formating of code, i dont know how to format it in here.

This is my current code


            Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles SearchButton.Click
                    Dim dt As New DataTable
                    Using con As New OdbcConnection("DRIVER={SQL Server};Server=WJNJPHR8TCX8P\SQLEXPRESS;Database=Fabrics;Integrated Security=True;"),
                  cmd As New OdbcCommand("SELECT * FROM [Client] WHERE OR [FirstName] = ?", con)
                        con.Open()

                  cmd.Parameters.Add("@FirstName", OdbcType.NVarChar).Value = FNameTextBox.Text

                  dt.Load(cmd.ExecuteReader())
                  End Using

                  GridView1.DataSourceID = Nothing
                  GridView1.DataSource = dt
                  GridView1.DataBind()

           End Sub

I want to add a URL parameter in the FirstName

When the application loads in angular2 I send post request to set user's timezone. the Action looks like that:

[HttpPost]
public void SetUserTimezone([FromBody] string timeZone)
{
    var identity = (ClaimsIdentity) User.Identity;
    var windowsTimeZone = TZConvert.IanaToWindows(timeZone);

    if (!string.IsNullOrEmpty(User.FindFirstValue(TautekClaimTypes.TimeZone)))
    {
        identity.RemoveClaim(User.FindFirst(MyOwnClaimTypes.TimeZone));
    }

    identity.AddClaim(new Claim(MyOwnClaimTypes.TimeZone, windowsTimeZone));   
}

When I put breakpoint at the end of this action I can see that claim is added, but when another action is called the timezone claim disappears. Am I missing something to save the claim??

The specified value "March 12, 1993" does not conform to the required format, "yyyy-MM-dd"

I'm trying to get the date and edit it on @Html.EditorFor but it doesn.t display the date How to correctly format the date for @Html.EditorFor?

Model:

    [DataType(DataType.Date)]
    [DisplayFormat(DataFormatString = "{0:MMMM dd, yyyy}", ApplyFormatInEditMode = true)]

View:

    @Html.EditorFor(model => model.DateOfBirth, "{0:MMMM dd, yyyy}", new { htmlAttributes = new { @class = "form-control", @style = "width:206px;" } })

I tried using "{0:yyyy-MM-dd}" but it didn't work too.

I'm trying to use AJAX in APS.Net MVC to call a function in my controller and pass in an parameter from the model but Clicking the button doesn't seem to be calling my controller when i put a breakpoint in my code. When hitting the Vote Yes button i want the VoteYes function to be called and have the billid passed in as the parameter. The Billid is a part of the pages Model retrieved as @Html.Raw(Model.BillId). The URL Generated from @Url.Action("VoteYes","Bill") generates /Bill/VoteYes

My Bill.cshtml code:

@model RepresentWebApp.Models.Bill
@{
    ViewBag.Title = "Bill";
}
<head>
    <script src="~/Scripts/jquery-1.10.2.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
</head>

<h2>Bill</h2>
<h3>@Html.DisplayName(Model.Title)</h3>
<h3>@Html.DisplayName(Model.Subjects.Count().ToString())</h3>

<button id="thebutton">Vote Yes</button>

<script>
$(document).ready(function () {
    $("#thebutton").click(function (e) {
        e.preventDefault();
            $.ajax({
                url: @Url.Action("VoteYes","Bill"),
                type: 'POST',
                data: {
                    BillId: @Html.Raw(Model.BillId) 
                },
                success: function(data){alert(data)}
            });
    })
})
</script>

My Controller: BillController.cs

namespace RepresentWebApp.Controllers { public class BillController : Controller { private RepresentDBContext db = new RepresentDBContext();

    public ActionResult Index(int billid)
    {
        Bill bill = db.bill.Find(billid);
        if (bill == null)
        {
            return HttpNotFound();
        }
        return View("Bill", bill);
    }


    [HttpPost]
    public ActionResult VoteYes(int BillId)
    {
        int itWorked = 1;
        return View();
    }

}

}

Here is the Page Source when i load the page for URL: http://localhost:58556/Bill/Index/10139
10139 is a parameter that is the billid in the URL.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bill - My ASP.NET Application</title>
    <link href="/Content/bootstrap.css" rel="stylesheet"/>
<link href="/Content/site.css" rel="stylesheet"/>

    <script src="/Scripts/modernizr-2.6.2.js"></script>


</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">Application name</a>
           </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/About">About</a></li>
                <li><a href="/Home/Contact">Contact</a></li>
            </ul>
                <ul class="nav navbar-nav navbar-right">
    <li><a href="/Account/Register" id="registerLink">Register</a></li>
    <li><a href="/Account/Login" id="loginLink">Log in</a></li>
</ul>

        </div>
    </div>
</div>
<div class="container body-content">




<head>
    <script src="/Scripts/jquery-1.10.2.js"></script>
    <script src="/Scripts/jquery.unobtrusive-ajax.js"></script>

</head>

<h2>Bill</h2>
<h3>A joint resolution to authorize the use of United States Armed Forces 
against al-Qaeda, the Taliban, and the Islamic State of Iraq and Syria, and 
associated persons or forces, that are engaged in hostilities against the 
United States, the Armed Forces, or</h3>
<h3>0</h3>

<button id="thebutton">Vote Yes</button>

<script>
$(document).ready(function () {
    $("#thebutton").click(function (e) {
        e.preventDefault();
            $.ajax({
                url: /Bill/VoteYes, /*generates */
                type: 'POST',
                data: {
                    BillId: 10139 
                },
                success: function(data){alert(data)}
            });
    })
})
</script>


    <hr />
    <footer>
        <p>&copy; 2017 - My ASP.NET Application</p>
    </footer>
</div>

<script src="/Scripts/jquery-1.10.2.js"></script>

<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/respond.js"></script>



<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
{"appName":"Chrome","requestId":"d3ed6b78215d4868a6d2d6750d9a3186"}
</script>
<script type="text/javascript" 
src="http://localhost:64890/6232fa8de08b494bb34022167291a681/browserLink" 
async="async"></script>
<!-- End Browser Link -->

</body>
</html>

I am working on a blog and I want users to be able to comment on blogs with some extra mark up from ckeditor. So I have made a foreach statement to show all the comments and a textarea field with ckeditor per blog post. Now the strange thing is all works fine but the ckeditor works only with the first blog while the textareas are visible at all blogs.

This is the error the webinspector shows

Uncaught The editor instance "editor1" is already attached to the provided element.

here is my view

 IEnumerable<Portfolio.Models.Messages>

@{
    ViewBag.Title = "Home Page";
}
<script src="~/Scripts/Comments.js"></script>
<link rel="stylesheet" type="text/css" href="~/Content/css/Blog.css" />

@*Shows the blog posts that are posted to the database*@
@foreach (var messages in Model)
{
    <div class="jumbotron opacity_container">
        <div class="col-md-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    @*Gets the title of the blog post*@
                    <h2 class="panel-title">
                     @messages.Title
                    </h2>
                    @messages.WhenCreated
                </div>    
                @*Gets the body of the blog post and decodes the html of the 
                 ckeditor*@
                <div class="panel-body">
                @Html.Raw(System.Web.HttpUtility.HtmlDecode(messages.Body))
               </div>
            </div>
        </div>
        @*this button gets the id from the database of the Message table 
          this helps to prevent that all the comments from all blogs gets 
          shown and thusshows only the comments that belong to the blog in 
          question*@

          <button class="btn btn-primary" id="@messages.MessagesId" 
          onclick="ShowComments(this.id)">
          Show Comments
          </button>

        @*this is the container where al the comments are placed in and 
        where you can post comments. The comments are placed in the Comment 
        partial view*@

        <div class="hidden" id="Comm@(messages.MessagesId)">
        @Html.Partial("_Comment")

        @*this button gets the id from the database of the Message table 
        this helps to prevent that all the comments from all blogs gets 
        hidden and thushides only the comments that belong to the blog in 
        question*@

            <button class="btn btn-primary" id="@messages.MessagesId"
            onclick="HideComments(this.id)">
            Hide Comments
            </button>
        </div>
    </div>
}

The partialview is called in the div with the classname hidden.

this is my partial view

@model IEnumerable<Portfolio.Models.Messages>
@{
    ViewBag.Title = "Home Page";
}
<link rel="stylesheet" type="text/css" href="~/Content/css/Blog.css" />
<script src="~/Scripts/ckeditor/ckeditor.js"></script>

<div class="row" id="CommentContainer">
    <div class="col-md-12">
        <h3>Post Comment</h3>
        @*The form to post comments*@
        @using (Html.BeginForm("Create", "Messages"))
            {
            <div class="form-group">
                <label>Comment</label>
                @Html.TextArea("editor1", htmlAttributes: 
                new { name = "editor1", 
                id = "editor1", rows = "10", cols = "180" })
            </div>
                <button type="submit" class="btn btn-primary" 
                 id="PostButton">Post Comment
                </button>
            } 

        @*CKEditor script*@
        <script>
            CKEDITOR.replace('editor1');
        </script>


            <div class="row">
                <div class="col-md-10">
                    @*Places al the comments and decodes the html from the 
                    ckeditor*@
                    @foreach(var messages in Model)
                    {
                        <div class="well" id="CommentBox">                       
                           @Html.Raw(System.Web.HttpUtility.HtmlDecode
                           (messages.Body))
                       </div>
                    }
               </div>
          </div>
     </div>
</div>

The ckeditor is placed inside the partial view that is placed inside the foreach loop. So what I dont get is why is the taxtarea is visible at all posts but the ckeditor not, while they are both inside the same foreach statement.

[HttpPost]
public dynamic sorgu(string tc)
{
    var kisi = db.ogrKayitTbl.Any(n => n.TC == tc);
    if (kisi)
    {
        ogrKayitTbl user = db.ogrKayitTbl.First(n => n.TC == tc);
        Session["tc"] = user.TC;
        return RedirectToAction("Create", "ogrKayit");
    }
    else
    {
        return RedirectToAction("Index", "ogrKayit");
    }
}

this is ogrKayitController .

@using (Html.BeginForm("sorgu", "ogrKayit", FormMethod.Post))

{

<   input type="text" name="tc" placeholder="TC No" required="required" />

<   button type="submit" class="btn btn-primary">Giriş</button>

}

This is View. Where is the problem. TextBox does not exit, it is processing directly.When you add [Http Post], the page will not open (Server Error in '/' Application.) .

Background

I am developing an HTML table which has data from ~50,000 small sized (~4KB) XML files. Each XML feeds a row in the table, with each XML node being a column of the table (7 nodes per file). The table supports column level sorting and filtering (like you see in the Excel spreadsheets).

Problem

I am loading all ~50k files in one go and then determining the order of them in memory. This is causing some time (excessive loading time ~2 minutes) and memory performance issues. I want to know how other people are solving this problem or if they have any ideas to tackle this.

What have I tried

Incremental loading does not seem to be an option since I am supporting the column level sorting and filtering, I have to load all ~50k files in one go and then determine the order of them in memory. I have seen people naming the XML file to have all the sort able column values but since I have many columns with large strings, including them in the name does not seem feasible.

I have the following problem: I am making an MVC intranet website for the corporation I'm working for. One part of the job is to make a phonebook - I need a tree like structure of the departments (with depth).

I have a view with two div elements - left (containing the departments, the structure follows below), and a right div which should show all the employees that are working in the selected (clicked) department.

@helper GetTree(List<PhonesClasses.Department> department, int parentID){
foreach(var i in department.Where(a=>a.headDepartmentID.Equals(parentID)))
{        
    {var childDepartments = department.Where(a => a.headDepartmentID.Equals(i.departmentID)).Count();

    if(childDepartments > 0)
    {
        <li class="haschlid" id="@i.departmentID">
            <a href="#">@i.departmentName</a>
            <ul class="sub-dep">
                @GetTree(department, @i.departmentID)
            </ul>
        </li>
    }
    else
    {
        <li id="@i.departmentID">
             <a href="#">@i.departmentName</a>
        </li>
    } 
  }       
}

The following is the above-mentioned view. As you can see, I had the idea to make a partial view but I'm not sure I'm headed in the right direction.

<div class ="containerStructure">
        <div class="leftDivStructure">
            @if (Model != null && Model.Count() > 0)           
            {
                 <ul class="list" id="deplist">
                      @Treeview.GetTree(Model, Model.FirstOrDefault().headDepartmentID)
                </ul>
            }
        </div>
        <div class="rightDivStructure">
            Employee
            @*@Html.Partial("_PeopleInDepartment", new {depID =  Model.departmentID()})*@
        </div>
    </div>

My employee and department classes both have DepartmentID fields, so when a department is clicked on in my tree view, a parameter () should be passed to the partial view, or whatever needs to be there to handle the parameter and show the employees. Below is the controller that I think has to fetch the result.

public ActionResult PeopleInDepartment(int depID)
        {
            List<Person> peopleList = new List<Person>();
            peopleList = Persons.GetPersons(depID);
            return View(peopleList);
        }

For further clarifications please comment!

I'm trying to upload image files (JPG) to Azure Blob Storage. I'm using the following code

var credentials = new StorageCredentials(name, key);
CloudStorageAccount cso = new CloudStorageAccount(credentials, true);
CloudBlobClient blobClient = cso.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("containerName");
string photoName = e_name + e_cr;
CloudBlockBlob blob = container.GetBlockBlobReference(photoName);
blob.Properties.ContentType = "image/jpg";
blob.UploadFromStreamAsync(img.OpenReadStream());

My issue is that the code is not actually creating the blobs in my container. I've ran it multiple times (once last night and about three to four times today) and the attempt from last night succeeded, however it no longer works. I've tried both Blob and Container access types for my container, so I don't think it's that. img is a IFormFile, and name, key, photoName, e_name, and e_cr are all strings

I have an ASP Web API runing on IIS (Windows server 2008 r2). The sever has two printers available over network (same model, kyocera fs-4200).

I need to select the printer by code and print a PDF document double sided (dúplex).

  • LPR seems to ignore '-o sides=two-sided-long-edge' option, maybe is only available on UNIX.
  • I am using Spire.PDF but is comercial licensed and I can't select the printer. It prints to the default printer so I am configuring it every time.

I'm implementing a Proxy for my application using ASP.NET WebApi (ApiController) and using HttpClient to make the request with my authorization header. It works fine, but it's extremely slow. Below is the main code, then the Global initialization (with DefaultConnectionLimit) and web.config related piece.

As you can see, I'm already using a static/shared HttpClient object with no Proxy and HttpCompletionOption.ResponseHeadersRead on the actual request.

public class ProxyController : ApiController
{
  private const string BASE_URL = "https://developer.api.autodesk.com";
  private const string PROXY_ROUTE = "api/viewerproxy/";


  // HttpClient has been designed to be re-used for multiple calls. Even across multiple threads. 
  // https://stackoverflow.com/questions/22560971/what-is-the-overhead-of-creating-a-new-httpclient-per-call-in-a-webapi-client
  private static HttpClient _httpClient;

  [HttpGet]
  [Route(PROXY_ROUTE + "{*.}")]
  public async Task<HttpResponseMessage> Get()
  {
    if (_httpClient == null)
    {
      _httpClient = new HttpClient(new HttpClientHandler() 
         {
            UseProxy = false,
            Proxy = null
         });
      _httpClient.BaseAddress = new Uri(BASE_URL);
    }

    string url = Request.RequestUri.AbsolutePath.Replace(PROXY_ROUTE, string.Empty);
    string absoluteUrl = url + Request.RequestUri.Query;

    try
    {
      HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, absoluteUrl);
      request.Headers.Add("Authorization", "Bearer " + AccessToken);

      HttpResponseMessage response = await _httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

      return response;
    }
    catch (Exception e)
    {
      return new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError);
    }
  }
}

Global.asax, although I don't believe is a problem of connection limit as all the requests are processed, but just too slow...

public class Global : System.Web.HttpApplication
{
  protected void Application_Start(object sender, EventArgs e)
  {
    GlobalConfiguration.Configure(Config.WebApiConfig.Register);

    ServicePointManager.UseNagleAlgorithm = true;
    ServicePointManager.Expect100Continue = false;
    ServicePointManager.CheckCertificateRevocationList = true;
    ServicePointManager.DefaultConnectionLimit = int.MaxValue;
  }
}

And part of the Web.Config

 <system.web>
    <compilation debug="true" targetFramework="4.6" />
    <httpRuntime targetFramework="4.6" maxRequestLength="2097151" requestLengthDiskThreshold="16384" requestPathInvalidCharacters="&lt;,&gt;,*,%,&amp;,\,?" />
  </system.web>

In my web page im using a table instead of a grid view, when I fill the column with an autofill feature by using keys the particular row stays highlighted but when I do the autofill feature with the mouse it doesn't highlight the row..is there a solution for this problem

I have a lot of images I want to display so I'm using a dynamic partial view to reduce unnecessary code. This is my partial view:

@{ string[] imgs = { 
    "src='~/Content/images/1.png'", 
    "src='~/Content/images/2.png'", 
    "src='~/Content/images/3.png'" 
};

@foreach (var img in imgs) { *HTML GOES HERE* }

HTML inside foreach loop:

<div class="thumbnail-border">
    <img id="modalImage" class="thumbnail-lg" @Html.Raw(img) />
</div>

The strange thing is that if I switch out "src" for "alt", the alt works. But having a variable for src as the image path does not work. So my question is: If I wanted to use a foreach loop to go through an array of strings (the image paths) to use for my , how could I do that?

I've got a simple method to send emails from the website:

... // local vars
using (var mail = new MailMessage(from, sendTo))
{
    using (var smtp = new SmtpClient())
    {
        mail.CC.Add(cc);
        mail.Bcc.Add(bcc.Replace(";", ","));
        mail.Subject = subject;
        mail.Body = body;
        mail.IsBodyHtml = html == -1;
        mail.Priority = priority;
        mail.BodyEncoding = mail.SubjectEncoding = mail.HeadersEncoding = Encoding.UTF8;                    

        smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;

        try
        {
            if (mail.Body.IsNotEmpty())
            {               
                smtp.Send(mail);                
            }
        }
        catch
        {
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

            try
            {
                if (mail.Body.IsNotEmpty())
                {                   
                    smtp.Send(mail);                    
                }
            }
            catch(Exception e)
            {               
                // I log the error here
            }
        }
    }
}

Which works great; however, when the sender is anything@domainname.com and the recipient is bob@domainname.com, the emails are getting stuck in the Drop folder of the inetpub/mailroot directory and never sent to the recipient.

The question is - how I can get around this to be able to send emails to people on the same (local) domain?

https://github.com/mgp25/WART

I have downloaded the Password generator from this Link.

But i am getting an error during Generation like this using my Number.

Could not request code using either SMS or voice

SMS: {"status":"fail","reason":"bad_token"}

Voice: {"status":"fail","reason":"bad_token"}

I searched online and found this link

http://www.17educations.com/whatsapp/how-to-get-whatsapp-id-and-password/

Even then I am getting same error.

I don't know why? Is there any other way to generate password?