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


Post New Web Links

How to set context key in Cascaded dropdown using javascript

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :ASP.Net
 
I want to set the context key of a cascaded dropdown during pageload. means if tab index = 0 then contextkey = "1" otherwise 2;  function pageLoad(){ var index = $find("KMTabContainer").get_activeTabIndex(); alert (index); if (index ==0) { alert('Ravi'); var cntxtKey = $find("bScenario"); var ckey ="1" // alert(ckey); alert(cntxtKey.get_contextKey()); cntxtKey.set_contextKey(ckey); alert(cntxtKey.get_contextKey()); } else { var cntxtKey = $find('bScenarioAdd'); cntxtKey.set_contextKey("2"); } }  


View Complete Post


More Related Resource Links

Javascript code to copy selected dropdown item to clipboard

  
Does anyone know how I can do this to get the text onto the clipboard?  <input id="Copy" type="button" value="Copy Url" runat="server" onclick="copy();" style="vertical-align: top;" visible="false"/><script type="text/javascript"> function copy() { var sel = document.getElementById("DropDownList1"); var text = sel.options[sel.selectedIndex].value; ??? } </script> </body>  

validate both dropdown and listview checkboxes+Javascript

  
I have checkboxes in one column of  listview and outside the listview I have one  dropdown and one button.when I dont check any checkboxes in listview  fire a validation "Select any one checkbox" on button click.simirarly when I check Checkboxes in listview and I'm leaving to select dropdown fire a validation"Select any item in the dropdownlist" on button click.how to validate both controls(checkboxes in listview and dropdown) when those are not selecting. Many thanks in advance.

javascript alert window when dropdown field is selected,

  

hi

is there a way..where an alert window prompts up to remind the user to select a checkbox when one field in dropdown is selected..for example

there is a dropdown field(Status)  which contains (Tobe confirmed, confirmed and rejected ), when confirmed is chosen..an alert window prompts up reminding the user to select a checkbox(send email) - Yes or No. It is not compulsory for the user to select the checkbox, but if Yes is chosen, the workflow will send an email


asp dropdown - onchange="javascript: select_country(this.options[this.selectedIndex].text);"

  

With a regular form drop-down box I can use the onchange event to fire off some javascript with out a page refresh or postback to the server. The above code is not working with an asp drop-down control. Is there a way to make this work? 

I have form that hides and shows different textboxes depending on selected values in a dorp-down but it does cause a postback which refreses the screen I want to do this wiithout refreshing the screen and figured Javascript and hide and show divs etc would work.


<script type="text/javascript" language="javascript">
function select_country(selectedcountry)
{
var country = selectedcountry;

if(country == "United States")
{
//do nothing;
}
else
{
// hide state drop-down and the state label.
// code goes here...............
} } </script>




The drop-down:

<asp:DropDownList ID

Javascript code to search item in dropdown.

  

Hi,

I want to know how to select dropdown item using javascript when user type in dropdown? 

The dropdown may be binded with a datasource or have same value list.

I have asp.net2.0 framework.

Please don't advise for using ajax.

My question is to know the way of doing this task only using JAVASCRIPT.

 

Please reply as soon as possible.


what is the syntax for populating dropdown in Javascript using web service?

  

Hi

I have written the web method in web service like this

 

 [WebMethod]
    public List<Location> FindAllCountries()
    {
        List<Location> locations = new List<Location>();
        string connectionString =
            "Data Source=.;Initial Catalog=Test;Integrated Security=True";
        using (SqlConnection connection = new SqlConnection(connectionString))
        {
            using (SqlCommand command = new SqlCommand())
            {
                command.Connection = connection;
                command.CommandText = "SelectAllCountries";
                command.CommandType = CommandType.StoredProcedure;
                connection.Open();
                using (SqlDataReader dataReader = command.ExecuteReader())
                {
                    Location location;
                    if (dataReader != null)
                        while (dataReader.Read())
                        {
                            location = new Location();
                            location.CountryID = (int)dataReader["CountryID"];
                            location.CountryName = Convert.ToString(dataReader["CountryName"]);
                            locations.Add(location);
                        }
                }
            }
        }
        return locations;
    }

I m calling the webservic

how to get dropdown list data VALUE FIELD property in JavaScript

  

hi

im getting  'ON' as value instead of its actual value


ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

  
This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Ajax Enabled Gridview using JavaScript in ASP.NET

  
Before explaining the article, I would like to thank all readers who read my article and voted for it. Your appreciation for my article gives me strength to write more good articles. Hope in future I will get your valuable comments and suggestions. Now I won't waste your time and come back to the topic. I have written this article on 'Ajax Enabled Gridview Using JavaScript in ASP.NET'. In this article, I will show you how to make a Gridview using a simple HTML table, JavaScript and XML HTTP for Ajax call without using any ASP.NET control.

Using Code

GridView Javascript Click Row and Ajax

  
This article shows 2 common tasks with the ASP.NET GridView: Binding a List (generic) of objects as DataSource and on clicking a row, getting the values of the selected row by a javascript function. In the example a List with User-objects is displayed. On clicking a row containing the data of a User-object, the Id of the object is used to get the address of the user by an Ajax-call and display it in a details-field.

Dropdown list in ASP.NET - How to get value selected

  
am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

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).

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

  
This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Combine, minify and compress JavaScript files to load ASP.NET pages faster

  
Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

Binding an array to dropdown list

  

I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      

 

allLinks = newAllLinks
        Me.DropDownList1.Items.Clear()
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks
        Me.DropDownList1.DataBind()


 

 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8
   System


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