C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

Display a popup window while selecting an item in a radiobutton list control


Posted Date: 10 Oct 2008      Posted By: divya      Member Level: Gold     Points: 1   Responses: 5



Hi friends,
I am working in asp.net.In my application, I have a radio button list. Now I want to display a popup window while selecting a particular item in the list. CAn any one give me a code for displaying the pop up window. It is urgent.





Responses

Author: Sathish    10 Oct 2008Member Level: SilverRating: 2 out of 52 out of 5     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 2008Member Level: GoldRating: 2 out of 52 out of 5     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 2008Member Level: GoldRating: 2 out of 52 out of 5     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 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 1

Hi divya,
U can write that in page_load event itself.



Author: archana    02 Nov 2008Member Level: GoldRating: 2 out of 52 out of 5     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>



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Display the value in letters
Previous : Urgent !! Start SQL JOB from C# Database Application
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use