Subscribe: Personal Site Starter Kit
Added By: Feedage Forager Feedage Grade B rated
Language: English
add  appsettings wsfed  certificate  columns add  columns  data  form  new  null  option  string  style  text  user  wsfed 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Personal Site Starter Kit

All Forums

All Forums

Last Build Date: Fri, 23 Mar 2018 21:55:47 -0700


Session Issue: Multiple Domain Extensions (.com and .tv) with a single web.config authentication:forms element


I'm maintaining an application that must take two different domains each having a different Domain Extension (example: .com & .tv). My web.config looks sometime like this.


name=".myAuth" domain="" loginUrl="signin.aspx" timeout="888" requireSSL="false" />

The issue I'm facing is my sign-in process is only creating a session when signing in through If I were to sign-in through then no session is created. I've tried removing the domain property altogether in attempt to keep the process more generic, but that doesn't seem to help.

So my question is, how can I have and both use the same loginUrl and create sessions? 

Thank you






Do the above two statements have the same meaning and effect?


Some Beginner Questions



Sorry if I post this at the improper place, I actually don't know how to categorise these questions.

I am new to Visual Studio Community Ver 7.3.3 (build 23) Mac version. I am starting to develop a Web project using Web Form. At some point, I need to create database and tables to store data. However, I don't know where to start. All the guides and step-by-steps are not really useful to me as I couldn't follow those steps because I couldn't find the related item/step in my VS Community. Also my project workspace's ToolBox does not have any database or data source items to add.

Can anybody generously point me to any beginner guides to configure or setup database in a project?

I found many SQL packages in NuGet, which one should I install in order to setup database for my project?

How make a asp-for dropdown list


I'm new to MVC core. This is my first time using it. I'm instructed to use asp-for tags. The closes I can find is:

But I need to have the list dropdown, how do you do that? What are the steps?

Update TextBoxes To Null


I am querying SQL Server and displaying the results on in text boxes on screen.  I am attempting to set the text box values to null when the button is pressed by using the below code, but the text boxes are never updated to null, they are just updated to new values when the new values are pulled from the server.  How could I have the values update to null?

private void btnClick(object sender, EventArgs, e)
      this.txtOne.Text = null;
      this.txtTwo.Text = null;
      this.txtThree.Text = null;

      //Query SQL Server

Asp .net Core : unit tests in Docker



I want to launch my tests (unit and integration test) at the time my project is build (on VSTS) and dismiss the rest of the CI pipeline if they fail.

I use docker support for my project and the following architecture :

├── src/
│   └── MyService/
│       └── MyService.csproj
├── test/
│  └── MyService.Tests/
│       └── MyService.Tests.csproj
└── MyService.sln

Can someone explain me clearly the following points please :

  • does the Test project needs a Dockerfile ? If yes can someone give an example ?
  • does the dotnet test command should be launched in the MyService Dockerfile and then break the publish command if tests fail ?
  • if the point above is right : if I work with microservices, so each microservice may have a specific test projet in order to launch its dedicated dotnet test command referring to the linked test project in each microservice Dockerfile ?

Any feedback will be really helpful.


Problems Accessing External REST API


I'm still sort of new to .NET and .NET CORE, and think I need a nudge in the right direction on something...

My .NET Core web application needs to communicate with an external REST API and grab some data. Now, I can successfully authenticate and get back limited data. The problem is that I can't figure out how to grab ALL the data I need. I'm trying to access the ClearPass Policy Manager Configuration API and grab a list of all the devices in the system. But it seems to have a limit of 1,000 records. How do I go about paging or something in order to grab the 2,000+ entries from the API?

Here's an example of what I've currently got (limited to 999).

using (var httpClient = new HttpClient())
	httpClient.BaseAddress = new Uri(baseUrl);
	httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
	httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);
	//HttpResponseMessage response = await httpClient.GetAsync("api/device");
	HttpResponseMessage response = await httpClient.GetAsync("api/device?filter=%7B%7D&sort=-id&offset=0&limit=999&calculate_count=false");
	if (response.IsSuccessStatusCode)
		//do my stuff


Adding HTMl into Controller


I am trying to prefill input textboxes with model values that gets passed in from another view. I have it so that the values are getting passed in however it Is getting passed in as one long string. I was wondering if there is a way for me to include html into my controller code so that I can break the string up into separate lines but still be able to fit it all in one textarea.




 public ActionResult Email(int? id, FormCollection form)
            if (Session["UserId"] != null)
                Strategy strat = db.Strategies.Find(id);
                ViewData["message"] = "Create Date: " + strat.CreateDate + "Updated: " + strat.Updated + "Customer:" + strat.Customer + "End Product: " + strat.EndProduct;
                return View(strat);
                return RedirectToAction("Login", "Account");

Bind Grid Mvc on DropDown Selected Change event


Hi, I am showing on view with Grid.mvc with the Below details. View name is DashBoard with the following details: DashBoard View:
@Html.Grid(Model).Columns(columns => { columns.Add() .SetWidth("5") .Titled("User Name") .Sanitized(false) .Encoded(false) .RenderValueAs(c => Html.ActionLink(c.full_name, "Leads", "Home", new { UserName=c.username }, new { target = "_blank"}) .ToHtmlString()); columns.Add(c => c.l_count).Titled("LCount").Filterable(true); }).Sortable(true)
User Name LCount ABC 106 ADE 100 CFD 50 Above User Name in Grid.Mvc is Action Link , when we click on that user name it has to redirect to the another view (Contacts) Contacts view: Binding dropdown list with all user Names (i.e ABC,ADE,CFD).. And I have to show all records of selected user details in Grid.Mvc with the below details. @model System.Collections.Generic.IEnumerable @using System.Web.Mvc.Html @using GridMvc.Html @{ Layout = null; } TLILeads
@Html.Label("Title", new { @class = "control-label" })
@Html.Grid(Model).Columns(columns => { columns.Add(c => c.userName).Titled("User Name").Filterable(true); columns.Add(c => c.ContactPerson).Titled("Contact Name").Filterable(true); columns.Add(c =>"Phone"); columns.Add(c => c.Mobile).Titled("Mobile"); columns.Add(c => c.EmailId).Titled("EmailId"); }).WithPaging(10).Sortable();

How to adjust iframe height when screen is resized.


Hello friends,

We have the following table with 3 rows:

The first row is the title; the second row is the iframe, the third row is Close button.

When the window is resized, we want the iframe to adjust itself (height and width) to fully fill the new dimension.

How should we do it? (We tried different methods, no luck, :-()

Thanks and best.


runat="server" id="pdfFrame" style="width:100%;height:100%" src="" seamless="seamless" scrolling="no" frameborder="0" allowtransparency="true">

IDX10503: Signature validation failed after updating to Owin.Security v 4.0.0


As per subject, I updated the Owin.Security.WsFederation and dependant packages to version 4.0 and I get the error. I did not make any code changes other than changing using Microsoft.IdentityModel.Protocols; to using Microsoft.IdentityModel.Protocols.WsFederation; where is the WsFederationConfiguration class seems to be now. Here is my StartupAuth: public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication( new CookieAuthenticationOptions { AuthenticationType = CookieAuthenticationDefaults.AuthenticationType }); // Create WsFed configuration from web.config wsfed: values var wsconfig = new WsFederationConfiguration() { Issuer = ConfigurationManager.AppSettings["wsfed:Issuer"], TokenEndpoint = ConfigurationManager.AppSettings["wsfed:TokenEndPoint"], }; /* * Add x509 certificates to configuration * */ // certificate.1 must always exist byte[] x509Certificate; x509Certificate = Convert.FromBase64String(ConfigurationManager.AppSettings["wsfed:certificate.1"]); wsconfig.SigningKeys.Add(new X509SecurityKey(new X509Certificate2(x509Certificate))); // certificate 2 may exist if (ConfigurationManager.AppSettings["wsfed:certificate.2"] != null) { x509Certificate = Convert.FromBase64String(ConfigurationManager.AppSettings["wsfed:certificate.2"]); wsconfig.SigningKeys.Add(new X509SecurityKey(new X509Certificate2(x509Certificate))); } // certificate 3 may exist if (ConfigurationManager.AppSettings["wsfed:certificate.3"] != null) { x509Certificate = Convert.FromBase64String(ConfigurationManager.AppSettings["wsfed:certificate.3"]); wsconfig.SigningKeys.Add(new X509SecurityKey(new X509Certificate2(x509Certificate))); } // Apply configuration to wsfed Auth Options var wsoptions = new WsFederationAuthenticationOptions { SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType, Configuration = wsconfig, Wreply = ConfigurationManager.AppSettings["wsfed:Wreply"], Wtrealm = ConfigurationManager.AppSettings["wsfed:Wtrealm"], }; wsoptions.TokenValidationParameters.NameClaimType = ""; // Add WdFederation middleware to Owin pipeline app.UseWsFederationAuthentication(wsoptions); } Is there something else 4.0 needs to validate the signature? I assume it's talking about the signature of the token from the issuer. I didn't see how to enable ShowPII to see what key it's looking at. I am using MVC5 with the full framework. Not core. [...]

Serializer runs in the new thread?


I have a Get (int Id) method in my controller that returns class instance.

Instance is created correctly(i can see that in the debugger) but on attempt to return

return classInstance;

my code crashes since it runs in the new thread and therefore setting culture to "en-US" .

Previously I have set default culture to "en-CA" which works beautifully on JsonConvert.SerializeObject(user,Formatting.Indented,settings).

How to fix the issue without modifying legacy code on classInstance. Is there a way to set culture for all threads within current request.

Or if you have some other idea.

SignalR on Android


actually I want to create a chat service using and signalR for real-time but as in the client side I couldn't find proper libraries so can be used on android or ios, sure the js and c# client libraries are greate but I was wondering if anyone knows about good libraries for android and ios to call upon signalr,
I also considered to use xamrin but things would be better if I could use native java and swift for ios and android
tnx core vs react or meteor



I've heard core can handle front end. Does is it mean it can do works witch front end frameworks like react or vue or meteor can do?

Please inform me.



ListView Textarea Resize


We would like to have some control over the sizing of a TextBox multiline control when in edit mode.  We have a Textbox used to edit a note field that sometimes is very small (40 characters) and sometimes is very large (2000+ characters).  We have made the Textbox and column a size to hold the largest character content and it looks strange when we only edit a 40 character text field.  Just wondered if there was a way around this via code or via javascript/jquery.  Thanks.

calling variables from one form to another


HI All,

I m new to C#. I have created a variable to get filename in form 2. I want the same variable to be accessed in form 3.

Pls help me out.

Identifying anonymous users


What is a good way to identify anonymous users?
I have tried Guid but it seems that sometimes I get a duplicate value. I generate a new Guid and save it in a Cookie for some time.

Another issue that I have had is with sessions. In this case, I use session value to create folders so each user saves its work independently, but I have experienced 2 users seeing each others data.

Session["something"] = Session.SessionID;

I wonder if these 2 situations have something in common. Although my main concern is currently a strategy to identify anonymous users.
Is there another approach besides sessions and Guid?

Jorge Maldonado

Post JSON Data and image at the same time to a web Api 2


I have a function which adds data to a SQL Database and upload an image(s) to the server. I convert the image into base64 string to send it with my post but I read that the image size is 33% bigger than the original file. I would like to send the post like multipart form data, I don't know how can I receive the data in my model!!

This is my code:

public async Task Post([FromBody]Post userpost)
        if (ModelState.IsValid)
            int postid = Convert.ToInt32(postDB.AddPost(userpost));                   

            if (userpost.fileBody.Length > 0)
                var filename = string.Format("{0}_{1}{2}", postid, Guid.NewGuid().ToString(), ".jpg");

                var ms = new MemoryStream(Convert.FromBase64String(userpost.fileBody));

                 await upload.UploadFile(filename, ms, "image/jpg","images");


                return Content(HttpStatusCode.Accepted, "{\"pic\":\"" + filename + "\"}");
                return Ok(HttpStatusCode.OK);
            return Ok(HttpStatusCode.NotAcceptable);

Thank you.

Create an image on the fly from content of a div


Hi guys,

A question is there a easy way to create an image on the fly ie from a div or something. and not save on the server.

string export = @"
"; image = string.Format(export,"/image/myfirstimage.jpg","great barrier reef\r\n2001\r\ntaken by bashin")

and display it using webform that has ContentType="image/jpg"