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

Joined
Oct 11, 2006
Messages
2
Reaction score
0
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,
 
Joined
May 6, 2008
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top