(I think) with using a data bound Custom Control on the server to get hold of my data (it will be part of a larger dataset) and to ultimately pass updates to the database. The bit I'm researching at the moment is passing that data to and from the client.One way to pass the data to the client is to use JSON within the Pageload event to construct a set of Javascript objects (one per row in the data). Is that the best way, or am I missing something?
Then, after the data has been manipulated on the client, I need to pass the rows back again so that the server side code can pick them up and process the updates. I've seen a suggestion on here that a hidden text field is one way to do that. Is it the best?Neither of my approaches seem to be at all elegant - and I suspect that I am missing something fundamental in ASP .NET AJAX!
I'm dynamically binding tables and sub tables using nested listviews. On the client side I have a piece of jQuery that is toggling the visiblity of TRs witin the tables in order to provide a group expand / contract view option.
On postback I'm obviously loosing my class changes that I have applied via jQuery. I'm wondering what the best approach to maintaining these client side class changes is? I've considered creating a hidden input control per table to store the indexes of the visible TRs at the time of expanding them. The intention being to then look for the indexes during postback / rebinding and add the visible classes to each corresponding element.
Is there a better approach or some native method of passing back the client side style / class change to the server during postbacks?
I have a simple question - I use update panel with custom server control inside. I call __doPostBack from javascript and RaisePostBackEvent on the server fires (I implement IPostBackEventHandler).This is client to server call. Could I return data back to the client (after this partial postback)? What is the best way to achieve this?
ASP.NET Ajax Library provides some client-side events. For instance:
Sys.Application.add_load( function(args) { // handle the end of any asynchronous post-back. Every-time there's // a server round-trip, this method will be called. } );
During the asynchronous post-back I want to retrieve information to the client. This information must be available in some event like the discribed above.
Does the UpdatePanel or the ScriptManager have any server-side way to retrieve data back to client during an asynchronous post-back?
I have a user control which has some properties configured on it. I need to access (actually, only read) the values of those properties on the client. I have done it like this.
Code behind:
[Code]....
ASPX:
[Code]....
That works but, at the back of my mind, I'm sure I've seen a neater way of doing it, although I suspect that may have been on an Extender not a User Control. Pointers on that welcome.
Also, related to that, the User Control itself has an Id which becomes part of the name of all visual objects included within it. However, the User Control is not a DOM element in its own right (because it has no visible rendering) which [I think] means that I have to attach properties to one of the visible elements within it, and not to the control itself?
I have following situation - I am pasing user info object from Controller to View. It contains GUID UserID, which i dont want to be seen on page. So I removed every Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc... from generated View source. And because of this when Html.BeginForm() returns that object back to Controller all values is there but UserID is lost??
If I leave Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc.. in View everything is fine. But I dont want to show UserID? Where is the problem here?
I am working on an MVC application and I have an index view where I pass model from controller to index view. The index action has no parameters. Now On view I have a jquery calendar. I want to change all the data on view when a date is selected. do I need to use different action method for this as current action method doesn't have parameter. or I can use same ?
I am trying to pass data from client to server using a hidden field. If I use a button, then OnClientClick sets the value, and OnClick does the postback and all is well.
However, I am responding to a Client event, and although this works I get no postback. How do I now force a postback from my client handler?
I'm using Wizard control to collect some information. I have Repeater control in my Wizard control. when client inputs information and clicks next button he gets to next WizardStep, thou from next step when client clicks previous button and navigates to previous step Repeater control's input fields are empty. How can I store client input so when he will navigate back he could see previously added information. I don't want to use any client or server side session management techniques, because I think viewstate is enough. I think my problem is I don't bind Repeater control in a right place, besides, all the controls inside my Repeater control are loading dynamically.
I have a repeater that has a LinkButton in the Item Template. The LinkButton displays a UserControl that consists of a FormView. The UserControl has an HTML Element that when clicked hides the UserControl by simply change the display of the control from 'block' to 'none'. If the 'Close' span is clicked, the UserControl is successfully hidden, but afterward, the 'Edit' linkbuttons no longer postback.
I've got a page (menu.aspx) that contain a ListView, within the ListView is a user control which is just a GridView of items related to those in the listview. Now the overall page is linked to a master page (Master.admin) that has a simple Literal control that I use to display messages, etc.
What I need to be able to do is if I update, delete, etc something from the Gridview (user control), I would like it to display what ever message I send to the Literal control
I can do it from the actual ListView itself by doing somethihg like ((Master_Admin) Master).Text += "My message";
I've been going at this for several hours and I simply cannot find the solution.
I want to get some data from my user. So first, I use a controller to create a view which receives a Model:
[code]...
The rest of this controller does not matter since no matter what I do, the count attribute of Request.Files (or Request.Files.Keys) remains 0. I simply can't find a way to pass the files from the form (the Model passes just fine).
I am developing an application that will have 200+ sessions at any given time. I am also relatively new at asp.net development. This application will be hosted on a remote server along with its SQL Server 2008 database. Each session will constantly use SQL select, update, insert, and delete commands. Do you think it would matter if I used server-side logic to perform all the SQL commands, passing parameters back and fourth? Or should I do some more research on client-side database manipulation? Would it be too much load if i used strictly server-side?
I have an Send.aspx page that has an uploadify control on it. Upload.ashx handles the file upload.I am adding a file record to a sql database in the Upload.ashx file and I need to get the ID of that record back from Upload.aspx when it is done.Can't get it working with Sessions. =( Something to do with an Adobe bug?
What would the best way to handle this be?Here is the uploadify control:
<script type="text/javascript"> // <![CDATA[ var contestID = $('[id$=HiddenFieldContestID]').val();[code]...
This took a while for me to figure out. But in retrospect it is extremely simple. For this reason, I mad a video tutorial to help newcomers get started quickly and understand how this awesome control works.
I have a cascading dropdown. After the dropdown is populated(it is in another file) i would like to return back to the original form where the control is placed. is there anyway of doing it
I have two Repeater controls, each hosted in a user control. Both user controls are contained in the same aspx page. Only one User Control is visible at any one time. The repeaters are comprised of checkboxes, and text boxes for user input.
The aspx page is configured with an Ajax ScriptManager; and contains several Ajax UpdatePanels. These UpdatePanels result in partial page post backs when text is changed in a textbox control in controls on the aspx page (this is not the behaviour for the Repeaters in the User Controls). Through use of several AsyncPostBackTriggers, various controls contained in the other UpdatePanels on the page have their content refreshed in response to the partial page post backs they are configured be notified about.
Depending on a radio button group selection, I set the visible property to true or false - as appropriate for the User control containing a repeater control. The Repeater control is then populated with data using databinding. All of this works.
However, when the Submit button is clicked, the Repeater control contains no data.
Given that I am not dynamically adding the Controls containing the Repeater controls (but using Visible true / false). I would have thought that the State of the fields and the data in the visible control would be preserved during the post back.
The User Controls are contained within the UpdatePanel that contains the Submit Button.
I have explicitly Enabled View state without any effect.
Am I correct in assuming that I should not have to do any explicit handling of data changes the user makes (via client side script and manipulation of an Data Structure Representing the Repeater Data); and the View State should maintain the data I need to access on the server when submitted?
I do not believe that it is the User Control visible state changes that are causing the issue because when the page is initially loaded on of the User controls is populated with dummy rows (so it displays).
I am suspicious that because the visible state of the controls is changed during partial page post back, that the Page View State ends up with no knowledge of the User Control and therefore cannot track its data (or changes).
I got a strange issue after hosting the my site in IIS 7.5, Windows server 2008 64 bit
The applicaion is created in ASP.Net 2.0
The page with issue has following workflow:
Upload a file from browser (may be very large size ~50 MB)Perform some process (May take very long time: up to 30 minuits)Notifies the client that process is done.During the process client uses something like http://www.codeproject.com/KB/session/Session_Defibrillator.aspx to keep the session alive.
The Issue: The client does not get any response sent by my code after the process is over. It should refresh the page with the response provided by my code. But instead it only shows waiting for... in the status bar.
I have tried this on IE and firefox.
To veryfy the process is over
I have added some trance message in my code to check when the process gets finished.I have also checked the Log from IIS, it also shows that response sent with Code 200.
Please help me solving this issue:
What could be the issue?How can I diagnose and fix this problem?In what cases connection between browser and IIS server gets lost.
I have a VB.NET ASP.NET webserver program running. One or more VB.NET clients are making use of it. Nothing special so far. As far as I know, the server is not really aware of the clients. Clients can request data. But is it also possible to let the server call-back a specific client when something happens? So that the client doesn't need to poll?
To be more specific, this server is connected with hardware modules. Clients could be terminals that show the status of a sensor for example. When a sensor gives an "alarm" value, it would be nice if the server could pass that alarm towards the clients. Instead of letting the clients to check each X seconds if that alarm is active. Would be a waste of energy, especially because the chance this alarm goes off is almost zero...
I'm converting a bunch of FOXPRO / FOXWEB apps to ASP.NET.
The underlying DB is still foxpro (for the moment).
I am passing a table to some VB.NET code that I want to have converted to a CSV file and sent back to the client for download. And it works! Sort of ... It works sometimes, but at other times, instead of asking me if I want to download the CSV file, it just spews the file to the browser window.
On the asp side, I am passing the response object, the table and the csv file name.
i am using data grids on my web page, and on edititemtemplate i have custom validators for the drop down list ( ddl), most of them they do the same job which is to test if the user did select from the ddl or not.
i want to point all of these drop down lists to the same function and pass to this function the ddl.ClientID
I have default.aspx as the main page and in it I use Greybox to pop and iframe that holds and editable form. Once the user enters in the text and hit submit I need to pass the data to the DB and have it show on default.aspx without refreshing the page. I have the data going to the DB I need with displaying the data on default.aspx page without refresh.