Web Forms :: Keep Losing The Selected Value Between Pages?
Feb 3, 2010
I have a 3 page vb.net web application (long story, but it has to be multiple pages). Page one has a datagrid that has rows of data. When a user selects a row, I check to see what "RecordType" corresponds to the row selected. If the RecordType = 1, Page Two loads. If the RecordType = 2, Page Three Loads. The problem I've run into, is that once page two or three loads, all the data is lost. In the gridview, I have the several values in the DataKeyNames, but "loose" them all between pages. Is there a way to pass this data to the next page other than ...Session - I guess I could set the values in the datakeynames as session data.. right?
QueryString - I really don't want to use querystrings, as I don't want users "messing" with the URL.Is there another option available in .NET? I'm kind of hesitant to set sessions, because I'm afraid the values won't get cleared out as needed...
I have a gridview and dropdownlists that I want to use to filter the gridview by. I am trying to mimic the Filter functionality in Excel.The current problems I am having are:The dropdown is losing the selected value during the postback. It selected value goes back to All.I cannot use the dropdownlist to select "All" to remove the filter.ode is below.Page Code:
And inside that gridview you can see I have a dropdownlist called dpdTrueFalse. That dropdown has two values which I am loading from code behind like this...
[Code]....
I have a submit button outside that gridview that checks each row and the selected value in the dropdown. But for some reason, even if you select another item in the dropdown, it always selects the first item in the dropdown when I click the submit button. I reckon its because of the postback.
I am using the AJAX Contol Toolkit and 4 CascadingDropDown extenders with an ODBC connection in a Web Service. The original load of values in each level works great. I then use these values to set the create the SQL for the SelectCommand for a Gridview.
The problem I am having is that when I submit the page to perform the search, the first 2 dropdowns repopulate and set the selected index accordingly, but the 3rd dropdown does not retain its selected value. It does populate with the values, but the selected value does not get set.
The correct values are available for the SelectCommand which returns the correct values.
After this, the text box continues to work correctly, but the _state member does not pick up the posted back values and instead just sticks to the declared value. I've checked the raw posted values in the Request object, and the new value for the list's UniqueID is there, but _state doesn't pick it up.
i have a setup.aspx page where in i select the theme with buttons so if i click on a button the theme should reflect in all of my pages of project.so how can i write the code do i need to call it in each page.how can i set the initial page to do so.
I have a dropdown inside a webusercontrol which I want to use on 5 pages. I want to save the selected value of the dropdown from the page. I tried to access it using below method, but its not working[URL]
Ihave a gridview item template field namely Status as mentioned above ...
i want when user click on hold button of particular row then the record from the particular row is transfered to another page. ... means.... if i click on the hold button of 1st row of gridview then seats=35 and booking closed =08:00:00 PM willbe trasferred to
I have a situation where I write a cookie on one page and read it on another page, but it only works for users who are in the admin group onour web server.On my default page, I have this code in the page load event to get some user data from my database and save it for later use: HttpCookie c = new HttpCookie("userinfo"); c.Values["domainaccount"] = _CtaUser.DomainAccount; c.Values["userid"] = _CtaUser.UserID.ToString(); [code]....
And it's gone.Again, it works for me and one other programmer who are in the admin group on the web server, but not for anyone else.
I have an upload control (csv file) of which I use the stream to retrieve data in a datatable that I then bind to a datagrid, sitting in a repeater control.I have to bind more than one record to the repeater, therefore I need to find a way of storing the stream for each binding, so that I can bind it to the datagrid again, via itemdatabound event of repeater.
I have tried storing the stream in the repeater's datatable but on each postback, the content of the stream gets lost. The stream still exists, but its length is set to 0.I have tried storing it in a session object, but again it is reset to 0.
I have tried using viewstate but I get a xmlserialization error. Saying IXmlSerialization is not implemented.I am desperate to find a work around as I am feeling the pressure at work.
I'm a little confused here. In the code-behind of an ASP.NET page, I have a private DataTable that I set on the PageLoad event, which I use to populate controls on the page. However, it seems to get lost (set to Nothing) after the load event.Is this normal?
How do I hold onto a DataTable object after the page loads? This is also very confusing as to how I am supposed to submit updates to the SQLServer db when any changes are mande to that datatable. I mean:
1. PageLoad, set DataTable, set controls values to corresponding columns in Datatable.
2. User changes a textbox value, then start a .BeginEdit(), DataRow("Field) = txtboxvalue.
3. Update button clicked should submit DataTable to Webservice that references a DAL that accepts the DataTable for db update.
On my page I have some text boxes that users can enter values in. The first time they submit the page it gets the values from the text box fine. But when the user goes back using their browser back button and changes a value and resubmits, it shows the value from the first time they submitted, not the new value they just entered.
Is there a way to keep (automatically) the data posted before a redirects to the another page? And then reapply the post data to the this Page upon return? Here is what I want to do :
[Code]....
I noticed that some websites are already doing that. Such as phpbb forums, when composing a message and the session expired we are redirected to the login page and then we return to our post without anything lost. However, I know that it is in PHP but it remain a web application at all ;) I thought of a system of modal box that will appear directly in my MasterPage so don't need to redirect, but I do not like the idea. If I don't find any solution this could be a workaround. But I don't like it.
I have had a website on a shared web hosting plan for over a year with no issues with keeping persistence. It's been prettys stable, and the only drawback of the host I am using is that it's very slow on occasion...sometimes taking 5-10 seconds to load a page.
So over the last few weeks, I went searching for another web host and and testing one out now.So while my existing website is still running the old web host, I copied the code and data and pushed it on the new web host. It's up and running, but I noticed that shortly after I log in (Forms Authentication), I am logged off within 20-30 seconds.I decided to add the machineKey to the web.config, and it seems to have fixed it.
My question is why would this have fixed it? I asked if the host's servers were in a web farm.
i have a global field called hotelId. i then have this piece of code that gets a value from gridview row:
[Code]....
the local variable is assigned to my global one, which gets passed to my method along with other variables. while stepping through i can see the value is set, but when i hit the submit button variabl is passed to another method except my hoteId. it gets lost...
I have a gridview with auto Edit buttons... when I click on Edit button it is losing it row and column colors.We are initially setting the gridview colors in the page_load event.
i'm developing a site using VS2010 and with my windows vista busniness OS. i used the default VS2010 wizard for new web application to create it. included a folder in the root directory and created new aspx pages to derive from the master page in the root directory of my site. everything shows on the new pages except the jpeg image logo in the master page. But other aspx pages i created in the root directory shows every thing fine.
Currently I'm doing common functionality required throughout my site inside of my masterpage. What I want to do is move this functionality to a BaseClass so All my pages inherit from the Base Class. However, I'm not sure how to set this up interms of c# code with regards to Using a Base Class and then having a masterpage applied to my aspx pages that i create.
how to create unlimited user control without losing the data... My problem is on postback.. i searched a lot but m not get solution.. my question is how to recreate unlimited controls(textbox,dropdown) and how to maintain the data in the controls.. Now am able to create dynamic usercontrol (unlimited) when Button click event using for loop but not able to maintain the data during postback.
I have a FormView that is used to insert records into a table. It is set to a default mode of insert. When I click a LinkButton it makes the FormView visible and populates a DropDown List control via code. When I click the Insert button, it inserts the record into the table but then the DropDown List selections disappear. How can I keep the selections so that I only have to fill it once?
I'm new to the asp.net/vb.net world and have stumbled across a problem.I have a page that has a gridview. When the user clicks on a link in the grid a modal popup is shown (using the AJAX modalpopupextender).On this pop up is a treeview that the user can then select some child nodes.When they click a button a table is dynamically populated with the list from the selected treeview nodes.The user can then add detail in this table comments etc and then should be able to click on a save button. This will then fire the event to loop through the table and insert these records into a database.The problem is that when the Save button is clicked the page seems to have lost all reference to the fact that there are dynamically created rows in the table even though there are a number of rows that you can still see displayed on the page. Even the table.rows.count shows 1 at this point!
The child window close, go back to parent window, and reload the page and no confirmation box to refresh the page, working as expected. but all my previous entry to the screen is gone. how to retrieve it back or any work around?
I am trying to upload large videos(more than 1GB) to youtube from webpage. But youtube is allowing me to upload max 8MB videos. So I want to reduce the size of the video and then upload the reduced video to youtube. So, how to reduce the video size.