ASP.NET 2.0 Radio button without postbacks, hiding panel information

Discussion in '.NET' started by dotnetjunkie, Oct 11, 2006.

  1. dotnetjunkie

    dotnetjunkie

    Joined:
    Oct 11, 2006
    Messages:
    2
    Hi,
    I have a payment and shipping information entry page in my application that
    has two sets of address fields. I have a radio button the users can set if
    the addresses are the same. That radio button does an auto postback which
    triggers an event to disable the second set of fields and fill in values.
    The client likes the way the page works, but not the performance.

    Now, i do not want to use AutoPostBack as the page refreshes everytime and is annoying. How can i implement this with javascript and using REgisterClientScriptBlock. WHere do i call REgisterClientSCriptBlock and what do i need to pass in it? How do i access the text boxes from the javascript.

    Sample code is appreciated.

    Thanks,
     
    dotnetjunkie, Oct 11, 2006
    #1
    1. Advertising

  2. dotnetjunkie

    dotnetjunkie

    Joined:
    Oct 11, 2006
    Messages:
    2
    i figured it out.

    Have fun
     
    dotnetjunkie, Oct 12, 2006
    #2
    1. Advertising

  3. dotnetjunkie

    priyadharsini

    Joined:
    May 6, 2008
    Messages:
    1
    hi
    Im also facing the same problem can u post the solution here

    i tried many ways but coulnt fix ..here is my code
    _______________________________________________________
    if (!IsClientScriptBlockRegistered("ScopeValue"))
    {

    string scriptString = "<script type='text/javascript' language='JavaScript'>";
    scriptString += "function getRadioValue(){";
    scriptString += "var test = document.getElementById('<%=rbtnScope.ClientID%>');";
    scriptString += "for(int i=0;i<test.length;i++)";
    scriptString += "{";
    scriptString += "if (test.Checked)";
    scriptString += "{";
    scriptString += "var text = test.Text;";
    scriptString += "var value = test.value;";
    //scriptString += "var text = test.options[document.getElementById('<%=rbtnScope.ClientID%>').Checked].Text";
    //scriptString += "var value = test.options[document.getElementById('<%=rbtnScope.ClientID%>').Checked].Value";
    scriptString += "}";
    scriptString += "}";
    scriptString += "</script>";
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ScopeValue", scriptString);
    }
    rbtnScope.Attributes.Add("onClick", "javascript:alert(value)");
    ________________________________________________
    any suggestions is appreciated
    Thanks in advance
     
    priyadharsini, May 6, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott D Johnson
    Replies:
    1
    Views:
    1,112
    Scott D Johnson
    Sep 27, 2006
  2. gregfocker@earthlink.net

    AJAX - Partial Postbacks are now Full Postbacks ?!!

    gregfocker@earthlink.net, Jan 25, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    460
    gregfocker@earthlink.net
    Jan 25, 2007
  3. tristan_sehgal@yahoo.co.uk

    Radio Button Column In GridView Causing Postbacks In Ajax

    tristan_sehgal@yahoo.co.uk, Mar 23, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    1,487
    tristan_sehgal@yahoo.co.uk
    Mar 23, 2009
  4. Matt
    Replies:
    2
    Views:
    408
  5. Hiten
    Replies:
    1
    Views:
    690
    Vidar Petursson
    May 26, 2004
Loading...

Share This Page