I UPDATED the code with code behind. I'm doing something dynamic with the label contrtol.
I have the following jQuery code working as it is (passing the value of 'test") but what I want to do is to pass the value of the label control (lblNames). I'm using the label control to collect the uploaded file names. Is there a way?
I have the following jQuery event that gets fired every time an anchor is clicked. How can I pass a asp.net control (lets say a panel called "pnl_info") as one of the parameters, in addition to the "target" parameter i'm already passing?
In a repeater control there is TextBox and corresponding to each TextBox there is Button control.On click of Button how can i pass TextBox's text that user has just entered ?
Below is the code:
[Code]....
Means on click of each Button how to pass there respective TextBox's data to a javascript function ?
I have a server control that performs some logic. I'd love to provide a default implementation of this logic in the code of the control, but allow a developer to pass an alternate implementation of this logic in as a delegate, if they wish.
I have some code which i know works. I use jquery json to call a web method on aspx page, which returns data i use to populate a dropdownlist. Now, i have put this functionality into a server control including the webmethod. Now im not sure how i can call this webmethod from json. Is this possible to do or will i have to create a web service somewhere?
and on change of this dropdownlist i check if the its text equal to a string i show the 2 tr as below
function ValidateCity() { if ($('#<%= citiesDropDownList.ClientID %> :selected').text() == identity_CityOther) { $('#<%= otherCityTR.ClientID %>').show(); $('#<%= areasTR.ClientID %>').show(); } var city = $('#<%= citiesDropDownList.ClientID %>').val(); return IsValid((city.length != 0), '#<%= cityDiv.ClientID %>', identity_CityRequired); }
.show() isn't work at all and i don't the reason .. can any lead me to get the problem?
FYI : I tried $('#<%= otherCityTR.ClientID %>').show('slow'); and also $('#<%= otherCityTR.ClientID %>').css('visibility', 'visible'); but it doesn't work also.
I am currently working with ASP.NET and the person who designed the form has used all Server Controls for things like TextBoxes and Dropdowns etc when really they are not providing postbacks.. Some of the dropdowns and textboxes are values that I need only in jQuery so as far as I can see there are no drawbacks to coverting these controls to standard html controls rather than ASP.NET server controls?
I suppose I will need to continue to have my GetDataGrid button as a server control because I will need it to postback (and receive PageLoad events etc - all asp.net events) to update the GridView? Or would it be possible to use the GridView (server control) from a Webmethod and call it via Jquery?
Of course in my webmethod I would need to the instance of the gridview to add the datasource - but I don't see how this would be possible without being in the ASP.NET events - or maybe I wrong?
The other thing I thought of was changing the GetGridView button to a standard HTML and calling the javascript postback from the client click event?? This way it would do a real postback and I would end up in Page_load.
Taking everything into effect i don't want to the change the GridView asp.net control as it funcions well as an asp.net server control but i am unsure how i would do this.
I remember a document being available that said "how to use asp.net webforms without server controls" but i can't seem to find it. I suppose using webforms like asp.net MVC - but i can't change the project to MVC - its out of my control.
I emebeded jquery library in custom server control. but it's not working. it throws "object expected error". the complete code listing is given below.
jquery-1.4.1.js is rename it to jquery.js
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;.........
I am developing an ASP.NET server control that uses jQuery for some client side logic. I have embedded the jQuery file as a resource inside the control. don't want to restrict the application using the control to that specific version of jQuery and I want to keep using the version of jQuery that I have embedded.I know about the noconflict method but the problem that i see with that is that i have no control over the order of the script tags on the pag
I've created a bunch of asp:hiddenfields dynamically at runtime in an asp.net page.
My question is this:
How do I find those hidden fields?
I have an event attached to a control that fires a javascript function, and that's where I am attempting to use JQuery to find the hidden field associated with that control.
I have a custom control that I have created. I want to be able to pass in a Javascript snippet for a callback function. I am able to do this by passing a string back. The problem is that in the Javascript, I need to reference another server control that is not related to my custom control. So, I need to be able to pass in the ClientID of that control for use in the Javascript. Here is a snippet of what I am trying to do:
[Code]....
Now, I realize that '<%= chkStartDate.ClientID %>' will not be parsed. But, I need it to be parsed so the OnClientOnChangeEvent property of my custom control can take any Javascript for use as a callback. In this instance, I need to pass in the ClientID of the control for the Javascript function to find the control to work with; and this seems to be the one issue that I don't know how to handle.
I am developing a web application for online bidding wher I want the BID button to disable itself, on all clients, whenever someone places a bid. What I need is some javascript to ping the site to check if a bid has been placed on the server, if so, then disable the button. I was suggested to use jQuery for this, use .ajax to query the server for the check. Then use a setTimeout javascript function to keep checking.I am not javascript expert at all so any tips would be greatly appreciated. At lease where to start. Also, will I need to record every single bid in database to achieve above?
At first, I should confess that I am not sure if it is a good practice or not. I have came out with the idea due to my practice of jQuery.ajax().
What I want to achieve is depended on this design:
//Server Side; an .asmx file contains a method like this: [WebMethod] public string NewContent(string parameter) { string renderedHTML = string.Empty(); switch(parameter) { case ("person"): // create an asp.net panel with // some controls in it that has form elements to enter person data // render control and assign its html to renderedHTML break; case ("department"): // create an asp.net panel with // some controls in it that has form elements to enter department data // render control and assign its html to renderedHTML break; } }
And from the client I want to do this:
// Some html in the page <script type="text/JavaScript"> jQuery.post('ajax/myWebServices.asmx/NewContent' function(returnedPanelContent) { $('.result').html(returnedPanelContent); }); </script>
Question is:
How can I make it work? Briefly to have a webservice method that returns different asp.net Panel control content created programmatically so that I can get this control rendered as HTML in my client-side and insert it to my web page?
have a page that use JQuery to get markup of user control from a web services. it is successfully giving me what i want the markup etc.Jquery Code:
[Code]....
------------------
You can see that user control have a button that have a click event handler. i want this button to trigger on click. but when i click on this button i found server error "The state information is invalid for this page and might be corrupted."i can imagine what is going on viewstate is not valid for form for obivious reason......how can i fix this problem or update viewstate.
Iam trying to pass data from my controller, and put it into the variable in JS script. I have done it before and it worked perfectly, thats why this one puzzles me even more.
Here is my code of the controller:
[Code]....
In chrome I also get an error "Uncaught SyntaxError: Unexpected token ILLEGAL". I am pretty sure it is the same I use for my other project and that one works just great so I really dont know what is wrong.
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: