Web Forms :: Deselect Initial Selected Value In Dropdownlist?

Mar 10, 2009

I have a dropdownlist which is bound to datatable. After databinding, first item in the list is automatically selected. I have tried ClearSelection() and SelectedIndex = -1 to deselect initial value. But I still can't.



ADVERTISEMENT

Set Dropdownlist Selected Value On Initial Page Load

Jul 22, 2010

I posted a similar question previously, but none of the answers worked and I've been scouring all over the web trying to find a solution. My situation, I have a Edit Window webform with a dropdownlist (Note: to avoid confusion, I'm using Telerik extensions only to decorate the webform):

<%@ Page Language="VB" CodeFile="EditFormVB.aspx.vb" Inherits="EditFormVB" %>
<%@ Register Namespace="CustomBoundField" TagPrefix="custom" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Edit Pop-up</title>
</head>
<body class="">
<form id="form1" runat="server">
<div>
<script type="text/javascript">
function CloseAndRebind(args) {
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit() {
GetRadWindow().close();
}
</script>
<asp:ScriptManager ID="ScriptManager2" runat="server" />
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Vista" DecoratedControls="All" />
<br />
<br />
<asp:DetailsView ID="DetailsView1" DataKeyNames="ID" runat="server" AutoGenerateRows="False"
GridLines="None" DataSourceID="detailsSqlDataSource" Height="50px" Width="125px"
BorderWidth="0" CellPadding="0" CellSpacing="7">
<Fields>
<asp:BoundField DataField="TS_DESCRIPTION" HeaderText="TS_DESCRIPTION" SortExpression="TS_DESCRIPTION" />
<asp:BoundField DataField="TS_TITLE" HeaderText="TS_TITLE" SortExpression="TS_TITLE" />
<asp:CommandField ShowEditButton="True" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>--%>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Vista" />
<br />
<br />
<asp:DetailsView ID="DetailsView1" runat="server" Height="400px" Width="745px"
AutoGenerateRows="False" DataKeyNames="TS_ID" DataSourceID="SqlDataSource2"
EnableModelValidation="True">
<Fields>
<asp:TemplateField HeaderText="Category">
<EditItemTemplate>
<%--<asp:DropDownList ID="TTCategory" runat="server" DataSourceID="ReqCategoryData" SelectedValue='<%# Bind("TS_NAME") %>' />--%>
<asp:DropDownList DataSourceID="ReqCategoryData" DataTextField="ReqCategory" DataValueField="ReqCategory"
ID="reqCategoryDropDown" runat="server" AppendDataBoundItems="true" AutoPostBack="true" >
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField ButtonType="Button" EditText="Update" ShowEditButton="True"
ShowCancelButton="True">
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>
</Fields>
</asp:DetailsView>
</div>
</form>
</body>
</html>

And in the code behind, I'm setting the datasource for the dropdownlist and using a function to query the DB for the name of the value I want to set as the selected value when the page loads initially: Partial Class EditFormVB Inherits System.Web.UI.Page

Public Shared category_Name As String = ""
Dim ddlDataSource As New SqlDataSource
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
DetailsView1.DefaultMode = DetailsViewMode.Edit
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Page.Title = "Editing record"
''Setup DropDownList SqlDataSource
ddlDataSource.ID = "ReqCategoryData"
Page.Controls.Add(ddlDataSource)
ddlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("TTPRODReportsQuery").ConnectionString
ddlDataSource.SelectCommand = "SELECT TS_NAME AS ReqCategory FROM dbo.TS_SELECTIONS WHERE (TS_FLDID = 5299 AND TS_STATUS = 0) ORDER BY TS_NAME"
Dim args As New DataSourceSelectArguments
ddlDataSource.Select(args)
''Set max length of Title field to 70 characters
Dim dvrTest As DetailsViewRowCollection = DetailsView1.Rows
Dim TitleTB As TextBox = dvrTest.Item(0).Cells(1).Controls(0)
TitleTB.Attributes.Add("onkeydown", "isMaxLen(this)")
TitleTB.Attributes.Add("maxlength", "70")
Dim myDDL As DropDownList = DetailsView1.FindControl("reqCategoryDropDown")
''Perform dropdown list population operations
If Page.IsPostBack = False Then
Dim ticket_ID As String = getDataKey(DetailsView1)
''Fetch Category ID
Dim sqlText As String = "SELECT TS_REQCATEGORY FROM USR_ITFAC WHERE (TS_ID = " + ticket_ID + ") "
Dim reqDataReader As SqlDataReader = GetDataReader(sqlText)
reqDataReader.Read()
Dim category_ID As String = reqDataReader(0)
''Fetch Category name using the categoryID and set as selected value in dropdown list
sqlText = "SELECT TS_NAME FROM TS_SELECTIONS WHERE (TS_ID = " + category_ID + ") "
reqDataReader = GetDataReader(sqlText)
reqDataReader.Read()
category_Name = reqDataReader(0)
myDDL.DataBind()
myDDL.Selectedvalue = category_Name //<--this value gets set only when debugging,
End If
End Sub
Private Function GetDataReader(ByVal sqlText As String) As SqlDataReader
Dim dr As SqlDataReader
Dim sqlConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("TTPRODReportsQuery").ConnectionString)
sqlConn.Open()
Dim sqlCmd As SqlCommand = New SqlCommand(sqlText, sqlConn)
dr = sqlCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Return dr
End Function
End Class

The dropdownlist does get populated appropriately, however when I attempt to set the value, it doesn't reflect when the page loads; the dropdownlist just gets populated and no value is set to selected in the markup, so the first value is shown by default. The odd thing is that when I'm debugging, the value appears to get set when I step through the function, it's as if the selectedvalue is getting reset as soon as the function exits and proceeds to load the page.

SOLUTION: Had to add a separate function that is called onLoad from the DropDownList after the after Page_Load is done executing. Still unresolved is why the the DropDownList rebinds after the Page_Load.

IN HTML:
<asp:DropDownList DataSourceID="ReqCategoryData" DataTextField="ReqCategory" DataValueField="ReqCategory"
ID="reqCategoryDropDown" runat="server" AutoPostBack="true" OnLoad="DDL_DataBound">
IN CODE-BEHIND
Public Shared category_Name As String = ""
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Page.Title = "Editing record"
''Setup DropDownList SqlDataSource
ddlDataSource.ID = "ReqCategoryData"
Page.Controls.Add(ddlDataSource)
ddlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("TTPRODReportsQuery").ConnectionString
ddlDataSource.SelectCommand = "SELECT TS_NAME AS ReqCategory FROM dbo.TS_SELECTIONS WHERE (TS_FLDID = 5299 AND TS_STATUS = 0) ORDER BY TS_NAME"
Dim args As New DataSourceSelectArguments
ddlDataSource.Select(args)
''Set max length of Title field to 70 characters
Dim dvrTest As DetailsViewRowCollection = DetailsView1.Rows
Dim TitleTB As TextBox = dvrTest.Item(0).Cells(1).Controls(0)
TitleTB.Attributes.Add("onkeydown", "isMaxLen(this)")
TitleTB.Attributes.Add("maxlength", "70")
Dim myDDL As DropDownList = DetailsView1.FindControl("reqCategoryDropDown")
''Perform dropdown list population operations
If Page.IsPostBack = False Then
Dim ticket_ID As String = getDataKey(DetailsView1)
''Fetch Category ID
Dim sqlText As String = "SELECT TS_REQCATEGORY FROM USR_ITFAC WHERE (TS_ID = " + ticket_ID + ") "
Dim reqDataReader As SqlDataReader = GetDataReader(sqlText)
reqDataReader.Read()
Dim category_ID As String = reqDataReader(0)
''Fetch Category name using the categoryID and set as selected value in dropdown list
sqlText = "SELECT TS_NAME FROM TS_SELECTIONS WHERE (TS_ID = " + category_ID + ") "
reqDataReader = GetDataReader(sqlText)
reqDataReader.Read()
category_Name = reqDataReader(0)
myDDL.DataBind()
End If
End Sub
Protected Sub DDL_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
If Page.IsPostBack = False Then
Dim myDDL As DropDownList = DetailsView1.FindControl("reqCategoryDropDown")
myDDL.Items.FindByValue(category_Name).Selected = True
End If
End Sub

View 1 Replies View Related

Web Forms :: Deselect Selected Date On Second Click?

Feb 5, 2011

I am selecting multiple dates from a calendar control, asp.net. I want the user to be able to deselect a date if he/she click on the date a second time ,, is it possible ,, how can i do that?

View 5 Replies View Related

Web Forms :: Deselect All Previously Selected Dates On Button Click Event?

Feb 1, 2011

I am selecting multiple dates on a calendar control ,, and then i insert them into DB. The problem happens after i insert, if i want to add new list of dates, once i start selecting on calendar all last selected dates appear (get selected on calendar) Does this mean these dates are saved in Session or what? Here is the code I am using:

[Code]....

View 5 Replies View Related

Web Forms :: How To Set DropdownList Initial SelectedIndex

May 1, 2006

I have a form with a dropdownlist named ddlCustomer. When the page loads I want to set the selectedindex to the 1st item in my ddl and then call a routine that updates the form to the data for that customer. I have tried the following code, but the ddl selectedindex remains at -1. How do I get this to change?

[code]....

View 15 Replies View Related

Web Forms :: How To Set Initial Value Of Dropdownlist In User Control

Dec 29, 2009

I have tried to construct a user control named EventCategory, that holds 2 dropdownlists to select an event category. Depending on the selection in the first dropdownlist, the second dropdownlist must be repopulated with items corresponding with the first dropdownlist selection.Here is my control :

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="EventCategory.ascx.cs" Inherits="EventCategory" %>

<table border="0">
<tr> [code]...

This works fine for a simple web page, but when i place the user control in a InsertItemTemplate of a FormView and I change the
mode of the FormView to FormViewMode.Insert by an ImageButton in the page where the FormView is located I can not initial select
a dropdownlist item through the Category property of the user control. I know it is because the formview is switched to insert mode during a postback so the IsPostBack block of the OnPreRender override gets skipped. Is there a better way to wtite the user control so that I can select an initail value in a dropdownlist that works also in a template of a FormView.

View 1 Replies View Related

Web Forms :: Dropdownlist Selectedvalue Always Fires Initial Value Instead Of Selection?

Feb 15, 2011

dropdownlist selectedvalue not firing.

It shows the inital value after i selected the value from dropdown box and submitted

HTML Code:

<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>

.CS File:

Protected void page_load()
{
if (!IsPostBack)
{
Label_Testing.Text = DropDownList1.SelectedValue;
Label_Testing1.Text = DropDownList1.SelectedIndex.ToString();......

View 4 Replies View Related

SQL Reporting :: How To Select/deselect Records In Report And Export The Selected Records Into Excel

Jun 10, 2010

my requirement is that SSRS 2005 report should show all records with checkboxes(or can be by any other means of flagging ?) .

Now the records for which checkboxes are checked or flagged are only to be included in the exported excel sheet or pdf .

View 2 Replies View Related

Web Forms :: DropDownList - Page Loads Initial Value Should Blank Until Clicking The Dropdown Button

Jul 10, 2010

i have dropdownList Binded to a data source and its working fine But want i want to do is when the page loads its initial value should Blank until clicking the dropdown button

View 6 Replies View Related

How To Change The Initial Value Of A DropDownList

Mar 22, 2011

I know that this question has been asked here before and I tried to implement the solutions I have found here but without success

View 2 Replies View Related

Forms Data Controls :: Dropdownlist Selected Value Of The Selected Item?

Dec 4, 2009

I can assign the selecteditem to the dropdownlist of the repeater, how can i set the value of the below selectedItem to empty because i don't want to save the text "name" to the database.

my code behind:

foreach (RepeaterItem data in repeater1.Items)
{
((DropDownList)data.FindControl("ddl_name")).SelectedItem.Text="name";
}

View 2 Replies View Related

State Management :: Viewstate And Dropdownlist / Initial Selection Is Lost Each Time The Page Refreshes

Jan 13, 2011

I have a simple search page with a drop down list that I would like the value to persist on refresh..basically the user will select their location from the dropdownlist and this will be used to populate a gridview. After this the page is set to refresh at a set interval and use the same location data initially selected by the user. However the initial selection is lost each time the page refreshes.

p.s system is to old for ajax!

<meta http-equiv="Refresh" content="300" />
<script runat="server">
Dim connectionString As String = ConfigurationManager.ConnectionStrings("****").ConnectionString
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
Dim conn As SqlConnection
conn = New SqlConnection(connectionString)
Dim Locationcommandtext As String
Locationcommandtext = "SELECT * FROM [Location] ORDER BY [Location]"
Dim loccomm As SqlCommand
loccomm = New SqlCommand(Locationcommandtext, conn)
Dim reader As SqlDataReader
Try
conn.Open()
reader = loccomm.ExecuteReader()
Locations.DataSource = reader
Locations.DataValueField = "LocationID"
Locations.DataTextField = "Location"
Locations.DataBind()
Catch ex As SqlException
Response.Write("SQL Error:
" & ex.ToString())
Finally
conn.Close()
End Try
Else
'"Viewstate should kick in here"
End If
End Sub
</script>

View 6 Replies View Related

C# - Disable Or Enable 2nd Dropdownlist In Aspx Based On Selected Choice Of The 1st Dropdownlist Box

Apr 15, 2010

I am having a problem with disabling DropDownList based on the chice of 1st DropDownList, there is no post back occuring, and it is a template based web app here is the current code:

<script type="text/javascript">
$(function() { var dropDownList1 = $('#<%= ddlUserType.ClientID %>');
var dropDownList2 = $('#<%= ddlMember.ClientID %>'); dropDownList1.change(function(e) {
if ( jQuery("#ddlUserType").val() != "ETOC") dropDownList2.removeAttr('disabled'); e.preventDefault();
else
dropDownList2.removeAttr('enabled'); e.preventDefault(); }
} );
</script>

what is happening now is page is blank and if I remove the above code everything shows, where I am going wrong. here is the plain and final javascript code which worked:

<script language="javascript">
function CheckDropDownState(lstbox)
{
if (lstbox.selectedIndex == 3) { document.forms[0].ddlMember.disabled = 1; }
else { document.forms[0].ddlMember.disabled = 0; }
}
</script>

and thew .aspx code: <asp:dropdownlist id="ddlUserType" runat="server" onclick="CheckDropDownState(this);"></asp:dropdownlist>

View 2 Replies View Related

Web Forms :: Have Deselect Function To Radiobuttonlist?

Oct 19, 2008

I want to let the user have 2 option:

1. Only can select one of the item from the radiobuttonlist
2. Not select any item

But, i found that the radiobutton cannot deselect the item once it has been selected. (This cause my option 2 cannot work) How to have a deselect function to the radiobuttonlist?

View 6 Replies View Related

Web Forms :: How To Deselect ListBox Programmatically

Nov 22, 2009

Is there any way to deselect a listbox Programaticaly?

View 4 Replies View Related

Web Forms :: Select Checkbox To Deselect Other?

Apr 15, 2010

ive 3 CheckBoxes I'd like to only let the user select one at a time so each one must be able to deselect the others when checked. how would i Do this?

View 3 Replies View Related

Disabling Dropdownlist Inside A Gridview Based On Value Selected On Another Dropdownlist?

Jan 11, 2011

what i m trying is i hav two dropdownlists inside the gridview... namely say ddonsiteoffsite and ddhours... now what i want is if the selectedtext of ddonsiteoffsite is "onsite" the ddhours should b disabled... i tried the code snippet but ... its not disabling the ddhours... can someone help me please..

<asp:TemplateColumn HeaderText=" OnSite/OffSite" >
<ItemTemplate>
<asp:DropDownList ID="ddOnsiteOffside" runat="server" onchange="ToggleOnOff(this)">
[code].....

View 2 Replies View Related

Dropdownlist's Selected Index Value Is Not Printing The Selected Value

Jan 13, 2009

.Aspx Page
<asp:DropDownList
ID="ddlkeyword"
runat="server"
Width="204px"
DataTextField="Form"
DataValueField="Form"
OnSelectedIndexChanged="ddlkeyword_SelectedIndexChanged"
>
</asp:DropDownList>
<asp:Button
ID="Button1"
runat="server"
Text="Submit"
Width="110px"
OnClick="Button1_Click"
/>
my aspx.cs
protected
void Page_Load(object sender,
EventArgs e)
{
fillddlkeyword();
}
protected
void Page_Init(object sender,
EventArgs e)
{
}
private
void fillddlkeyword()
{
string StrSql =
"Select distinct(formName)as formName from tbl_form";
oDB.RunDBQuery(StrSql, out oRS);
DataTable dt =
new
DataTable();
dt.Columns.Add("Form");
if (oRS.HasRows)
{
while (oRS.Read())
{
DataRow dr = dt.NewRow();dr["Form"]
= oRS["formName"].ToString();
dt.Rows.Add(dr);
}
oRS.Close();
}
oDB.Close();
// ddlkeyword.DataTextField = dt.Rows[0].ToString();
//ddlkeyword.DataTextField =
ddlkeyword.DataSource = dt;
ddlkeyword.DataBind();
//GridView1.DataSource = dt;
//GridView1.DataBind();
}
protected
void Button1_Click(object sender,
EventArgs e)
{
}
protected
void ddlkeyword_SelectedIndexChanged(object sender,
EventArgs e)
{
fillddlkeyword();
Response.Write(ddlkeyword.SelectedItem.ToString());
}

View 4 Replies View Related

Web Forms :: Mutually Exclusive Checkboxlist Or Deselect Radiobuttonlist?

Dec 16, 2004

I was about to use a radiobuttonlist to offer three items, but then I realized that the user would need some way to deselect all items. So I decided to use a checkboxlist with the three items. How do I make the items mutually exclusive, while maintaining the ability to deselect all once one's been selected?

View 7 Replies View Related

Forms Data Controls :: Select / Deselect Checkboxes In A Grid?

Jan 5, 2010

I am using a gridview where there are 6 cols and the last col consist of checkboxes. I wrote a code such that all the checkboxes in the col are selected or deselected at once by clicking the header checkbox. Now the issue is since I am using paging for the Gridview, once I select the checkboxes in the last col and go for the next page and come back to the previous page the checkboxes are deselected. I want to keep the checkboxes selected even after pagination.

View 1 Replies View Related

Web Forms :: Treeview - Auto Select / Deselect All Sub Nodes - When Parent Clicked

Sep 23, 2008

If you have a treeview like below:

+ Parent Node
+child 1
+child 2
+child N

How do you auto select/deselect all nodes including the parent node?

View 4 Replies View Related

Web Forms :: Set Selected Value Of Dropdownlist?

Sep 30, 2009

I have a dropdownlist that I populate in my .cs file when the page is loaded, however how do I make the selected value of the dropdownlist to be a specific value? For instance I populate my ddl with the values of 'month' and since its now september, I want the ddl to display 'september' as the value that is shown on the ddl, and only when the user clicks the ddl arrow button, will the list of months appear.

View 16 Replies View Related

Should The Selected Index Or Selected Value Be Used To Set A Dropdownlist

Nov 26, 2010

I am binding months to a list 0-13 items default selection is 0 months duration, and years 0-8 items and 0 years is the default selection.As I know there are always going to be 12 months in a year, I could use selectedvalue or selectedindex without any perceived problem. Is there a reason why I should not use either/or of the two properties to select a list item?

View 2 Replies View Related

Web Forms :: DropdownList And Setting Selected Value?

Jul 1, 2006

I have built a simple web page using VB .NET 2005, (and Visual Studio 2005) with a dropdownlist. The datasource for the dropdownlist is a SqlDataSource which I dragged on to form in design view. I am pulling a list of about ten records from a sql server 2000 database table. When I run the page, it works fine (dropdownlist shows the 10 or so items from the database when I click the dropdown button).

Now, what I want is to set the value in that drop down box in VB code so that when the web page displays, I can control which of those 10 or so items is selected in the dropdowlist. So I use the Page_Load event and put a statement in there the sets the SelectedValue. But now when I run the web page, I get an error indicating the item I am trying to set is not in the list. I know the item is in the list coming from the database, but I suspect it is a timing issue - that when I try to set the SelectedValue in the PageLoad event, the SqlDataSource control has not populated the list for the DropDownList yet.

Should I put the code that sets the SelectedValue somewhere else besides the Page_Load event?

View 7 Replies View Related

Web Forms :: Setting Dropdownlist Selected Value

Jan 15, 2010

My problem is I need to set selected value of a drop down list to a value I retreive from a database. The example only has a know value.


Below is the HTML and Code.
<asp:DropDownList
id="ddlCatogory1st1"
DataSourceID="srcCatogory1st1"
DataTextField="CategoryName"
DataValueField="CategoryID"
AutoPostBack="true"
Runat="server" />
<asp:sqldatasource id="srcCatogory1st1"
ConnectionString="server=(local);database=db;Trusted_Connection=true"
SelectCommand="SELECT CategoryID, CategoryName FROM Categories WHERE ParentCategoryID is null ORDER BY CategoryID"
Runat="server" ></asp:sqldatasource>
Sub Page_Load()
DISPLAY_CATEGORY()
End Sub
Sub DISPLAY_CATEGORY()
ddlCatogory1st1.DataBind()
ddlCatogory1st1.Items.FindByValue("A").Selected = True
End Sub

When I run this page I get

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 222:
Line 223: Sub DISPLAY_CATEGORY()
Line 224: ddlCatogory1st1.DataBind()
Line 225: ddlCatogory1st1.Items.FindByValue("A10").Selected = True
Line 226: End Sub

Even if I take out the databind I get the same error.

View 30 Replies View Related

Web Forms :: Dropdownlist Not Displaying The Selected Value?

Sep 20, 2010

drpdwncity.SelectedItem.Text = READER("CITY").ToString.Trim

i am using the above code

when the dropdown is displayed it shld display the vlaue from the databse , but here it displays the first value instead

View 6 Replies View Related

Web Forms :: Save DropDownList Selected Value?

Oct 8, 2010

How can I save dropdownlist selected value? (mabey into cookie?)I have a language selection dropdown, but on page reload it resets te value.

View 9 Replies View Related

Web Forms :: Fetching DropDownList Selected Value?

Sep 10, 2010

I'm having issues getting the selecteditems and value after Databinding a dropdown list. I have a button event with dropdownlist2.Selecteditem.text, but will always get the "-- Select --" as the SelectedItem.text ?

[Code]....

View 9 Replies View Related

Web Forms :: Dropdownlist - Default Value Is Not 'selected Value'?

Jan 9, 2009

i have created a dropdown list that is populated from a sqlserver datasource.

i have a separate sql command which uses the dropdownlist.selected value as a parameter and returns the command value to a label.

it mostly works fine but with one problem. when the page loads, the label value is null, because it doesn't seem to treat the dropdownlist default value as a selected value. when i use the dropdownlist to select a value, this is fine and the label begins to display the expected value.

is there anyway I can make the default value when the page is loaded act like a manually selected value, so the label control never displays a null value?

View 8 Replies View Related

Web Forms :: Check For Different Selected Dropdownlist Items?

Oct 12, 2009

I have a page with 5 drop down list controls. Each control has the same 10 list items.

When the user clicks a button to submit, how can I check to make sure there are 5 different items selected?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved