only you know
only you know
CC#
Created by only you know on 7/24/2024 in #help
how to make authorization for login
I tried to make beginner login page with authorization but Im getting this error message
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: OnStarting cannot be set because the response has already started.
System.InvalidOperationException: OnStarting cannot be set because the response has already started.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.OnStarting(Func`2 callback, Object state)
at CustomAuthenticationStateProvider.MarkUserAsAuthenticated(String username, String role) in /Users/ensarerdeve/Documents/VSC Projects/testtrack/ProtaTestTrack2/Services/CustomAuthenticationProvider.cs:line 34
at ProtaTestTrack2.Components.Pages.Login.LoginUser() in /Users/ensarerdeve/Documents/VSC Projects/testtrack/ProtaTestTrack2/Components/Pages/Login.razor:line 40
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at MudBlazor.MudBaseButton.OnClickHandler(MouseEventArgs ev)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle,
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: OnStarting cannot be set because the response has already started.
System.InvalidOperationException: OnStarting cannot be set because the response has already started.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.OnStarting(Func`2 callback, Object state)
at CustomAuthenticationStateProvider.MarkUserAsAuthenticated(String username, String role) in /Users/ensarerdeve/Documents/VSC Projects/testtrack/ProtaTestTrack2/Services/CustomAuthenticationProvider.cs:line 34
at ProtaTestTrack2.Components.Pages.Login.LoginUser() in /Users/ensarerdeve/Documents/VSC Projects/testtrack/ProtaTestTrack2/Components/Pages/Login.razor:line 40
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at MudBlazor.MudBaseButton.OnClickHandler(MouseEventArgs ev)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle,
3 replies
CC#
Created by only you know on 7/5/2024 in #help
✅ connecting docker container from localhost
No description
201 replies
CC#
Created by only you know on 6/30/2024 in #help
how to manage nested models in asp net and mongo
No description
30 replies
CC#
Created by only you know on 6/26/2024 in #help
problem with updating method for backend with mongo driver
No description
9 replies
CC#
Created by only you know on 5/27/2024 in #help
when connecting database 404 not found error
I created a db from docker and created db in mysql. After that I build a mini backend with ef core and asp net for homework but I couldn't manage to connect it. My connection string is correct
107 replies
CC#
Created by only you know on 5/14/2024 in #help
blazor form edit is not sending data to backend
@page "/register"
@using System.ComponentModel.DataAnnotations
@inject HttpClient http

<PageTitle>Registration</PageTitle>

<h1>Fill For Registration</h1>

<EditForm Model="@registration" OnSubmit="@Submit" FormName="RegisterForm" action="http://localhost:5234/User">
<div>
<label>Name:
<InputText @bind-Value="@registration.Name" />
</label>
</div>
<div>
<label>Surname:
<InputText @bind-Value="@registration.Surname" />
</label>
</div>
<div>
<label>Username:
<InputText @bind-Value="@registration.Username" />
</label>
</div>
<div>
<label>Email:
<InputText @bind-Value="@registration.Email" />
</label>
</div>
<div>
<label>Phone:
<InputText @bind-Value="@registration.Phone" />
</label>
</div>
<div>
<label>Age:
<InputNumber @bind-Value="@registration.Age" />
</label>
</div>
<div>
<button type="submit">Register</button>
</div>
</EditForm>

@code{
public class UserDto
{
public string Name { get; set; }
public string Surname { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public string Phone { get; set; }
public decimal Age { get; set; }
}
private UserDto registration = new UserDto();
private async Task Submit()
{
var url = "http://localhost:5234/User";
await http.PostAsJsonAsync(url, registration);
}

}
@page "/register"
@using System.ComponentModel.DataAnnotations
@inject HttpClient http

<PageTitle>Registration</PageTitle>

<h1>Fill For Registration</h1>

<EditForm Model="@registration" OnSubmit="@Submit" FormName="RegisterForm" action="http://localhost:5234/User">
<div>
<label>Name:
<InputText @bind-Value="@registration.Name" />
</label>
</div>
<div>
<label>Surname:
<InputText @bind-Value="@registration.Surname" />
</label>
</div>
<div>
<label>Username:
<InputText @bind-Value="@registration.Username" />
</label>
</div>
<div>
<label>Email:
<InputText @bind-Value="@registration.Email" />
</label>
</div>
<div>
<label>Phone:
<InputText @bind-Value="@registration.Phone" />
</label>
</div>
<div>
<label>Age:
<InputNumber @bind-Value="@registration.Age" />
</label>
</div>
<div>
<button type="submit">Register</button>
</div>
</EditForm>

@code{
public class UserDto
{
public string Name { get; set; }
public string Surname { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public string Phone { get; set; }
public decimal Age { get; set; }
}
private UserDto registration = new UserDto();
private async Task Submit()
{
var url = "http://localhost:5234/User";
await http.PostAsJsonAsync(url, registration);
}

}
here is my blazor code part. when I click register button (i added breakpoint to await method) it shows registration is null.
2 replies
CC#
Created by only you know on 4/3/2024 in #help
crud operations with blazor server
No description
1 replies
CC#
Created by only you know on 4/2/2024 in #help
how to export datas to json file from mysql
No description
12 replies
CC#
Created by only you know on 3/31/2024 in #help
practicing on mutliple databases
I have a model named 'User' in PostgreSQL, an 'Item' in MongoDB, and a 'Cart' in PostgreSQL. Shouldn't the 'Cart' model be relational with Item and User, should I change the mongodb? In other words, a user has a cart, and a cart has an item.
12 replies
CC#
Created by only you know on 3/27/2024 in #help
how to move json datas to mysql
No description
482 replies
CC#
Created by only you know on 3/26/2024 in #help
repository returns unwanted areas
No description
33 replies
CC#
Created by only you know on 3/20/2024 in #help
how to connect mysql to .net program as 2nd db
No description
161 replies
CC#
Created by only you know on 3/18/2024 in #help
system.aggregate Exception
No description
27 replies
CC#
Created by only you know on 3/13/2024 in #help
guid doesn't change after post
No description
60 replies
CC#
Created by only you know on 3/13/2024 in #help
System.AggregateException
No description
206 replies
CC#
Created by only you know on 3/6/2024 in #help
Building a generic repository for mongodb
hello folks I was thinking build a generic repository structure for mongodb. but someday if i want to change the db i don't want to start all over again. I hope I explained myself well.
98 replies