|
cotsjdixon wrote: I had a strange error message and then didn't see my post, so I assumed it was not accepted.
That'll probably be the automated spam filter. It sometimes flags legitimate messages for review, and needs a human moderator to approve the message.
cotsjdixon wrote: https://www.nuget.org/packages/Microsoft.AspNet.WebHooks.Receivers.Bitbucket
That's the Microsoft package. There's a sample on GitHub[^], but it doesn't seem to have a lot of documentation. There's a link to instructions for setting up the Bitbucket end[^], but not much else.
The documentation[^] looks like a good place to start, as do the various blog posts linked from the project "readme" page.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
NB: The Bitbucket sample does say:
Quote: For security reasons the WebHook URI must be an https URI and contain a 'code' query parameter with the same value as configured in the MS_WebHookReceiverSecret_Bitbucket application setting. The 'code' parameter must be between 32 and 128 characters long.
If you're trying to debug this locally, you probably haven't got a valid certificate and a public https URI.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have looked at the documentation and I don't see anything that says how to get the website to respond when the webhook comes in. I published the app into a website I created, but I have no idea if that makes it work or not. It seems like I should need to register a service somewhere, but I don't know how or where. The process as I got it from NuGet doesn't make an exe - just dlls. I am not sure what to do with them. That is where the documentation is lacking.
As far as using Bitbucket goes - I used the code as an example. The request I am wanting to receive is not from Bitbucket. I removed the security code out of the config file and have the website set up to not use SSL (at least while trying to get this to work). I was thinking (probably incorrectly) that the NuGet is just a shell for receiving a request and that I can tweak it to be more generic and work with my request. I couldn't find a clear example of how to do it generically.
FWIW - here is the link to the tutorial I started with https://www.youtube.com/watch?v=gbr-wZVl6d4
|
|
|
|
|
cotsjdixon wrote: It seems like I should need to register a service somewhere, but I don't know how or where.
That sounds right to me. As I said, the Bitbucket sample has a link that explains how to register your webhook with Bitbucket[^]; there will presumably be something similar for whatever site you're using.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I guess I am not expressing myself properly. In the bitbucket documentation one of the steps is "6.Enter the URL to the application or server". This is saying that Bitbucket is sending the request somewhere, which should be my "application or server". I am using JIRA instead of Bitbucket to send the hook request out, and as I said I can see that it does get triggered when I have the URL set to RequestBin. However, what I am not understanding is how I get my "application or sever" configured to receive the message coming from the Bitbucket (or JIRA) trigger/request. So registering it with Bitbucket isn't my problem, it is how I get my server or application to receive so I can then do what I need to with it?
|
|
|
|
|
ASP.NET WebHooks receivers | Microsoft Docs[^]
ASP.NET WebHooks handlers | Microsoft Docs[^]
It sounds like some senders are more complicated, but the basic principal is that the sender makes a request to the URI on your server, which is mapped to an action on a WebHooks controller. That controller then validates the request, and passes it through to your custom handlers. Your custom handlers can then do whatever they need to do.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have started over using the Custom Webhook asp.net receivers but I am still having issues. How do I get the webhooks to run in http not https (no SSL)? All the examples I see say you should use security but they don't say you must use security. Right now the application I am trying to send the hook from is getting errors back saying it must be SSL but the application doesn't use SSL. I have my website set up through IIS to not have SSL turned on, but the application sending the hooks always gives the SSL errors. It worked fine sending the unsecured hook to RequestBin, but it always gets errors trying to get to my unsecured site. I have removed the application key to keep from having to use secrets.
How do I turn off the SSL for the hook receiver?
|
|
|
|
|
According to this page[^], "almost all WebHook providers required that URI should be public and with SSL support".
If you're getting an error message telling you that the provider requires SSL, then I'd be inclined to believe it.
For internal sites, you might be able to use a self-signed certificate. Otherwise, see if you can get a free certificate from Let's Encrypt[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It is our website that I am putting the receiver on, not someone else's. I have one site within the server that is SSL, but the site I created I have SSL turned off. Can I have one site secure and one site unsecure on the same server? I would have thought that if I have not turned on SSL it would not ask for it from the sender.
|
|
|
|
|
As I said, according to the documentation, most senders require SSL for security.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello All,
It is my first time that am posting a question here.
I have research a lot on the web on how to upload excel sheet (.xlxs) to sql server 2012 database through asp.net and vb.net, however, unfortunately all those research was of no use.
can someone please help me with the source code.
thanks.
|
|
|
|
|
If your research was of no use what makes you think anything we say here will be of use to you?
We are not a code-writing service.
This article should get you started - Upload and Download Files with SQL Server in ASP.NET[^]
If you have a specific question after trying this by all means come back with the code you are having a problem with
|
|
|
|
|
|
Use fileupload control and on submit button call below function and save the data in db in binary format.
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As EventArgs)
' Read the file and convert it to Byte Array
Dim filePath As String = FileUpload1.PostedFile.FileName
Dim filename As String = Path.GetFileName(filePath)
Dim ext As String = Path.GetExtension(filename)
Dim contenttype As String = String.Empty
'Set the contenttype based on File Extension
Select Case ext
Case ".doc"
contenttype = "application/vnd.ms-word"
Exit Select
Case ".docx"
contenttype = "application/vnd.ms-word"
Exit Select
Case ".xls"
contenttype = "application/vnd.ms-excel"
Exit Select
Case ".xlsx"
contenttype = "application/vnd.ms-excel"
Exit Select
Case ".jpg"
contenttype = "image/jpg"
Exit Select
Case ".png"
contenttype = "image/png"
Exit Select
Case ".gif"
contenttype = "image/gif"
Exit Select
Case ".pdf"
contenttype = "application/pdf"
Exit Select
End Select
If contenttype <> String.Empty Then
Dim fs As Stream = FileUpload1.PostedFile.InputStream
Dim br As New BinaryReader(fs)
Dim bytes As Byte() = br.ReadBytes(fs.Length)
'insert the file into database
Dim strQuery As String = "insert into tblFiles" _
& "(Name, ContentType, Data)" _
& " values (@Name, @ContentType, @Data)"
Dim cmd As New SqlCommand(strQuery)
cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = filename
cmd.Parameters.Add("@ContentType", SqlDbType.VarChar).Value _
= contenttype
cmd.Parameters.Add("@Data", SqlDbType.Binary).Value = bytes
InsertUpdateData(cmd)
lblMessage.ForeColor = System.Drawing.Color.Green
lblMessage.Text = "File Uploaded Successfully"
Else
lblMessage.ForeColor = System.Drawing.Color.Red
lblMessage.Text = "File format not recognised." _
& " Upload Image/Word/PDF/Excel formats"
End If
End Sub
|
|
|
|
|
Hi, I am new in angularJS web development. Could anyone please help me to create sample application -
I have two relational table 'Employee' and 'Department'. I need to create GridView in angularJS which reads data from Model and data can be edited inline and on save button model will be updated.
basically requirement is Inline edit/update/delete of grid using angularJS.
edited row also contains dropdown for 'Department'.
|
|
|
|
|
If you're using Angular for Databinding, then use Angular to handle the data from request-level to render and back again. That means that you're providing your model via AJAX, binding with Angular templates, and updating via AJAX.
When you start mixing server and client concerns you end up developing tight coupling between your presentation and business layers.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I need to save HTML formatted data in SQL server probably with HTML editor but I am confused how to achieve. Could anyone please suggest appropriate approach?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Choose your editor - two popular options are:
Most editors will come with examples to get you started.
Basically, you render a <textarea> (TextAreaExtensions.TextAreaFor[^]) which contains the HTML, and a script to display the editor. When the form is posted, the edited HTML will be submitted in the <textarea> , in exactly the same way as any other field.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi. I am using MVC 5 with VB. I have an image with the code as shown below. I want to be able to click on the image and it should take me to the respective View. I want to use JQUERY to do this but I am open to an alternative way too.
<tr>
<td style="width:100%;text-align:center;padding-top:32px;padding-bottom:20px" colspan="2">
<img id="imagename" style="border:2px solid #396f96;width:48px;height:48px" class="tooltip1" title="Test title" src="@Url.Action(".... />
</td>
</tr>
modified 29-Mar-17 3:07am.
|
|
|
|
|
Simplest is
<img src=" ... " onclick="window.location.href='@Url.Action("Index", "Home")'" />
using jQuery you could do something like this
<img src=" ... " data-url="@Url.Action("Index", "Home")" />
$(document).ready(function () {
$('[data-url]').click(function () {
window.location.href = $(this).data('url');
});
});
However there's a little known secret about the web and that is that it worked a decade before javascript was invented. In fact linking things together was it's primary goal and without there being javascript, never mind third-party frameworks like jQuery, they came up with the novel way of doing it I'm going to show you now
<a href="@Url.Action("Index", "Home")"><img src=" ... " /></a>
This has numerous advantages, such as the user knows the target of the link when they hover, it allows search engines to build a map of your site, it allows screen readers to properly work. Yes! The internet works without javascript, don't tell anyone now
|
|
|
|
|
Thank you. I used the last method and it worked great.
|
|
|
|
|
Hi,
I am new to ASP.NET MVC. I would like to get some help on getting custom data from controller to view.
I have queried and concatenated the result of a table from model based on a criteria. I want this to be viewed as a partial view in the Index page. For this, I pass the queried result as follows
[CODE]return PartialView(rds.ToList())[/CODE]
The purpose is to display a listview of these items in the Index view as partial. I don't know how to grab this data from the partial view. Please help.
Thanks
|
|
|
|
|
Just give your partial view a @model of whatever type "tds.ToList()" is
@model List<RDS>
or whatever it happens to be, then in your view
foreach (var item in Model)
{
<p>@item.SomeProperty</p>
}
|
|
|
|
|
I have been doing some testing between VS2015 and VS2017. I created a .NetFrameworkApp and a .NetCoreApp website in both systems. I then installed a couple of packages in all four websites; in particular EntitytFramework. It installed in both VS2015 websites and the VS2017 .NetFrameworkApp website without problem but it wouldn't install in the VS2017 .NETCoreApp website. I got the following error messages.
- net45 (.NETFramework,Version=v4.5)
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Package restore failed. Rolling back package changes for 'RLSBCWebSite_NC'.
Time Elapsed: 00:00:01.4470850
Error Package restore failed. Rolling back package changes for 'RLSBCWebSite_NC'. 0 Anyone any idea why that should be. I am assuming it should install otherwise how would you use CodeFirst etc.
|
|
|
|
|
For a .NET Core application, I suspect you'll need to use Entity Framework Core[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|