Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: .net dropedown

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    156
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .net dropedown

    how to give onchange javascript validation for dropdownlist

    basically what I want to do is if user selecting selectedIndex=0 then don't refresh & don't call the server site function else refresh

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    If you are going to want it to autopost back, then you are stuck with it with the best of my knowledge

    just make sure that you are checking for IsPostBack to help on the loading process of the page.
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    attruíbutes

    for any javascript it's allways the same for each .Net control

    anyControl.Attributes.Add("OnClick","JavaScriptFunctionName")

    you will find everywhere a javascript for your case

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    angiras

    ebco does not want the page to autoRepostback with the option is zero. You can not stop that with JavaScript....
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but he says : don't refresh & don't call the server site

    then it's a validation ClientSide without postBack
    you can use your own Javacript or webControls validators

    same thing for a delete button in a datagrid You can use a javascript before submitting the page : "are you shure you want to kill this customer ?"
    if no there is no postback, if yes ... tool late
    Last edited by angiras; 11-20-2003 at 09:28 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •