I have a ListView in ASP.NET where one column consists checkBoxes. I want the user to be able to these CheckBoxes directly in the list (without having to go into edit mode). How I do that, I have received answers in this question
The problem is when the user quickly press several CheckBoxes. It is only the first checkBox that is stored in the database, the other is restored. The user must for every checkBox, wait for the page updated. Is it posible to solve so that the changes are written to the database asynchronously?
You should make Ajax request using JavaScript on checkbox state change
You can use UpdatePanel to write to the database asynchronously and set Trigger to CheckedChanged event
Related
I've (2) applications one is Website and the Second is Application to manage the requests which is coming from the Website.
When I submit RegisterationForm and record get inserted in SQL Srv DB, I want the
ListView of registered clients notified that there is a new update , and Perform an Update on ListView without refreshing the Page Always.
So it will be easy for the Admin to monitor the new Registered Clients on listview. WHAT I MEAN IS THE LISTVIEW MUST BE REALTIME.
I think Using Timer inside UpdatePanel to do DataBind() of ListView is not the professional and efficient way to do that? is it ??
What is the best way to do that?
I think The Best way is use SignalR
I am checking whether there are existing solutions/ procedures for the following scenario.
When there is a change in a row of database table, the same should reflect immediately in datagrid that i have in winform on a push basis but not in timely refresh basis. If it has to be refresh basis, i dont want the user selections of datagrid to disappear.
i guess, i can do this by signalR in case of webforms. But in case of winforms or asp.net, please point me to any appropriate tutorials to do this.
Thanks
You can update the datasource on the save button itself. Then, it will be refelcted immediately after you commit the changes in the row and save it.
I'm using a gridview and SQL data source .
After I'm inserting information in data table if I refresh the page the query is executed again and if I refresh it again it will execute again.
Is there any way to disable refresh or make the events unique to be executed only once when the event is raised without execution on refresh
Thanks
if I understand correctly. You have a web form with a button.
You push the button which causes a post back and the event handler for the button press to execute.
Then you hit refresh and the page has the button event handler execute again.
The reason for this is your refreshing the last information sent to the server. Which is the button click information in the __doPostback. This is why you are seeing the event of the button fire again.
ASP.NET doesn't provide a way to do it directly.
Here is an Article talking about how to detect a refresh over a postback.
and your issue is discussed here on other thread
Problem:
I am loading one of several user controls based on a selected tab within RadTabstrip Control which is on the parent page. I've captured the Selected Tab and assigned it to a Session variable within the OnTabClick event to use in each User Control to determine if that particular control needs to be rendered.
The reason for this is because each User Control queries a database to render different charts and I don't want unneccesary processing occuring on every post back to the server. I'd like to add that each User Control has several Labels in their Markup that only gets the Text values assigned during runtime based on the content retrieved from the database.
When I load the main page, the selected tab variable is checked by each User Control and everything works fine from that scope. (The first tab at index 0 has no Charts)
Problem is when I select a Tab which has a User Control, the appropriate code to acquire the data from the database and build the chart works fine but the TEXT value of the Label controls in the Markup don't show up on the Page, although the TEXT values are being set in the Code-Behind at the same time the data is being retreived.
If I perform a Post Back of the same page, the TEXT values of the Label controls appear.
I believe this is because the 1st stages of the Page Life Cycle which include the rendering of the Markup aren't firing on the initial loading of the User Control, but get fired on subsequent Reloads or Refreshes of the Page.
Is there a way to work around this? I am figuring a call to the Render event after hitting the database would work but I may be way off base on my thoughts.
Can anybody provide some advice or a potential solution???
Thanks
I was never able to resolve the late binding issue which prevented the text of the labels from appearing until after a manual refresh of my page so I approached the issue from a different angle. I still retained the logic that only allowed the data of each User Control to get populated if their corresponding Tabs were selected by the user, but I moved the in-line code which was embedded in my Markup to my Code-Behind file.
I was not 100% certain as to the order that the mark-up vs. the code-behind got processed, so I researched and found that anything done declaratively in the aspx page is processed first, and the objects are created before being accessed or updated in the code behind.
So with this information I totally separated the two and was able to get the Text to render on the labels without any issue.
I still would haved liked to have known the appropriate way to force a page to call the Render event to simulate or mimick a manual Postback after the initial Page_Load, but going with the flow of the Page Cycle is the much easier and probably a more preferable way to do things.
One way to approach your problem is to consider use of the "Update Panel". It will allow you to render the entire page and then on an event only refresh the area of the update panel.
Generally I would love this feature for performance reasons but there is a catch. Some browsers (e.g. versions of Safari and Opera) do not render these correctly. Is your application a web application intended for general use by consumers? If so you may need to consider a full page refresh on the same page and pass the user data (unless Opera / other browsers have fixed this shortcoming - I have not tested in in 4 months).
Had a question thought someone might have done this before, i have a wcf method that brings back an ienumerable collection of data that is binded to the item source of a datagrid. each record in the db is updated by the windows service regurarly untill the progress is completed, updating counts adding new records etc , each record on the grid reflects each record brought back, currently the method brings back a list of data where each record is binded to a progress bar control in each row of the grid showing the progress of the work, however this is not live so the user has to press the refresh button each time which makes a wcf call to bring back the updated or new data, here comes my question how can i or whats the easiest and best way to show the progress happening on the control live without a refresh button, so the binding to the control updates and make it seem live?
Thanks in advance