I have a combobox binded to a stored procedure which pulls in Years
the click event button deletes whichever year is selected and that works as I can confirm the record is actually deleted on the back end in the database. But after the delete the combo box doesnt refresh and still shows the old record. Any ideas?
You need to query the data again and call combo.DataBind() or delete the item yourself.
Related
After I have successfully added a record in a subform, I have to manually click on the next record and back to view the added record in a subform that contains a query in datasheet view. I've looked up requery and can't seem to get it to work. I want the new record to show immediately in the query as soon as the user press the "Add Record" button I created. Any guidance would be appreciated.
I just used the built in command button to add a record. I also tried using the built in command button to "save record". I'm guessing I need something to trigger an "after update" or a requery; but do I put it on the command button or where?
That's because you add the record via an SQL insert command to the table behind the subform. Then you need to refresh the subform.
It is faster and smarter to add the record to the RecordsetClone of the subform. This way, no update is needed.
http://binaryjack.com/userControl.aspx
Each record is displayed using a user control. I have the delete button embedded in the user control.
Recreate Problem: click the first DELETE button, the last row gets deleted; after this I have to click the delete button (any of them) twice to make it work.
Is it bad practice to use a User Control (combined with a placeholder) to display a bunch of records? I query to get all records and then use a Foreach loop to populate each User Control and insert each UC into the placeholder.
Why does the Delete button not respond correctly?
Without seeing your code it is tough to say. However, it appears to be a refresh issue. If you hit delete then hit refresh, the record is gone. Check how you are refreshing the data and you'll find the issue.
I have created online exam application (web based) in asp.net c#. In my application first form includes dropdownlist for tests & start button. When i select particular test from dropdownlist & after clicking to start button it goes to the next page. It includes one label for question, radiobuttonlist for answers, next & previous button.In first form in the click event of start button i have created non repeated random values ( for question ids) i.e stored in array.when it redirects to another page then 1st question from that array will display with answers & after clicking next button next question will appear, here i have inserted selected values(answers selected in radiobuttonlist) by user in database to calculate score. Problem is with previous button, when i click to previous button then it goes to previous button but i want earlier selected values by user to be bind with that radiobuttonlist. how i can do this?
I think you are storing the previous question answer in your database or somewhere else.
Then in the page_load event check the database with the question number and if the records available then display the user selection accordingly by fetching them from the database.
Hi
I am displaying one question & their 4 options per page.
For that i have one label for question & radiobuttonlist for their answers.There is next button. after clicking next button i want to display another record.
I have tried this with dataset with random function, but its not proper. values gets repeated. so i want first record to be display in pageload & after clicking next button next record should move till record exists.
I want to move one record to another after clicking next button.
how i can do this?
asp.net, c#
Thank you.
Use any of the data controls like gridview, repeater or datalist and keep the paging property on.
I have two update panels on my page. The first has a form that contains required field validators and a button that triggers the update panel and sends the info to a database. It also has a trigger for the button.
The second update panel holds a gridview that shows a few columns from the collected data. As of right now I have the gridviews update panel set to conditional and its trigger is the button that submits the first form. It's supposed to work on the click event, but the gridview isn't updating.
In other words, I want the gridview to update when I insert a new record through the form in the first update panel.
In the code behind for the button that submits the form add GridView1.DataBind(); at the end. Now changes will be reflected automatically in the gridview. Pretty neat.