Base solution for your next web application

Activities of "dparizek"

I am trying to disable antiforgery at least temporarily so that I can use Telerik Reporting and it will not pass the antiforgery cookie:

@{ SetAntiForgeryCookie(); }

I can see cookie in browser console but Telerik not passing it and also Telerik talks of enabling Cors.

When I add:

Configuration.Modules.AbpWeb().AntiForgery.IsEnabled = false;

to my ApplicationModule PreInitialize method then I am missing a Using statement as it does not recognize AbpWeb()

What would be the Using statement? I tried using Abp.Configuration.Startup; no luck.

Also, I cannot find any EnableCores function in my codebase... where does that go if I want to enable Cors?

I have a similar problem but am willing to try disabling antiforgery - except when I add

Configuration.Modules.AbpWeb().AntiForgery.IsEnabled = false;

to my ApplicationModule PreInitialize method then I am missing a Using statement as it does not recognize AbpWeb()

What would be the Using statement? I tried using Abp.Configuration.Startup; no luck.

Also, I cannot find any EnableCores function in my codebase... where does that go if I want to enable Cors?

Doesn't that apply more if I am trying to create the server side of the API - the endpoints?

Above I am trying to consume a third party API... someone's else data api on the web from my app... not trying to be on the producer side.

So I just need to send them the xml in plain text... I don't need it formatted... in postman or a console app the above just works to access the third party app... so what could be making that code not work if I put it in ABP?

I search on the error text and I get references to SSL / TSL issues but I have verified that does not seem to be the issue in my case.

The following code works great in a .NET framework 4.6-4.6.2 console app, but will not work when I bring it into the Angular1/MVC version of ASP.NET Zero...

      `  string xmldata = "<records><item><record>";
        xmldata += ptid;
        xmldata += "</record><field_name>";
        xmldata += fieldname;
        xmldata += "</field_name><value>" + newvalue + "</value><redcap_event_name>";
        xmldata += redcap_event_name;
        xmldata += "</redcap_event_name></item></records>";

        var sbPostData = new StringBuilder();
        sbPostData.Append("token=" + token);
        sbPostData.Append("&content=record");
        sbPostData.Append("&format=xml");
        sbPostData.Append("&type=eav");
        sbPostData.Append("&overwriteBehavior=normal");
        sbPostData.Append("&data=" + xmldata);
        sbPostData.Append("&returnContent=ids");
        sbPostData.Append("&returnFormat=xml");

        var byteArray = Encoding.UTF8.GetBytes(sbPostData.ToString());

        string Baseurl = "https://redcap.uahs.arizona.edu/api/";
        Uri REDCapUri = new Uri(Baseurl);

        var webRequest = WebRequest.CreateHttp(REDCapUri);
        webRequest.Method = "POST";
        webRequest.ContentType = "application/x-www-form-urlencoded";

        try
        {
            webRequest.GetRequestStream().WriteAsync(byteArray, 0, byteArray.Length);
            var webResponse = webRequest.GetResponse();
            return "success";
        }
        catch (Exception e)
        {
            Debug.WriteLine(String.Concat(e.Message, e.StackTrace));
            return e.Message;
        }`
        

At this line: var webResponse = webRequest.GetResponse();

I get this error returned:

Exception thrown: 'System.Net.WebException' in System.dll The underlying connection was closed: An unexpected error occurred on a send. at System.Net.HttpWebRequest.GetResponse()

Why might it work in the console app but not within ASP.NET Zero framework? Any hints what I might try?

Actually I will make an example and write it up. I think (-:

+1 for detailed example. In the UI-Demo0-Components section there is great UI for multi-file upload but that demonstration does not work for actual uploading. Is it supposed to work with ng2-file-upload?

Answer

There is this... https://github.com/aspnetboilerplate/sample-blog-module

I think ASP.NET Zero team should update it for ASP.NET Zero UI and make it an included app with ASP.NET Zero (-;

With the newer Core versions of ASP.NET Zero if you want to have non-login landing pages for your SaaS product you now need to use a multi-domain approach. Why this approach? I cannot think of any SaaS businesses out there where their business is divided up into multiple domains. I want to brand only one domain name, and have only one domain name. I don't want my landing pages/business information/sales pages on one domain name, and then my SPA on another domain name... that makes no sense to me and could confuse my customers. Are there any examples of SaaS businesses structured that way out there? I have never seen any such examples.

Can anyone suggest what steps are required to put things back to customer arrives at mydomain.com, can visit About page and Home page and learn about my Saas, and sign up, and then login to SPA that is maybe at mydomain.com/myspa, and I don't need to redirect them to myseconddomain.com for the SPA??

So will be able to get the code if we want similar for a project we are buidling? This would be great example app (-:

What about for Mac? How should Mac users get updated RAD tool?

Showing 11 to 20 of 71 entries