What I have is a table that holds 3 input elements, They represent order, name, value. The user can add a new row of 3 inputs to add as many of these sets of data as they want.
To accomplish the dynamically adding in of inputs I use jquery's clone method. That works fine and I am able to iterate through each and grab the values, however the real pain I am having is that when the user has entered in all of the data I want to pass that data to an asp.net page through jQuery's post method. How do I go about passing an array of strings so that I send this format to the asp.net page, and when I've done that how do i parse the data on the asp.net side of it.
Desired Data Format:
["Name|Link|Order", "Name|Link|Order", "Name|Link|Order"]
jquery Code so far:
$("#saveBtn").click(function (e) {
e.preventDefault();
$("#addPanel").slideUp(300);
//Perform Save Operation
var saveString = "";
$("#addTable tbody>tr").each(function () {
var o = $(this).find(".hsaorder").val();
var n = $(this).find(".hsaname").val();
var l = $(this).find(".hsalink").val();
saveString += n + "|" + l + "|" + o ;
});
////// Create Array here or some other method?
$.post("/modules/H/Modify.aspx", { OBVIOUSLY SOMETHING GOES HERE});
// Remove all but top table element to return to original state
$("#addTable tbody>tr").not("#addTable tbody>tr:first").remove();
});
I'm trying to do a post with jQuery in an MVC application, according to this SO answer here:Can jQuery do a POST of a ViewModel to a Controller in ASP.NET MVC?The difference is I am using it to delete an item in a dynamic view (never mind the fact that I'm posting a delete directly, this is a closed site by authorization, and I will use jQuery to confirm, I just don't want the user to have to go to a new page). And I therefore need to be able to send both the id and the ViewModel (the ViewModel to save any added items before deleting any). I'm not particularly happy with the solution by and large, but at this point I just need to get it to work!So I tried to figure out how to send both the id and the ViewModel according to the SO post above, but I can't figure out how to get the ViewModel in with the named parameters. This doesn't work:
I have create a web page having dynamically created text boxes if i select value in dropdown list,text boxes auto generates .but i want to save all text box values in SQL server database after clicking on submit button using ajax/JSON request
So, I've got an array, filled with data from dynamic input fields. the input fields are PIN, Name and Description... and the user can add as many "sets" of these three fields as they want.
This data goes into an array.
For example, the array may have 11111, Test Name, Test Company 22222, Second Name, Second Company
etc. etc.
I know I can see the values of my array, so if I were to take: item(0) & ", " & item(1) & ", " & item(2)
my output would be: 11111, Test Name, Test Company
The problem I'm having, is, I need to write ALL of the groupings of three out to a file... and I'm stuck on how to do that. So, I need a way to loop through until the end of the array and get:
I now have two asp.net pages. When I click on a link on page A, I open the other one (let's call it page B). When I do this, I want to send some information from Page A to Page B in the form of an array of strings. This array is different depending on what link I follow on Page A.
I know I could send this information via the URL with the ?string1=bla1&string2=bla2 etc., but I don't want it that way, as it can get complicated if there are too many strings in the array.
I think there is something similar, like a POST in PHP, but how would that be in ASP?
I want to read all the strings from a resx file and load it into an array without looping. I'm working in an asp.net web application and i'm using C#. How can i get the strings?
The problem is: How should I do this? I've search several hours on the internet but can't find anything about how to split strings from a datareader to several different arrays.
I am currently using a number of query string parameters to pass some data from one page to a second page (the parameters hold confirmation/error messages to display in the second page), that due to a third party product can no longer work correctly in the production environment. The user completes an action on the first page, and is then transferred to the second page. What are the possible alternatives to use instead of a query string and GET - session variables, POST data, or something completely different?
I was wondering if anyone knew how to get post data as an array in ASP.NET c#. The reason being is that I have a dynamic form with form fields generated and named based upon what it finds in the database and therefore do not know the form fields being submitted, only their prefix.
I have a page with list box and user can select multiple values from that lst box. Now what I want to do is when user submits the page I want to generate a comma seprated string that contins the ID's of values selected and pass this string to stored procedure. String would look like something like that '2,5,9'
Now my question is how can I split these ids in my stored procedure and get the records based on these ID's. In want to pass this array to Source coloumn in the follwoing Stored procedure and get the data. Right now following stored procedure is working on the basis of single source id passed to it.
The first and Main problem is that i do not know the way of passing my values to the source:
By saying that i mean, supposing i have a a server-side ASP.NET function GetTheResults as listof(string) or GetTheResults as string ()
how am i supposed to pass those values as source required by the auto-complete?
The second problem is that the specific way does not use AJAX. Which means i guess on the load of the form i will load all the available values to the source. Isn't that an overkill?
the texts in the spans (say a and b) are concatenated together (to ab), and thats almost what i want But now i want to concatenate them by inserting a hyphen (-) in between (to a - b) I've tried this, but that doesn't work:
Is there a control that you can use? It can be done by fetching a binaryread from an aspx page but why there isn't a simple free image control that you can put in the page and feed it a byte array?
I have an array which contains around 50-200 hyperlinks. How can I pass this array to the client-side so that I can iterate through the array and display each hyperlinks as a list item? The array will be stored in 'Application' as it's system wide and rarely changes. Could there be a more efficient way of achieving the hyperlinks as a list?