Recaptcha 3 and Classic ASP - recaptcha-v3

Is there an example of how to add Recaptcha 3 to a Classic asp form anywhere? I can find examples for PHP but not Classic ASP and I am not sure what the equivalent Of
$recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&response=' . $recaptcha_response);
is in ASP - thanks

My old classic .asp lib in my head would say something like:
<%
' if you have a file to read, you can use this to your local file
Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\file.txt" ,1)
' but I assume you want to execute some code in a url with some parameters.
callback_response = server.exectute(recaptcha_url + "?secret=" + recaptcha_secret + "&response=" + recaptcha_response)
%>

Related

Cannot Extract Params from URL

Good Afternoon,
I have a external GET request hitting a controller action but i cannot retrieve the params.
the URL looks like:
https://yourway.local/strava/webstatusrep?hub.verify_token=STRAVA&hub.challenge=15f7d1a91c1f40f8a748fd134752feb3&hub.mode=subscribe
i have tried using
$param1 = $request->getQueryParam('hub.challenge');
or
$param = ArrayHelper::getValue(Yii::$app->request->get(), 'hub.challenge');
But also in Xdebug i can see they are not sitting in the “queryparams” section.
Just replace . with _ in param name when calling Yii2 api:
$paramValue = Yii::$app->request->get("hub_challenge");

session data is not retrieved in ASP.NET MVC

I have created the internet application ASP.NET MVC Using RAZOR.
I have written in Index.cshtml as:
#Session["my"]="Hello".
and I have written in AboutUs.cshtml as:
#Session["my"]
Still now I can't get the value from AboutUs.cshtml .
Instead of it in Index.cshtml it shows:
="Hello"
Replace #Session["my"]="Hello"; with #{ Session["my"] = "Hello"; }.
Note the addition of curly brackets.

Wrong parse dot.js template after migrating to asp.net mvc 4

After migrating from mvc 3 to mvc 4 Razor v.2 wrong parse my js template.
Problem in the next {{if}} section
{{? (it.#Model.GetPropName(x => x.Children)).length < it.#Model.GetPropName(x => x.ChildTaskTotalCount)}}
{{?}}
Razor v2 parse second argument of condition(it.#Model.GetPropName(x => x.ChildTaskTotalCount) ) as a string. And dot.js throws error on client browser.
#Model.GetPropName()- function which returns name of model property.Other words it.#Model.GetPropName(x => x.ChildTaskTotalCount) equal to it.ChildTaskTotalCount, but (it.Children).length
This code block works correctly in asp.net mvc 3 with razor v.1.
How should i change syntax to correct work with razor v.2?

Generate report from URL - SQL Server Reporting Services 2008

I have SQL Server Reporting Services 2008 and when I open the following URL:
"http://localhost/Reports/Pages/Report.aspx?someReport"
I'm getting report screen in which I fill my parameters and generate a report,
My question is how can I do this without any GUI? by batch file or C# script..
Thanks in advance.
=========================================================================
EDIT:
Thanks to all answer above I succeed to generate a report and save it as an XML using the following link:
"http://Server/ReportServer/Pages/ReportViewer.aspx?someReport&dFrom=01/01/2012&dTo=08/08/2012&rs%3AFormat=XML"
Thanks for you all!!!
Your problem is you are passing parameters to http://server/reports...
you need to pass parameters to http://server/reportserver...
I remember this issue I had when I first started using Reporting Services.
Here's the MSDN that may help you: http://msdn.microsoft.com/en-us/library/ms155391.aspx
For example, to specify two parameters, “ReportMonth” and “ReportYear”, defined in a
report, use the following URL for a native mode report server:
http://myrshost/ReportServer?/AdventureWorks 2008R2/Employee_Sales_Summary_2008R2&ReportMonth=3&ReportYear=2008
The result is like so:
http://myRSServer/ReportServer/Pages/Report.aspx?%2fDefaultTenant%2fDialing+Reports%2fDialing+Agent+Performance&dFrom=01/01/2012&dTo=08/08/2012
If you want to export the report to excel / pdf / etc you can append it:
For excel: &rs:Format=Excel
For PDF: &rs:Format=PDF
This should help as well: http://www.mssqltips.com/sqlservertip/1336/pass-parameters-and-options-with-a-url-in-sql-reporting-services/
Your second URL option is the closest, you pass the date parameters without quotes. As JonH states you want to use ReportServer instead of Reports, and you also want to remove ItemPath=
http://Server/ReportServer/Pages/Report.aspx?%2fDefaultTenant%2fDialing+Reports%2fDialing+Agent+Performance&dFrom=01/01/2012&dTo=08/08/2012
Additionaly, if you want to export the file you can append &rs:command=render&rs:format=PDF replacing PDF with the format you desire
string URL = "YourReportUrl";
string FullURL = URL + "&JobId=" + JobId.ToString() + "&JobNumber=" + JobNo.ToString() + "&rs%3aCommand=Render";
Where JobId and JobNumber will be your Parameter names.
This will directly open in your report Viewer.
To display in XML format, add this &rs%3AFormat=XML to end of URL.
string FullURL = URL + "&JobId=" + JobId.ToString() + "&JobNumber=" + JobNo.ToString() + "&rs%3aCommand=Render&rs%3AFormat=XML";
Following is an example for using URL for a report. It passes parameters and also specify whether the parameters should be hidden or not
http://myServer/ReportServer/Pages/ReportViewer.aspx?/InventoryTracking/Receiving/InboundContainerID
&rs:Command=Render&rc:Parameters=false&Plant="20"
If are using HTML file to display this, then use
window.location.href = url;

ASP.NET MVC3 Razor #string dot problem

With the MVC3 Razor synax, one may render a string like so
#ViewData("photo")
My problem is: How can I append a dot to the above code.
The following will result in a "Public member 'jpg' on type 'String' not found.":
#ViewData("photo").jpg
I've tried the following code but does not produce my intended result:
#ViewData("photo") .jpg
#ViewData("photo"):.jpg
#ViewData("photo") & ".jpg"
Thanx for advance for your help.
And please dont advice me to append the "jpg" in the controller's code like so:
ViewData("photo") = "filename.jpg"
I've searched the Net for the same problem but found none, not even something
similar.
By the way, I'm using VB.net.
How about this?
#(ViewData("photo")).jpg
Edit: And with the dynamic ViewBag:
#(ViewBag.photo).jpg
Adding as answer:
#(ViewData("photo") + ".jpg")
You could always try:
#string.concat(ViewData("photo"),".jpg")