How To Pass Parameter Back From Web Service If An Insert To A Database Successfull

Oct 29, 2010

I have a web form and I use jQuery/AJAX/JASON to send objects to a web service using

$.ajax({
type: "POST",
url: "SynchroniseCustomers.asmx/synchroniseCustomers",
data: JSON.stringify(customerObj),
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (xhr, status) {},
success: function (msg) {}
});

From the web service I want to check if the insert into the database was successfull, return a variable with an ID and pass this ID to a function. In the object I have the ID so I could have

success: function (msg) {deleteCustomer(ID);}

But this only checks if the data was passed to my method in the web service? I have followed this example http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/ and in the class Person I get a message back from the database server telling me if the insert was successfull or not so like

if (successfull)
{
return ID;
}

is there a way to get this ID back to the web form and use this in a variable?

View 1 Replies


Similar Messages:

DataSource Controls :: Pass In As An Insert Parameter For SQLds2 The Scope_identity Of The Insert Of SQLds1

Jan 12, 2010

I am trying to pass in as an insert parameter for SQLds2 the scope_identity of the insert of SQLds1.

Exception Details: System.InvalidOperationException: Error executing 'InsertCommand' in SqlDataSource 'SqlDataSource1'. Ensure the command accepts the following parameters: @Name1, @NewId

[Code]....

View 4 Replies

How To Pass Null To A Nullable Parameter Of A .NET Web Service Method Via Javascript

Aug 24, 2010

[System.Web.Script.Services.ScriptService]
public class Quotes : System.Web.Services.WebService
{
ebMethod]
public void Calculate(int param1, int? param2)

View 2 Replies

MVC :: Pass Parameter From Controller To View And Back To Another Controller?

Aug 16, 2010

I have a simple model where a Person has Gifts. I have a view which is a list of Gifts belonging to one Person.

My problem is with the Create action for a new Gift. I want it to default to the PersonID that we are already viewing the list of Gifts for. I tried simply passing the last PersonID (they are all the same)

Html.ActionLink("Create New", "Create", new { id = Model.Last().PersonID }) which works fine if there is already at least one Gift for that person but if this is the first Gift I don't have a value.

My Gift List controller knows the PersonID I want to pass but the view doesn't.

How do I pass this PersonID from my Gift List controller to my Gift Create controller via the Gift List view? Or is there a better way to do this?

View 2 Replies

Display Database Values In Textboxes And Pass Parameter In Response.redirect?

Sep 9, 2010

I have a datbase with userid,username and password.

I Need to display database values in textboxes say for eg(Name and password) and redirect to login page based on the UserID.

View 7 Replies

WCF / ASMX :: Insert Data From A Web Service Into An SQL Database?

Nov 28, 2010

[Code]....

WEB SERVICE

[Code]....

Insert data from a web service into an SQL database?

View 5 Replies

Forms Data Controls :: Insert Radio Button Selection  into Sql Server Database  using Parameter?

Nov 7, 2010

how to insert radio button selection into sql server database using parameter.

View 3 Replies

Unable To Pass User Credentials From WCF Web Service To ASMX Web Service

May 25, 2010

My WCF Client calls my WCF Service which then calls ASMX Web Service. The problem is i have configured my wcf client and wcf service to windows credentials type but when wcf service calls asmx service the user credentials (default windowsidentity) is not passed to asmx service.

In WCF Service i am able to get user identity by using : Thread.CurrentPrincipal.Identity.Name;
WCF Service - i have disabled anonymous access and enabled windows authentication. ASMX Web Service - i have disabled anonymous access and enabled windows authentication.
WCF Service Config
[Code]....

View 1 Replies

Cancel A Long Running Database Insert / Update Operation From UI When Operation Is Being Performed By A Windows Service?

Mar 7, 2010

in my case, It is the windows service which in running the long running insert/update on a table and I need to cancel the operation from my ASP.NET application. In the above link Burnsys suggests that one should kill the Sql server session. Is that really only way and a goood practice to do this? Also, in the same poset can use SqlCommand.Cancel to cancel. However, I am not sure how can I cancel the command from the windows service from ASP.NET application.

View 1 Replies

.net - Username Parameter Coming Back With More Than Gave It?

Mar 15, 2011

This is really weird - I've got a MVC app running, including a Login method in my ServicesController class:

public ActionResult Login() {
var p = Request.Params;
var userName = p["username"];
var password = p["password"];
// etc...
}

View 1 Replies

How Can Pass Parameter In C#

Feb 9, 2010

[Code]....

View 3 Replies

C# - How To Pass Parameter In CSS

Feb 1, 2011

i have a grid with an image column, i want to change images based on data source. if data field for a row is 2 then image will be *.gif and if it is 3 then will be different so it is not fixed that which type of images we will have so i want to do "if..else" on css because in that case we can easily change images on css. i don't want code on code behind file.

View 2 Replies

How To Pass A Url As A Parameter

Apr 3, 2010

'm constructing a url which in itself has a url, and both are parameterised.E.g. string postUrl = "target_page.aspx?url=post_page.aspx?p1=9&p1=9&post_type=1he url and parameters in bold are the inner url so when i refer to querystring parameter 'url' I want it to bring backurl=post_page.aspx?p1=9&p1=9 and not url=post_page.aspx.hat should I encode and to ensure this comes out correctly

View 1 Replies

Can Pass Parameter In Tag's Src

Mar 26, 2011

i want to pass parameter in image tag's src.

i send an image in email, for email tracking but i want to pass parameter in image tag's src.

message.Body = "<img src='http://test.com/test1.aspx?imageID=defaultimg.jpg&custID= + System.DateTime.Now + &campID='32434'/>";

View 7 Replies

User Controls :: How To Go Back To Previous Page With Parameter

Apr 27, 2016

i'm a beginner in asp.net  and c# , i have a question :i have 2 pages :

1- localhost:12345/show_profile.aspx?id=35 

1- localhost:12345/Edit_profile.aspx ( with save button )

i try to redirect 2nd page with parameter (?id=35 ) after button clicked with Delay 3 sec .i can assign the url to var with url.Ref function ,  and call it but with out delay.

View 1 Replies

Php - Pass Dynamic Value Via Parameter?

Feb 2, 2011

I am using this plugin [URL] I am using this code:

var uploader = new qq.FileUploader({
// pass the dom node (ex. $(selector)[0] for jQuery users)
element: document.getElementById('file-uploader'),
// path to server-side upload script
action: '/server/upload',
params: {item1:$('#txtName').val() }
});

Now when the request is made to server always the blank value goes to server instead of what the actual value is (I changed the value of textbox after the page has been loaded). I think the first default value of textbox is passed in this case. My question how can I pass the dynamic value of textbox to server?

View 2 Replies

How To Pass Parameter To Javascript

Mar 20, 2010

I need to pass an url from asp.net load_page to flowplayer javascript function here:[URL]

View 2 Replies

C# - How To Pass In A Method Name As A Parameter

Dec 10, 2010

I've just noticed I'm repeating a lot of C# code in my ASP.NET application so want to create a generic method. I have a series of private methods like this:

[Code]....

So, I want to replace DB.MyRepeatedCall, chtMyRepeatedChart and pass them in as parameters to a generic function. Is that possible? I have many charts on my form that take the same number of parameters.

UPDATE

Following Frederik's solution I have done this:

[Code]....

I am calling the function with this command:

PopulateControl (chtEquityCurve, DB.GetAccountBalances());

I get this error in the intellisense:

No overload for method 'GetAccountBalances' takes 0 arguments.

View 4 Replies

How To Pass Dropdownlist As Parameter

Feb 13, 2010

i wants to pass table, two fields and dropdownlist as parameter to

to construct a user defined function in class module, to retrive keycode,keyname from a table

iam wokring in csharp code

View 5 Replies

MVC :: How To Pass Url Id Parameter To Javascript

Mar 11, 2011

how to pass an id parameter to jquery. For instance I have a url: http://localhost:52271/News/Index/1 What I want is id parameter which is 1, in the above url. and I need to pass that id to the script like var = url where url should be the parameter which in this case 1.

View 1 Replies

MVC :: Pass ID Parameter To Other Views?

Sep 16, 2010

I took the MVC 2 template that comes with VS2010 and modified it to my needs.

There are now 5 different tabs in the menu, I've implemented models and controllers and that works.

But actually, the entire site should show data based on and ID (it pulls data from a webservice).

For example account info for id=1: http://localhost:49925/AccountInfo/details/1

This is always the URL where one enters the site (page will be linked to from another site, so the ID will be passed from there) So how can I pass the ID to the other Views (let's say I also have a 'Contact' tab: http://localhost:49925/ContactInfo/details/1 ) I've solved it now by storing the ID as public property, so I can retrieve it in other Controller classes, but I think there must be a better way to do this..

Also I would like to have a title in the header of the master page that shows the current account (e.g. "Showing data for account FooBar"), how can I set this from the AccountInfo controller/model(?)

View 8 Replies

C# - Declaring Parameter That Don't Want To Pass?

Jul 14, 2010

public Jquery Extra(this HtmlHelper htmlhelper,
string message,
IDictionary<string, object> htmlAttributes)

if i declare the this Htmlhelper htmlhelper when i declare my method, but i don't want to pass that parameter in when i call the method?

View 3 Replies

How To Pass More Than One Parameter In Querystring

May 7, 2015

I have one hyperlink I want to pass more than one parameter in hyperlink

but cant pass perfect data in query string 

using database.

same data pass in another page using this code.

<asp:HyperLinkField DataNavigateUrlFields="Product_Id" Target="_blank" DataNavigateUrlFormatString="AddprodPhoto.aspx?Product_Id={0}&Catalog_Id={0}" Text="Upload">
o/p

[URL] ....

product_id pass right Catalog_Id=2 is wrong

View 1 Replies

Web Forms :: How To Back To The Real Redirect Previous Page With The Same Parameter

Jan 14, 2010

I use button " text=Back" and in the code i write the ...

Response.Redirect("show_pro.aspx");

and this page "show_pro.aspx" is linked with tow pages send value in manner "Get"

ex:
show_pro.aspx?id={0}
show_pro.aspx?pic={0}
the question :

How can i back to the real redirect previous page with the same parameter send when i click button ' back '?

what can i write instead of this code ....... Response.Redirect("show_pro.aspx"); ??

note : i use c# coding

View 12 Replies

MVC :: Pass Data Back To The Controller?

Jan 13, 2011

This may seem simple to a seasoned coder, but I'm all wet-eared and new to MVC, and trying to wrap my head around it is driving me nuts. I have completed the Nerd Dinner and MVC Music Store tutorials, and seem to be grasping the basics... Well, sort of... It just seems that every new idea I have requires hours of searching with Google.

As it stands at the moment, I have a static DateTime field that is populated by using DateTime.Now. What I need to implement is a master TextBox (JQueryUI DatePicker) at the top of the View that will enable the user to overwrite said DateTime.Now if required.

Here is a hypothetical situation:

Controller

[Code]....

Site.Master

[Code]....

View

[Code]....

I thought of using a variable to override the default date if the user selects a master date, but can't figure out how to implement it.

I can get it to work if I use a static string, like so:

[Code]....

Is there any way to pass the value of the master datepicker (txtDateTime) from the View back to the Controller? I've heard mention of TempData, but can't seem to find a similar scenario.

I'm sure I'm just missing something really obvious, so if anyone could explain it to me really s-l-o-w-l-y, that would be cool.

I'm praying that this isn't another of those situations where "MVC doesn't work that way" or "It needs more cowbell", 'cause then I'll pack it all in and go play WoW D:

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved