State Management :: Dropdown Lis Should Be Keep Index After Page Change And Back?

Aug 11, 2010

I am having a dropdownlist and fill it by providing dataset its working on page now what i want is when i am click on a button page is transfer to another page but from that page when i am back i want dropdown value selected.

View 4 Replies

Similar Messages:

State Management :: Persisting DropDown List Attributes Across Page Postbacks?

Oct 12, 2010

how can DropDownList attributes be persisted accross page Postbacks?


DropdownList1.AutoPostBack = True

On Postback the attribute is no longer available (ie. attributes.count=0).

I tried persisting using the code below, but was unsuccessful:

Before PostBack: ViewState.Add("DDL","DropdownList1")
On PostBack: DropdownList1 = ViewState("DDL")

This generated the error: DropDownlist is not marked as serializable.

I than tried:

Before PostBack: Session.Add("DDL","DropdownList1")
On PostBack: DropdownList1 = Session("DDL")

This did not err but attributes were still not available.

View 4 Replies

State Management :: Retaining The Dropdown List Values Moving From One Page To Another

Mar 27, 2010

I have four dropdowns in the first page and then a button which saves the selected values from the dropdown to a session state .

In the second page I do have previous button which comes to the first page. My problem is that the dropdown values are not getting preserved.

Here is my code for the First page

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyBusinessLayer;
using MyDataLAyer;


The problem is that I get the error object instance not set to an instance of an object

View 3 Replies

State Management ::show Cutom Page When Webpage Has Expired Error When Click Browser Back In 1.1?

Jul 26, 2010

I am using the following code to ensure that the web pages in my website are not cached by the browser:

this.Response.Expires = 0;

this.Response.AppendHeader("Pragma", "no-cache");


This is working fine & the browser displays a page with the message, "Warning. This page has expired....". Is there any way I can display a custom page instead of the default page shown by the browser?

View 2 Replies

Forms Data Controls :: DropDown Index Change In A Repeater?

Mar 22, 2010

i have a dropdownlist and a textbox in a repeater i need to enable/disable the textbox depending on what was selected in the repeater.

this is the code i have now:

Protected Sub ddlContact_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

View 4 Replies

Forms Data Controls :: How To Change Index Of Dropdown In Gridview

Sep 21, 2010

i have got grid view with 4 coloums which contains 2 dropdown list. n i have 2 drop down list out side the gridview .

i want to change the index of the 1st coloum dropdown list inside the gridview when changing the drop down list index outside using javascript

similarly the when the 2nd dropdown list(out side ) index change the 2nd coloumn dropdown list in gridview should change.

In short the outside placed dropdown list should act as master dropdown list.

View 7 Replies

C# - Modifying The Query String On Dropdown Index Change In Code Behind?

Mar 1, 2011

I have a drop down box that is in the edit template of a formview. I want to be able to add a parrameter to the querystring when the drop down selected index is changed.

I tried

Request.QueryString.Add("tabindex", (sender as WebControl).TabIndex.ToString());

But I got an exception saying the collection is readonly.

Here is my markup

<icms_ref:ReferenceDropDownList ReferenceDataManagerProviderName="ROCSQLReferenceDataProvider"
ID="ddlEnquirerHearType" TabIndex="2" runat="server" ReferenceSetName="EnquiryHearType"
AutoPostBack="true" OnSelectedIndexChanged="EnquirerHearType_SelectedIndexChanged"
DataTextField="ShortName" DataValueField="ReferenceId" />

and here is my code behind.

protected void EnquirerHearType_SelectedIndexChanged(object sender, EventArgs e)
var pnlEnquiryHearTypeOther = fvEnquiryInformation.FindControl("pnlEnquiryHearTypeOther") as Panel;
pnlEnquiryHearTypeOther.Visible = DdlEnquirerHearType.SelectedValue == ((int)EnquiryHearType.Other).ToString();
ResetTextBox("txtEnquiryHearTypeOther", fvEnquiryInformation);
Request.QueryString.Add("tabindex", (sender as WebControl).TabIndex.ToString());

View 1 Replies

Forms Data Controls :: Second Dropdown Slected Index Change On Submitclick?

Jan 13, 2011

i have two dropdownlist, second dropdown populates based on value selected in first dropdown.

Parentdropdown is working fine and second dropdown is also popualting correctly. But when i select value from second dropdown and click on submit button it resets to first value i.e though i have chosen 3rd value from dropdown it resets to first value.This happens when autopostback is not thr.

If for the same case ifi do autopostback=true. It chnages to first value automatically . then it odesnot require submitbutton click as well.

In both cases selected index is not getting set for second dropdown.


View 9 Replies

Web Forms :: Hide Error Message During Selected Index Change Event For Dropdown?

Apr 3, 2012

I am having a label to show success message during the successfully save.

I am having a drop down with the name "Technology".

During on selected index change event of the drop down, i am binding another drop down with the name "Resources".

When the Button is clicked, i am showing the "success message"  and on click event of the drop down, i am clearing the message by using the java script.

 function ClearErrorMessage() {
document.getElementById('ctl00_ContentPlaceHolder1_lblMessage').innerHTML = '';

But when i change the drop down, the message gets reappeared.

View 1 Replies

State Management :: How To Clear Sessions After Clicking Back Button

May 17, 2010

I would like to clear sessions after hitting back button . Iuse the java script to disable back button how can i clear sessions now after hitting back button.

I use the following script

<script type="text/javascript">
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);

View 6 Replies

State Management :: Click Back Button No Refresh Data

Apr 18, 2010

I have 2 webpage 1 is a.aspx and 2 is b.aspx on a.aspx it contain gridview data on 2paging when click on gridview data on 2paing link to b.aspx so on b.aspx have back buttom when i click on b.aspx it will be back to a.aspx but i dont want a.aspx refresh data to 1 paging. I want to click back buttom it show data on a.spx on 2paging not 1 paging.

View 2 Replies

State Management :: Clear Back Button To Force A Postback?

Sep 18, 2010

I am using 3.5 and use master pages for most of the website. I need to make sure that users after they logout are not able to use the back button to see in cache data.

View 4 Replies

State Management :: Populate Dropdown From Cache

Oct 6, 2010

I wanted to know the best practice for caching data. Say I have some control example a dropdown list which is populated from my db. Now this dropdown is global and used across many pages. I was thinking of not going to database everytime to fetch data for this dropdown and put the result in Cache. And then populate this dropdown from cache. Is this a good practice or if there is another approach. Can I store my datareader in cache and then use it globally. Also could I do this in application start event?

View 4 Replies

State Management :: How To Control And Add Extra History Points In IE8 Back Button

Jun 23, 2010

I wasn't sure where to post this type of question so here you go. The title says it all really I'm using the Microsoft.web.preview dll so that we can provide history support for the Ajax controls used in a .net 2.0 project. This works in IE6 but fails to function correctly in IE8 it appears to add additional history points when you attempt to navigate backwards through history.

Enter the page > Make a change using Ajax (add history point) > press back button you would expect to go back to initial page state but another two history points have been inserted between your initial page request and new your manually added history point. there is no where in the code that is adding these additional history points by accident. Remember it works perfectly under IE6. What are my options do I have to upgrade to 3.5 .net to make use of the history functionality built into the scriptmanager?

View 1 Replies

State Management :: UserControl Data In Viewstate And Retriving On Back Button?

Apr 16, 2010

I have a page with a few usercontrols. from a usercontrol I will redirect to a new page(response.redirect). Now On pressing the back button I want the data to persist for the usercontrols as well. I have tried it out by overriding DeterminePostBackMode, LoadPageStateFromPersistenceMedium, and SavePageStateToPersistenceMedium but all data except the ones within the usercontrol persist. i feel what i have tried is ok for the page data but for usercontrol data do i need to do something else.

P.S: I understand that i could be storing all user controls value in a session but I am looking for another way because its going to be a huge task taking each controls values in a session. I am not using any dynamically loaded user controls. May be if I know of a way of saving and restoring viewstate for user controls it would work but..

View 1 Replies

State Management :: How To Implement Caching To A Dropdown List

Dec 3, 2010

How to implement caching to a dropdown list

View 2 Replies

State Management :: Maintain Master Page Control State On Load Of Content Page?

Dec 30, 2010

I have created a matser page with a two radio buttons, text box and a button. Whenever user sets some values to these control and clicks the button, i will navigating him from one content page to another based on the data he has entered. The problem is after the content page load, the values selected/given in the controls(radio button, text box) are getting cleared.

Is there some way to maintain the values ?

View 8 Replies

State Management :: Application Crashes - Lost All Values Of Dropdown

Jul 23, 2010

I have a web form with a whole bunch of drop down lists (mainly) that works perfectly well and has been for some time. However, we've found a scenario that seems to corrupt the viewstate of this form in someway, or cause it to lose it's viewstate. The problem occurs when the user has this form displayed, then clicks on a link that opens up another window. A few more steps to open up a second and third window, followed by a write to the database. Then the user closes these windows down, leaving this original window open. At this point, the user selects something from one of the dropdowns. And the app crashes because the dropdowns have lost all of their values (and so a bit of code that is trying to work with one of the ddl's selectedvalues fails).

When the user selects this dropdown, the page_init event fires, followed by the page_load with postback = true. The dropdowns themselves are defined in the aspx page markup, but the values of them are generated and added in page_load (where postback = false). I've relocated the code to populate these controls to the page_init code and now the app doesn't fall over, because the values are re-populated. However, all of the selectedindexes are being reset, so the original values are lost and the screen redraws after this postback with all of the dropdowns reset.

View 1 Replies

Web Forms :: How To Disable Browser Back Button In Index Page Or Login Page

Sep 25, 2012

am creating a web application in using c# with

in that am using login page only as normal aspx page. other pages are using masterpage.

when i click logout button in masterpage. page will redirect to login page. after that if i click browser back button it was moving to previous page. how can i prevent this.

am using this following code in master page aspx page. And My log out button code is below.

<%if (!Page.User.Identity.IsAuthenticated)
{ %>
<script type = "text/javascript" >
function preventBack() { window.history.forward(); }
setTimeout("preventBack()", 0);
window.onunload = function() { null };
<%} %>

But exactly what i need is once if login page loaded or logged out then it wont go to previous page.

View 1 Replies

State Management :: State Management And Page Navigation?

Nov 18, 2010

i have a form on page1.aspx with several controls (textbox, dropdownlist, etc).on Page1 PageLoad event i load data from database and performe databinding.From Page1 a user can, by clicking a specific button, move to Page2.aspx to insert some details and, after saving details, he returns to page1.

if save changes are made on control on page1 before save them to db, obviously, these are lost on return from page2 (because are reloaded on pageload from db).How can i save control status between pages round trip?

View 3 Replies

State Management :: Pop Up Change Viewstate?

Dec 22, 2010

have some viewstate value in my opener window ,when i close the popup i want to set new value in the opener viewstate.

View 3 Replies

Dropdown Selected Index Page Event Fires On Page Load

Mar 26, 2010

In my web form, i have 2 drop downlist controls. eg. dropdown1 and dropdown2. I will change the dropdownlist1 item, consequently selectedindexchanged event fires and reloads the dropdownlist2 items. And i have another button also in order to get the result based on the dropdown1 and dropdown2. Lets say for example, i have a list of countries in dropdown1 and a list of states in dropdown2. I selected "India" in dropdown1 and correspondingly "Tamilnadu" in dropdown2. And then click a button which calls the dataset based on dropdown1 and dropdown2. The problem i face here is, whenever i click on the button to load the dataset, dropdown1 value remains the same as the dataset is not called again, whereas the dropdown2 value changes to the first one as it gets called automatically during postback. For your information, I have loaded both the lists in the page load using (!IsPostback) property.

My coding is as follows:

protected void Page_Load(object sender, EventArgs e)
if (Session["sesUserName"] == null)
Response.Redirect("sessionExpr.aspx", false);
lblStatus.Visible = false;
pnlEvaluate.Visible = false;
if (!IsPostBack)
catch (Exception ex)
throw ex;
public void fnLoadDropDown1()
dsLoadDD1 = objWebRef.fnLoadOnlineTest();
if (dsLoadDD1.Tables[0].Rows.Count > 0)
ddTestTitle.DataTextField = "vchTestTitle";
ddTestTitle.DataValueField = "intTestID";
ddTestTitle.DataSource = dsLoadDD1.Tables[0];
public void fnLoadDropDown2()
dsLoadDD2 = objWebRef.fnLoadOnlineTest();
if (dsLoadDD2.Tables[0].Rows.Count > 0)
ddUser.DataTextField = "vchUser";
ddUser.DataValueField = "intUserID";
ddUser.DataSource = dsLoadDD2.Tables[0];
protected void ddTestTitle_SelectedIndexChanged(object sender, EventArgs e) ...................

View 1 Replies

State Management :: .Net Website Logged In Pages Still Displayed By Pressing Back Button In Mozilla Firefox Browse?

Jun 18, 2010

I want know, If an error has occurred and website is redirected to the Custom Error Page and is also logged out. If back button of the Mozilla browser is pressed, previous logged in page is displayed. I have also used

in Page_init on Custom error page. Also set the values of .ASPXAUTH and other cookies to 1 but again page is not going to the Login Page. These cookies could also not be removed.

View 4 Replies

State Management :: How To Change Dll In Bin Without Effecting The Application

Jun 7, 2010

I want to replace a bin dll in the running live website. But at the same time i also want that the current users using the application does not effect with this, may be runtime errors or session time outs.

View 2 Replies

State Management :: Change Session Cookie Name?

Dec 15, 2010

I would like to change ASP.NET session cookie name "ASP.NET_Sessionid" to some other name. I specified <sessionState cookieName="MyCookieName" />. When I use fiddler to view response header, I can see "MyCookieName" with random generated number under cookie section, however, ASP.NET_SessionId also exist there.

View 2 Replies

Copyrights 2005-15, All rights reserved