Extend Localization in .NET: No Resource found = translate "on the fly" - blazor-server-side

I am using Asp Net Localization with SQL in my Blazor .NET 6 App (Server).
I have content in my app that should not be in the SQL/Resource table and thus needs to be translated "on the fly".
At what point can I catch this?
-> If the entry is not found in the Resource/SQL table, the entry should be translated via my Google/Deepl API and returing the translated string.
Who knows about this and can tell me the right place or implementation?
thank you in advance

Related

Learn SSRS SOAP API in C# language

Where do I start learning SOAP API based on C# for Reporting Service ? MSDN articles are difficult for me to understand and ended up making me confused. In fact, they are like giving more facts. I want to get my hands dirty on coding. But I don't know where could I start. What I want to do is I want my RDL reports/or RDLC reports to get accessed by users over the web. Please give me some guide.
P.S My coding skill is not very good ,but I want to learn more and practise more to improve it. Currently I am using SQL 2012 and VISUAL STUDIO 2012.
Thanks.
For me the easiest way was to start with generated proxy class. I did that using this MSDN article. Follow the section named "Adding the Proxy Using the WSDL Tool". According to it, first generate proxy class running this in command prompt (you may need to use VS dev command prompt to run wsdl.exe):
wsdl /language:CS /n:"Microsoft.SqlServer.ReportingServices2010" http://<Server Name>/reportserver/reportservice2010.asmx?wsdl
You will get ReportingServices2010.cs file, which you can include in your projects and use to connect to SSRS server.
var service = new ReportingService2010(){
Url = "http://<your server>/reportserver/reportservice2010.asmx" // url to your server
};
Then you can code anything you want according to MSDN documentation on this reporting service.
Let me know if this helped you.
I don't know if you made progress since your post (I hope so), but in my case I use the SOAP web service, without created proxy server by hands. VS will do the job.
This MSDN article and related links explain it.
The principle is the following : access the SOAP web service through an URL that looks like that : http://server/reportserver/ReportService2010.asmx?wsdl
where "server" is your domain name server, or IP address
and "reportserver" the access point of your SSRS server (it can be different in function of your installation settings).
After, in your VS, go in "Project" menu and choose "Add a service reference". Then enter the URL of your SSRS SOAP service (as explained before) and that's it !
It will create a new folder in your project called "Web Reference" with a item inside, directly linked to yout web service.
Then you can us it like any other object of .NET Framework (by creating ReportingService2010 for example like done in previous post).
Let me know if you have any other questions.
Regards

How to start developing a Web Api 2.2 project with Asp.Net MVC 5

I have an MVC5 Project and Non browser project. We just upgraded from MVC4 to MVC5 and included a Web Api project. Now we want to make use of Web Api 2.2 and we have created some HTTP methods which works fine in our Api Project. My question is how should I start with Authentication/Authorization.Do I need to create an Authentication Filter class inheriting from ActionFilterAttribute. I referred this link How should I begin with . I am confused how should I use the IPrincipal and set the Identity. Any help is highly appreciated.
The new version is called ASP.NET Identity framework - There are some changes from the ASP.NET Membership in the table structure and everything works through Entity Framework, the tables are created using code first but you can also create it using a script, for example: identity.codeplex.com and SQL-script-for-creating-an-ASP-NET-Identity-Databa or you run the solution using a valid SQL connection string and the tables will be created on first run (code first is doing that - it's built in the entity framework)...
When you create a sample MVC project you will have the basic functionality
Also, check out these resources:
http://johnatten.com/2013/11/11/extending-identity-accounts-and-implementing-role-based-authentication-in-asp-net-mvc-5/
http://johnatten.com/2014/06/22/asp-net-identity-2-0-customizing-users-and-roles/
http://johnatten.com/2014/10/26/asp-net-web-api-and-identity-2-0-customizing-identity-models-and-implementing-role-based-authorization/
http://johnatten.com/2014/02/13/asp-net-mvc-5-identity-extending-and-modifying-roles
http://www.asp.net/identity/overview/getting-started/aspnet-identity-recommended-resources
http://www.asp.net/mvc/overview/getting-started
http://johnatten.com/2014/04/20/asp-net-mvc-and-identity-2-0-understanding-the-basics/
Also, the new table primary keys are changed so the code can run on any type of database, so it's a 128 string key by default (just between us - the database optimization could be made a little better than this) if you're looking for some trouble, check out these links as well:
https://github.com/TypecastException/AspNet-Identity-2-With-Integer-Keys
https://github.com/TypecastException/AspNet-Identity-2-Extensible-Project-Template

How to create dynamic report using telerik reporting in Asp.Net MVC

I am new to telerik reporting and want to create dynamic report using it. I browse through telerik official site but most of example given there are in Asp.Net not for Asp.Net MVC, So my question is how to create dynamic report using telerik reporting in Asp.Net MVC. Is any one done this before? I try to create simple report using SqlDataSource and created report template(.trdx file). I used following code to render my report in view
#{
var DataSource = new UriReportSource() { Uri = "MyReportTemplate.trdx" };
}
#(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl("/api/reports/")
.TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html")
.ReportSource(DataSource)
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false)
)
but issue with is approach is that my all DB connection info is get stored in MyReportTemplate.trdx template so I want to create report design and store it into template file and dynamically generate data and bind it to template to generate report. By doing this my template(.trdx file) only contain designing part and I bind data to it by passing to it from controller. Is it possible to do that?
Thanks in advance...
Your question is very broad, but hopefully the following can point you in the right direction.
First of all the Telerik Reporting documentation is good enough to show you how to get their reports working with ASP.NET MVC. Their documentation isn't all that well laid out but it is pretty comprehensive.
You can find the documentation relating to creating the client side report viewer at the following: HTML5 Report Viewer - The ASP.NET MVC Extension section is particularly important.
You can then also find the documentation relating to how to setup the API for giving the browser based report viewer access to reports at the following: Web API Implementation
For creating your own approach to how reports are served up to the browser you can use the Report Resolver.
In terms of how this all fits together.
You implement the HTML5 report viewer using the MVC extension you have in your sample code. You also have to link to the appropriate telerik reporting css and javascript files for the viewer to render correctly.
The requests coming from the report viewer will hit the Web API controller you should have implemented (see my second link).
To resolve a report using your own implementation use the custom report resolver.

Storing user specific data in ASP.NET MVC

In my application each user has it's own menus depending on changing information on the database.
This way when a user logs-in I have to keep the parameters he can choose somewhere in a Station state table.
So when he choose the parameters I'll retrieve the correspondent option id and make a response from there.
I'm keeping this value in a Current Session object but I'm encountering several problems.
What's the best practice for doing this?
I'm reading several articles that state the Session object is not a good idea in ASP.NET MVC.
Session objects can still be used within MVC check out the answer here Using Session objects in MVC, Is it really bad?
It points to 2 other questions that had a similar question.
What kind of problems are you having?
You can use Asp.Net Cookies, you can create, assign and destroy within the controller
Follow this link Cookies in ASP.Net MVC 5 for more help ...

Pass query string to Page Viewer Web Part

I have a share point page, in which I have added a page viewer web part. This web part needs to be supplied with a query string in addition with the static URL.
I tried putting a QueryString Filter Web Part but it did let me connect with the page viewer web part(Message - the connection type send parameter values is not compatible with any web part on the page)
I was wondering whats the correct way to achieve this. Thanks
I got going...
The solution is to create your own visual web part. Visual web part is not but a user control which a web part loads in in CreateChildControl method.
Now you have access to code behind, Sharepoint Context, you can do what ever you want.
How to create Visual Web Part