Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "huntethan89"

Hi,

I have published my website and tried to using google login with this. I entered "www.mysitename.com" in the address bar then its successfully logged in via google authentication. But when i entered just "mysitename.com" in address bar then google login is not working. It is redirecting me back to login page. Can you help me with this, why its redirecting back to login page when i type address without www. Why its not creating session.

Thanks

Hi , i want to restrict the pdf access from URL without login. If the user has logged into website then only they can access the pdf file otherwise they will redirect to login page.

We tried using File protection handler in a Normal MVC application. it is working fine, but when we implement in ASP NET Zero it is not working. Sometimes it is not redirecting to File protection handler method. Can you give any workaround on this or provide any method method to restrict PDF access.

I am using the following code:-

Web Config - i have added following line in web config under handlers tag. <add name="PDF" path="*.pdf" verb="*" type="ProjectLearn.Web.FileProtectionHandler" resourceType="Unspecified" />

After that added File protection handler class in my project. There is processRequest method in this class as follows:

    public void ProcessRequest(HttpContext context)
     {
         
         switch (context.Request.HttpMethod)
         {
             case "GET":
                 {
                    
                     // Is the user logged-in?
                     if (!context.User.Identity.IsAuthenticated)
                     {
                        
                         context.Response.Redirect("~/Home/Index");
                         return;
                     }
                     string requestedFile = context.Server.MapPath("Temp/"+context.Request.FilePath);
                     // Verify the user has access to the User role.
                     if (context.User.IsInRole("User"))
                     {
                        
                         SendContentTypeAndFile(context, requestedFile);
                     }
                     else
                     {
                        
                         // Deny access, redirect to error page or back to login page.
                         context.Response.Redirect("~/Home/Index");
                     }
                     break;
                 }
         }
     }

Please let me know on this or any other method that we can use.

Thanks

In package.json, I added the following-

"datatables.net": "^2.1.1",
"datatables.net-bs4": "^3.2.2",
"datatables.net-responsive": "^2.2.3",
"datatables.net-responsive-bs4": "^2.2.3",
"datatables.net-select": "^1.2.7"

then in bundles.js - for "output": "view-resources/Views/_Bundles/frontend-libs.min.js", added the following

"wwwroot/lib/datatables.net/js/jquery.dataTables.js",
"wwwroot/lib/datatables.net-bs4/js/dataTables.bootstrap4.js",
"wwwroot/lib/datatables.net-select/js/dataTables.select.js",
"wwwroot/lib/datatables.net-responsive/js/dataTables.responsive.js",
"wwwroot/lib/datatables.net-responsive-bs4/js/responsive.bootstrap4.js"
    

Executed: npm run create-bundles

When I try to use DataTable like- var dataTable = _$table.DataTable({ .. .. });

It gives error on browser that _$table.DataTable is not a function

Is there anything I am missing?

Hi Team, I am new in SignalR with ASP.NET ZERO. I was tried to implement the SignalR in asp.net zero project as per below code statements

1. Created the MyHub.cs class and its method

public class MyHub : Hub { public void Refresh() { Clients.All.refreshglobally(); } }

2. Added the code snippets in JavaScript file

On Button Click Event

$.connection.hub.start().done(function () { abp.signalr.connect(); var kanbanHub = $.connection.kanbanHub;// Get a reference to the hub kanbanHub.server.refresh(); });

Global Function for all clients

function refreshglobally(){ abp.message.success("Record Updated"); }

In the view of above statements, Can you please provide me best way to implement SignalR in asp.net zero and can I call hub methods from server side (As we done in JavaScript like this “$.connection.hub.start().done(function(){})” )

Thanks in Advance.

We are using template ASP.NET MVC 5.x & JQuery It is consuming our time a lot to make CRUD operations for master tables. Wanted to confirm when will you guys providing Rapid developement tool for this template as it is very much needed.

Thank you!

Hi,

I am using SignalR in ASPNET ZERO (v 5.0.0.0). I have a new controller which is not ABP controller. And implemented SIgnalR on that. It is working fine but sometimes it breaks and stop displaying message on client side. i am showing code below what i have done.
Code on cshtml page:-
                                &lt;script type=&quot;text/javascript&quot;&gt;
                                abp.signalr = abp.signalr || {};
                                abp.signalr.autoConnect = false;
                            &lt;/script&gt;
                            &lt;script src=&quot;~/Scripts/jquery.signalR-2.4.0.js&quot;&gt;&lt;/script&gt;
                            &lt;script src=&quot;~/signalr/hubs&quot;&gt;&lt;/script&gt;
                            &lt;script src=&quot;~/Abp/Framework/scripts/libs/abp.signalr.js&quot;&gt;&lt;/script&gt;
                                    
code on partial view for SignalR requests : -
                        &lt;script type=&quot;text/javascript&quot;&gt;
                                $(document).ready(function () {
                                    $.connection.hub.start();
                                    abp.signalr.connect();
                                     var chatHub = $.connection.myHub;
                                     
                                      $(document).on('click', '#PreviewLeftSideClick', function () {
                                                chatHub.server.paceModeSlideClick('test data');                           
                                      });
                                     chatHub.client.paceModeSlideClick = function (data) {
                                     alert(data);
                                      };
                                });
                          &lt;/script&gt;  
                          
code on cs file :-
                         public class MyHub : Hub, ITransientDependency
                        {
                                    public void PaceModeSlideClick(string data)
                            {
                                    Clients.All.paceModeSlideClick(string.Format("{0}",data);
                            }

                        }
                        

I am attaching images to show what i got when checking connection on console.

a) 1.png - It fetched all the hubs. So, when clicking on server side, client is getting proper messages.

1.png

b) 2.png - It fetched only one hub (abpcommonhub), when clicking on server side, there is no effect on client side.

** 2.png**

We are getting this error sometime. Its only one page. Sometime on refreshing the page we are getting 1.png image message and sometimes 2.png image message. Please suggest what to do.

Thanks

Hi, I am getting following error in my application. However, i am not using any commit transaction in my code. Can you please look into this and let me know what is the issue?

** Stack trace** System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.Data.SqlClient.SqlException: The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest) at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest) at System.Data.SqlClient.SqlDelegatedTransaction.SinglePhaseCommit(SinglePhaseEnlistment enlistment) --- End of inner exception stack trace --- at System.Transactions.TransactionStateAborted.EndCommit(InternalTransaction tx) at System.Transactions.CommittableTransaction.Commit() at System.Transactions.TransactionScope.InternalDispose() at System.Transactions.TransactionScope.Dispose() at Abp.EntityFramework.Uow.TransactionScopeEfTransactionStrategy.Commit() at Abp.EntityFramework.Uow.EfUnitOfWork.CompleteUow() at Abp.Domain.Uow.UnitOfWorkBase.Complete() at Abp.Web.Mvc.Uow.AbpMvcUowFilter.OnActionExecuted(ActionExecutedContext filterContext) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.

Thanks

Hi,

I want to reterive name of the user who has submitted code, Please tell me how to achieve this. Here is my code:

[Table("Management_Of_Change")]
    public class Entity_Management_Of_Change : FullAuditedEntity
    {

        public virtual string Originator_Job_Title { get; set; }
        public virtual string Management_Of_Change_Number { get; set; }
        public virtual DateTime? Required_Date { get; set; }
        public virtual string Location_And_Field_Names { get; set; }

        [NotMapped]
        [Computed]
        public string Status_Name => Entity_MOC_Status.Name;

       
        [NotMapped]
        [Computed]
        public string Creator_Name
        {
            get
            {

                var _result = //----- How to get creator Name here??

                return _result;


            }
        }

    }
}

Hi, I have published my website on IIS which is working in two ways. we can access the website using https://www.websitename.com and https://websitename.com. So, when logging in i am facing issue of session creation. If i logged in through one of the URL it is accessible to another URL due to session issue.

So, to resolve this i added cookie domain value in Startup.cs file in my project as follows, which is working fine. But when i click logout button, i am not able to logout.

app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login"),
                CookieDomain = ".websitename.com"
            });

Is there any workaround to resolve this issue.

Thanks

public void Execute(int Id) 
{
    string status = "";
    try {
        .............
        .............

        status = "Succeeded";
    }
    catch (Exception ex) {
        status = "Failed";
    } 
    finally {
      _appService.Update(Id, status);
    }
}

Update method -

public void Update(int Id, string status)
{
    var record = _repository.Get(Id);
    record.LastRunStatus = status;

    _repository.Update(record);
    CurrentUnitOfWork.SaveChanges();
}

The record is only updates if there is no exception in Execute method. I want the record to update even when there is exception. How can we achieve this?

Showing 31 to 40 of 80 entries