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?
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
[System.Web.Script.Services.ScriptService] public class Quotes : System.Web.Services.WebService { ebMethod] public void Calculate(int param1, int? param2)
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?
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]....
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.
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.
'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
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.
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?
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.
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.
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(?)
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: