| Author: Sathish 10 Oct 2008 | Member Level: Silver | Rating:  Points: 4 |
foreach (li As ListItem in rbl.Items)//rbl is the id of radionbuttonlist { li.Attributes.Add("onclick", "javascript:showPopup();"); }
Add a javascript function as below:
function showPopup() { alert("Onclick is called"); window.open(<Needed Url>); }
In the above code, the url of the popup window has to be given inside window.open()
|
| Author: divya 10 Oct 2008 | Member Level: Gold | Rating:  Points: 3 |
thanku sathish, Can u tell me in which event we write this code. When i use this code it is showing an error Compiler Error Message: CS1515: 'in' expected
|
| Author: gomathinayagam 10 Oct 2008 | Member Level: Gold | Rating:  Points: 5 |
add this code into ratio button event : foreach (li As ListItem in rbl.Items)// change rbl into your ratio buttonlist name { li.Attributes.Add("onclick", "javascript:showPopup();"); }
add below javascript in your design view. (in head section) <script language="javascript" type="text/javascript"> function showPopup() { alert("Onclick is called"); window.open(<Needed Url>); } </script>
Gomathi Nayagam
Please Rate my answer if it has helpful to you
|
| Author: Venkat 15 Oct 2008 | Member Level: Silver | Rating:  Points: 1 |
Hi divya, U can write that in page_load event itself.
|
| Author: archana 02 Nov 2008 | Member Level: Gold | Rating:  Points: 5 |
Hi divya,
Add the following code in your page_load event foreach (li As ListItem in rbl.Items)// change rbl into your ratio buttonlist name { li.Attributes.Add("onclick", "javascript:showPopup();"); }
Add the follwoing code in <head> section(in design view of your web page)
<script language="javascript" type="text/javascript"> function showPopup() { alert("Onclick is called"); window.open(<Needed Url>); } </script>
|