webmethod

Save data to DB using JQuery ajax on button click

帅比萌擦擦* 提交于 2019-12-12 03:57:41
问题 Here is my Jquery ajax method: $(document).ready(function () { $("input[id$='btnBulten']").click(function () { //alert("dd"); $.ajax({ type: "POST", url: "http://URL/Controls/EBulten.ascx/EBultenSend", contentType: "application/json; charset=utf-8", data: "{nameSurname:" + $("input['id$='$txtNameSurname']").val() + " }", dataType: "json", success: function (msg) { alert("Mesajınız başarıyla iletildi"); } }); }); }); and in codebehind code: [WebMethod()] public static void EBultenSend(string

Ajax call results in 500 Internal Server Error

◇◆丶佛笑我妖孽 提交于 2019-12-12 02:05:44
问题 I have read similar posts and Modified according to them ..still not able to fix this error on My Page .. On Debug ..In FireBug there is no other error shown in Console ..Just this Error 500 Internal Server Error ....parameters Name in method is also same this is my ajax method : function getErrorStatusList() { var serve = new Object(); serve.issueID = $("#proselct option:selected").val(); $.ajax({ type: "POST", url: "UFZillaErrorStatus.aspx/GetErrorStatusList", data: JSON.stringify(serve),

JSON Limited to 1180 Characters

你说的曾经没有我的故事 提交于 2019-12-12 01:41:51
问题 I have a simple JavaScript JSON request which stringify's an object to send via a JSON request to my C# Web server. Whenever the string returned by stringy is over 1180 characters, the WebMethod is not called on the server. From my understanding, there is no limit on how much string data the client can send via JSON. I understand that the limitation is on the server end, trying to accept the paramaterized request. Is there somewhere in the web.config that I can increase this limit of 1180? My

Getting Values of a JSON Object using webmeothd in vb.net

China☆狼群 提交于 2019-12-12 01:28:48
问题 I got stuck while getting value of a JSON object in vb.net. My JSON request posts data like given below: function submitEmail() { var ClientsPersonalInfo = { FullName: $("#FullName").val(), PhoneNumber: $("#PhoneNumber").val(), EmailAddress: $("#EmailAddress").val(), DOB: $("#DOB").val(), Occupation: $("#Occupation").val(), NINumber: $("#NINumber").val(), FullAddress: $("#FullAddress").val() } var ClientsData = {}; ClientsData.ClientsPersonalInfo = ClientsPersonalInfo; var d = '{"ClientsData"

C# - Accessing a DBF file in a Stream

筅森魡賤 提交于 2019-12-12 01:07:29
问题 I have a WebMethod which I use to allow a user to upload a database file (*.DBF). I know I can access the *.DBF file using a OleDbConnection with the appropriate connection string. But I dont really want to save the file on the server, my WebMethod has the file contents in a stream. Is there anyway I can access the *.DBF file while it is in the stream ? 来源: https://stackoverflow.com/questions/14810147/c-sharp-accessing-a-dbf-file-in-a-stream

Send JSON with Ajax to ASP.NET Web Method

北城余情 提交于 2019-12-11 18:59:17
问题 This is first time I am attempting to send data to server using Ajax. I followed lot of answers from here but I won't just stop getting the error : "Message":"Invalid web service call, missing value for parameter: \u0027Products\u0027." I followed this and this but still the same. Can someone please tell me where I am going wrong. var products = [ { ProductId : 1, ProductName : "Mercedes", Category : "Cars", Price : 25000 }, { ProductId : 2, ProductName : "Otobi", Category : "Furniture",

Ajax return multiple values

左心房为你撑大大i 提交于 2019-12-11 18:29:17
问题 I'm trying to return multiple values as shown below but one value is only returning on success. This is what I'm trying to do : <script type="text/javascript"> $(document).ready(function () { $("#getdetails").click(function () { $.ajax({ type: "POST", url: "Default.aspx/Gettext", data: JSON.stringify({ SampleText: $('#sampletext').val(), FontType: $('#fonttype').val()}), contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { $("#Result").text(msg.d); } });

Return a single string value from a WebMethod in C#

≯℡__Kan透↙ 提交于 2019-12-11 17:59:44
问题 I want to return just messageID but it doesn't work correctly. How can I return a single string value? [WebMethod] public string messageComeGetID(string from, string to) { try { sqlConn.Open(); } catch (Exception e) { return null; } // select messageID from tblMessage where [from] = '2' AND [to] = '4' gibi. SqlCommand cmd3 = new SqlCommand("select messageID from tblMessage where [from]=@from AND [to]=@to", sqlConn); cmd3.Parameters.AddWithValue("@from", from); cmd3.Parameters.AddWithValue("

in asp.net WebService, passing a WebControl to a WebMethod

房东的猫 提交于 2019-12-11 15:23:18
问题 I'm using asp.net 4 ,C# ,VS 2010. I'm facing a problem by calling a web service method which has a WebControl as a parameter. /// <summary> /// Summary description for FormsViews /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class FormViews : System.Web.Services.WebService { [WebMethod] public void SetCaption(System.Web.UI.WebControls.Button bt) { //Code... } } It

Determining url for Ajax WebMethod (in Sitefinity)

走远了吗. 提交于 2019-12-11 13:34:25
问题 I'm trying to figure out how to determine what the baseUrl should be for this ajax webmethod POST. According to this Sitefinity thread, the baseUrl is the path to the Sitefinity project folder. In my case, the path should something along the lines of: "C:\inetpub\Website\Public" but this path is not in the same format as "MyWebForm.aspx/WebMethod" This seems like a simple problem but before I go testing this out, I want to make sure I'm doing the right thing. I'd appreciate any suggestions