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


Top 5 Contributors of the Month
satyapriyanayak
Kaviya Balasubramanian
SP
abhays
Sasi Prabhu
Post New Web Links

Retrieve SelectedValue from CascadingDropDown lists?

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :ASP.Net
 

I followed a tutorial yesterday to implement CascadingDropDown lists but I can't find many examples of how to retrieve their selected value.

Can this only be done using javascript?

Is there any way to access the SelectedValue of the CascadingDropDown lists in the codebehind?

I'm using them in an EditItemTemplate, in a DetailsView, on a master/details page.




View Complete Post


More Related Resource Links

DropDownList with CascadingDropDown no SelectedValue...?

  

Hi All,

I cannot get selected value from DropDownList in my codebehind, is there any possibility to get the value?


Below is which i am trying:

<asp:DropDownList id="DDL" AutoPostBack="False" runat="server">
 </asp:DropDownList>

 <cc1:CascadingDropDown ID="ccDD"
                                   ServiceMethod="Searchinfo"
                                   ServicePath="../../WebService1.asmx"
                                   TargetControlID="DDL"
                                   Category="Computer"
                                   PromptText="--Select----"
                                   runat="server">
                              </cc1:CascadingDropDown>


Here is my tow behind code and both are failed to get selected value.

'            With AjaxControlToolkit.CascadingDropDown
 Protected Sub FilterData()
        Dim frm As Control = Me.FindControl("searchbox").FindControl("ctl04") 'Form1 is the HTML
        For Each ctrl As Control In frm.Controls
            If TypeOf (CType(ctrl, Control)) Is AjaxControlToolkit.CascadingDropDown Then
                Dim ddl As AjaxControlToolkit.CascadingDr

AJAX CascadingDropDown Validation and SelectedValue

  

I am currently using 3 drop down lists (with objectdatasources) to enable my users to select/filter thru Report Topics - Report Sub-Topics - Report Sub-Topic Details.  I am also currently using validation (requiredfield) to make sure that if a drop down list is enabled, a selection must be made by the user before these selections are saved into a database.

This method works for me but is somewhat slow.  While looking for a quicker method for this I came across using the AJAX CascadingDropDown extender.   This seems to be the way to go HOWEVER I can not seem to get validation to work on the second 2 drop downs.  So here are my questions:

1. Is there a "native" way to validate a CascadingDropDown?  If not, how is it done?

2. Is there a better way of getting a SelectedValue from the CascadingDropDown?  Now I get something like "23:::Selected Report Topic:::".

3. Finally - is using the CascadingDropDown extender the best tool for this task - giving the end user the ability to filter down selections and then saving them to a database?

Any insight here would be appreciated.


Displaying SharePoint lists in Web Parts

  
When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

SharePoint Tutorial - Lists

  
A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

  
Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

How to retrieve data from SqlDataSource and pass to a variable?

  

Hi there,

I have a page in my website where there is very little code-behind. I only have two lines of code in Page_Load() and the rest of the code is declarative ASP.NET code. I have a FormView control which uses a SqlDataSource to get some order information. The SqlDataSource calls a stored procedure called usp_GetOrderDetails, here's the code for the SqlDataSource:

    <asp:SqlDataSource ID="sdsFormOrderDetails" runat="server" 
ConnectionString="<%$ ConnectionStrings:ForexDB %>"
ProviderName="<%$ ConnectionStrings:ForexDB.ProviderName %>"
SelectCommand="usp_GetOrderDetails" SelectCommandType="StoredProcedure"
UpdateCommand="usp_UpdateOrder" UpdateCommandType="StoredProcedure"
>
<SelectParameters>
<asp:ControlParameter Name="orderId" ControlID="grdOrders" PropertyName="SelectedDataKey.Value" />
</SelectParameters>
<UpdateParameters>
<asp:ControlParameter Name="orderId" ControlID="frmOrderDetails" PropertyName="SelectedValue" />
</UpdateParameters>
</asp:SqlDataSource>

Win32 Resources: Using C++ to Programmatically Retrieve a Global Cursor's Shape and ID

  

Getting global cursor information is useful when developing software that drives or gathers information about other UI-based applications, including information about a remote machine. This article describes a way to programmatically identify the current cursor's ID and bitmap at any point in time. The first technique described is based on polling for information and shows how to get the handle of the current global cursor. This handle will then allow you to get information about the cursor. You can also monitor WinEvents for changes to the global cursor.

Dmitri Klementiev

MSDN Magazine October 2001


Enabling/disabling CascadingDropDown using jquery

  

Greeting;

I have asp.net dropdownlist control with Ajax CascadingDropDown control.

I also I have asp.net checkbox control. I want to enable/disable CascadingDropDown when the checkbox checked/unchecked using jquery.

I tried diffrent ways but they did not work and if I want to set enable property for the dropdownlist to false it will not work so I have to set the CascadingDropDown enable property to false to disable it but I do not know how.

this is one of the code I tried:

<asp:CheckBox ID="chkWF" runat="server"  onclick="enableDDL"/>

<asp:DropDownList ID="WF" runat="server"></asp:DropDownList>

<cc1:CascadingDropDown ID="WF_CascadingDropDown" runat="server"
                   

How to retrieve image from DB with Linq and diplay in Image Control

  

Hi all-

 

I'm using the file upload to let the user upload a single file.  Here's the code I'm using to then upload to the DB.  How do I reverse this process and dowload the image into the control for it to display on a different page?

Here's my code for the upload - which I think works but can't confirm until I can see the download since all I see in the DB is "binary data"

'update DB with new Image 
        If FileUpload1.HasFile AndAlso FileUpload1.PostedFile.ContentLength > 0 Then
            'Read the file in to a byte Array.
            Dim filebyte As Byte() = FileUpload1.FileBytes
            Dim fileBinary As New System.Data.Linq.Binary(filebyte)
            Try
                Dim c3 = (From c In dc.ProductImages _
                          Where c.userID = userGuid _
                          Select c).FirstOrDefault

                c3.productImage = fileBinary
                dc.SubmitChanges()

            Catch ex As Exception
                Throw ex
            End Try
 
Here's my attempt at the retrieval, which isn't working:
Try
                    Dim currentImage = F

How to store and retrieve multiple values in a single session variable .

  

I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.


Forms based users being prompted for windows authentication login for My Sites photos in user lists

  
Here's an issue I didn't see coming for our forms based authentication users. 

We have a web application extended to an external url to handle forms based authentication for users outside of our domain. Our setup looks like this...

Internal Users/Windows Authentication - moss.domain.com
External Users/Forms Based - mossext.domain.com
My Site for Internal Users - mysites.domain.com

When our forms based users are accessing user lists, or discussion pages that display user pictures, they are getting a windows authentication login for our internal users (mysites.domain.com) who have populated their my site with personal photo.

How do we fix this? 

Updating Task Lists and Form Libraries From Workflow Form

  

There are actually two separate (I think) problems here. The scenario: I used the SharePoint Designer 2007 to create a workflow attached to a form library. When a form is submitted to the library, a To-Do-Item is created on a task list. The To-Do-Item is initially assigned to a GROUP. A user from the group then selects the name of an individual from a choice list in edit item. This person now becomes the Assigned To for the task.

What is needed is 1) To update the Assigned To column of the Form library when someone in the GROUP assigns the task to an INDIVIDUAL; and 2) To have the Due Date from the submitted InfoPath form propagate to the task list.

I've tried having one workflow try to do everything and also having a secondary workflow set up on the task list to do the task assignment update but have not been successful in solving either issue. I don’t think that I am really understanding how to Define Workflow Lookup when not working with the Current Item. I know what fields I want but I don’

Duplicate column names from forms in SharePoint lists

  

 

I'm in the process of migrating from a WSS 2 site to WSS 3/MOSS. On the old site I used an Infopath 2003 form for absence requests. During the migration I now use Infopath 2007. There wasn't any problem initially when the form was stored with the SharePoint form library. However, when I published the form as a content type from Infopath 2007 and then added that content type to the form library, there are two columns for each piece of data from the form. (One from the content type and one from the form list.) I relinked each old form (list content type) to the new AbsenceRequest content type and removed the original one from the list. However, the duplicate column names are still there. Since they came from the Infopath form, they are not editable or deletable from the SharePoint list management interface. The duplicate column names make it tough to build views since it isn't apparent which column to use in the form building UI. It can be determined form the overview display, but it is very cumbersome.

 

Does anyone know a way to get rid of the old, absolute, columns?

Programmatically retrieve data from the associated row in SharePoint and use the data to do math

  

I am trying to pull all of the associated data from a SharePoint list row to an InfoPath form repeating table.  I would like to select 1 unique value from the row and have the other fields auto-populate with the associated data from that row. 

Example:

SharePoint Columns and also names of InfoPath fields 1, 2, 3, 4, 5, 6, 7.

I have a dropdown that is connected to column 1 and I would like to select 1 and have it populate the rest of the fields from that row.  I am currently doing this with information and C# code from:  http://www.bizsupportonline.net/infopath2007/sharepoint-list-retrieve-value-same-row-repeating-table-infopath

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