.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

LoginView, DropDownList, Cookie, AutoPostBack Conundrum

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
 
OK, I am at a complete loss. Users for my site can have many stores to configure under their one user account. When they login I have the app generate a cookie for each store and hold all the stores basic information. For each cookie I then generate a list item in a drop down list. I can get the list to generate just fine and all of the pages that reference the list get the information fine. When I change the list to a different item however, and the page posts back my first LoginView is set to LoggedInTemplate while my navigation loginview (in site.maser like the first one) and my content loginview (in the actual page) come back in AnonymousTemplate, even though the user is authenticated. I can either do a response.redirect or physically refresh the page and all loginviews are in LoggedInTemplate again. The problem is though that I lost all of the postback data so I can essentially only view information on the first item in the dropdownlist. Now, I am new to asp.net authentication, and while I feel that I am starting to get the hang of it, there is a very good chance that I am doing something wrong. I have all the authentication working correctly and except for this postback issue. I can login, navigate through pages that aren't accessible without being authenticated and I can logout without issue. If anyone has any suggestions it would be gr


View Complete Post


More Related Resource Links

LoginView DropDownList

  
LoginView DropDownList4 = LoginView2.FindControl("DropDownList4") as LoginView;DropDownList4.SelectedValue = "abc";Why not find SelectedValue?What am I doing wrong?

Dropdownlist not firing SelectedIndexChanged on first item with autopostback true

  
Hi: Has anyone ever found a work around for the well documented and well known bug, the dropdownlist bug? Specifically where the SelectedIndexChange event does not fire on the first listitem, althought both autopostback and enableviewstate are true? In other words, if the first three items in the dropdownlist are red, blue, green, if you select green, the SelectedIndexChanged will fire, but if you then select red, the first item in the ddl, the event will not fire. All listitems will fire the SelectedIndexChanged event, except for the very first listitem. The HACK has always been to include a dummy item as the first list time like"Select a Color" to get around the first item bug. I have got a situation where I cannot use that hack. Ideas?  TIA, Bill  

Required Validator disappears after autopostback set to true of a dropdownlist

  

My dropdownlist having data from database added with the following item:

DropDownList.Items.Insert(0, new ListItem("Please select", "0"));

My dropdownlist is inside of updatepanel. The autopostback=true is required.

The code is like following:

<asp:DropDownList ID="DropDownList" AppendDataBoundItems="True" runat="server"
                  DataTextField="Description" DataValueField="CommonCodeId" TabIndex="4" 
                    CssClass="drop_red_style1" AutoPostBack="True" CausesValidation="True" 
                     OnSelectedIndexChanged="DropDownList_SelectedIndexChanged">
                </asp:DropDownList>

<asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ControlToValidate="DropDownList"
                    Display="Dynamic" InitialValue="0" SetFocusOnError="true" ValidationGroup="Registration">Required</asp:RequiredFieldValidator>
Please guide me how to keep the required field validator message.


Required Validator disappears after autopostback set to true of a dropdownlist

  

My dropdownlist having data from database added with the following item:

 

DropDownList.Items.Insert(0, new ListItem("Please select", "0"));

 

My dropdownlist is inside of updatepanel. The autopostback=true is required.

The code is like following:

<asp:DropDownList ID="DropDownList" AppendDataBoundItems="True" runat="server"
DataTextField="Description" DataValueField="CommonCodeId" TabIndex="4"
CssClass="drop_red_style1" AutoPostBack="True" CausesValidation="True"
OnSelectedIndexChanged="DropDownList_SelectedIndexChanged">
</asp:DropDownList>

<asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ControlToValidate="DropDownList"
Display="Dynamic" InitialValue="0" SetFocusOnError="true" ValidationGroup="Registration">Required</asp:RequiredFieldValidator>
Please guide me how to keep the required fie

Disabling ViewState for DropDownList and using AutoPostback with SelectedIndexChanged

  

The sites I mantain are using way too much ViewState and I'd like to reduce that so the size of the page is reduced.  I've done a lot to remedy this but I have an issue relating to DropDown lists that use AutoPostbacks.

I have a dropdown list with a lot of list items and a good part of the ViewState usage is to hold the list item data.  If I disable ViewState and set the AutoPostBack property to true, the page will post back and in the page load I am trying to repopulate the dropdown list with cached data.  However, it seems that the SelectedIndexChanged event doesn't fire when EnableViewState="false".

Is it possible to make this work without enabling ViewState for the drodown list?


Dropdownlist AutoPostBack="true" NOT Firing in IPhone

  

Hi everyone,

This is really weird...I have a ASP.NET page for mobile view.

On that page I have this part:

<td><asp:DropDownList ID="DropDownLocation" runat="server" AutoPostBack="true" OnSelectedIndexChanged="test" 
                            appenddatabounditems="True" style=" font-size:large; vertical-align:middle;" Width="170px">
                    <asp:ListItem value="Houston">Houston</asp:ListItem>
                    <asp:ListItem value="El Paso">El Paso</asp:ListItem>
                    <asp:ListItem value="Austin">Austin</asp:ListItem>
                    <asp:ListItem value="Boise">Boise</asp:ListItem>
                    <asp:ListItem value="Washington">Washington</asp:ListItem>
            </asp:DropDownList>

While testing this on normal computer using IE7 IE8 it fires the AutoPostBack Control.

BUT TESTING IN IPHONE THIS DOES NOT FIRES....

ALSO THE DISPLAY IS WIERD BECAUSE A SEPARATE BOX APPEARS AT THE BOTTOM TO SELECT THE LIST.

What am I doing wrong?

Thank you in advance!

 

 


jQuery: Styling DropDownList Alternating Items (Rows)

  
In the following example, I will show how you can style any asp:dropdownlist very easily.

The example demonstrates how you can change alternating row items background color, using the fadeTo() to add a nice touch in the dropdownlist. You can change alt rows with a couple lines.

Working with DropDownList and ListBox Controls in ASP.NET

  
"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

ASP.NET DropDownList Web Control, Part 1

  
Anybody with much experience in ASP has written an include file function for populating the contents of a SELECT dropdown list with entries from a database. Some of the more advanced users have even gone so far as to add caching to their function to reduce database hits for these rarely changing menu options. Naturally, these same techniques are going to be used with ASP.NET, but with a new programming object model. ASP.NET provides a web control, the DropDownList, which can be used for the same purposes as our custom built SELECT tag from Classic ASP.

Declaring a DropDownList in ASP .Net

  
A DropDownList is also commonly known as combo box. It can contain multiple data members, but unlike a normal list box the users can choose only one value from this control. Though the functionality of this DropDownList is much like a Single Row Select List Box, a DropDownList can save a lot of GUI space as it is rendered on a Single line and is expanded only when the user clicks on the Control

Multiple Column Dropdownlist for the ASP.NET DataGrid

  
Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

ASP.NET Multiple Selection DropDownList with AJAX HoverMenuExtender

  
Recently, I was looking for a multiple selection dropdownlist control for my new project. After spending some time researching for it, I decided to put together all my finding in one web user control. This web user control consists of an ASP.NET AJAX HoverMenuExtender, JavaScript, StyleSheet and CheckBoxListExCtrl . The final product will work with or without a MasterPage and you can drag and drop more than one instances of the control on to the page.

How to bind GridView and DropDownList controls using DataTable object

  
In .net framework 2.0, you can load a DataTable in memory by consuming a data source using a DataReader. In this version you will find the flexibility in accessing the DataReader means write access code once and use again and again using DataReader. To see the functionality of DataTable consider an example that is created using VS2005.

How to bind TemplateField DropDownList with ArrayList?

  

Hi Expert!

  I'm trying gridview templateField DropDownList bind with arraylist. When i set bindsource i got this error. "//Error Object reference not set to an instance of an object."

My Sample .aspx

<asp:TemplateField HeaderText="Type">
                    <FooterTemplate>
                        <asp:DropDownList ID="_grvcboType" runat="server" Width="117px" DataTextField="Display" DataValueField="Value">
                        </asp:DropDownList>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="ser

how to make a dropdownlist looks like google search box

  

dear all...

any idea how to do that ?


Thnx in advance


styling dropdownlist problem

  

Dear All,

im facing a problem while styling my ddl, what i did is:

<div><asp ropDownList ID="DropDownList1" runat="server" style="background-color:Transparent;" Width="100%">
    </asp: dropDownList></div>

<div class="stlGradient">
<asp ropDownList ID="DropDownList1" runat="server" style="background-color:Transparent;border:none;" Width="100%"></asp: dropDownList>
</div>

the DIV style is having a bg image repeated X.

now this worked on Firefox
on google Chrome: the border gone but the background still white
on IE 7: nothing happend

thanks for helping.


dropdownList CSS

  

Hi,

Does anyone know what is the asp:dropdown's css is? I'm trying to make my ajax's comboBox to look the same as asp dropdown's css but I can't seem to find the default dropdown's css.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend