|
Hi,
I have the following declarion in my ASP.NET page:
<asp:RadioButtonList
ID="RadioButtonListContactPref"
CssClass="caption"
runat="server"
DataTextField="Name"
DataValueField="CommonCodeID"
</asp:RadioButtonList>
The radio button list is populated from the database like (partial code):
RadioButtonListContactPref.DataSource = oCC;
RadioButtonListContactPref.DataBind();
My problem is I do not know how to detect a change if a different radio button is selected, please can some advise how to detect a change in radio button. If the default is Yes, and if some one clicked on No, then alert must be displayed saying something like "A different radio selection was made".
Thanks
Brendan
|
|
|
|
|
Just check the ClientID for your radiobutton list or name of your radiobutton list
now in your javascript getElementbyName(radiobutoon list Name);
it will return all controls with same name means radio buttons
Now iterate through each radio button and check whether it is selected or not now when any radiobutton is seleceted store that radiobutton index or name in a varaible that is declare out your javascript function (class level variable ). Now again iterate through it whenever radio button is seleted and check the stored value with newly selected varaible .
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
you can try this code...
This is JavaScript
<script type="text/javascript"><br />
function CheckChange()<br />
{<br />
var tags = document.getElementsByTagName('input');<br />
for(i=0;i<tags.length;i++)<br />
{<br />
name = tags[i].name;<br />
if(name == 'RadioButtonList1')<br />
{<br />
if(document.getElementById(tags[i].id).value == 'No')<br />
{<br />
if(document.getElementById(tags[i].id).checked == true)<br />
{<br />
alert("Selected No");<br />
break;<br />
}<br />
}<br />
}<br />
} <br />
}<br />
}<br />
Call this function as below..
<asp:RadioButtonList ID="RadioButtonList1" runat="server" onClick="CheckChange()"><br />
<asp:ListItem Selected="True">Yes</asp:ListItem><br />
<asp:ListItem>No</asp:ListItem><br />
</asp:RadioButtonList>
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi,
I am feching the records from arraylist using datarow.
One by One record fetch and stored it into the varibles.
Now I have 2 buttons one is Next and other is Prev.
I want to circulate the records by using the Next and Prev buttons.
on the Next button when click Next record will be display on the form and on the Prev button Previous record will be display.
I have 10 records in the arraylist.
It is like online exam paper.
Thanks,
sjs4u
|
|
|
|
|
Are you using any control to show the records like repeater,Gridview ?
If no then just create a session varaible, store the index of the reacord that you are showing when you click next increment that index by one and when say Prev decrement that record by one and fetch the record from your arraylist.Also check lower and upper bound of your arraylist
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Thanks Sandeep for a wonderfull solution.
Regards,
Sandeep
|
|
|
|
|
You can use a currency manager to navigate between records both ways within array list
http://support.microsoft.com/kb/316303[^]
For an incremental navigation you can use arraylist.Getenumerator method and enumerator.Movenext
|
|
|
|
|
Hi,
My cancel button code looks like this:
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="button" OnClick="btnCancel_Click" />
I need to add a Javascript method to the onclick event of this button, but the onclick event already has an event handler associated to it. What do I do now? I also tried the following but it did not work:
OnClick="return confirmExit();btnCancel_Click"
Please can someone advise?
Thanks
Brendan
<div class="ForumMod">modified on Thursday, February 14, 2008 2:58 AM</div>
|
|
|
|
|
You can do it in two way by registering the javascript from server and by writing in aspx itself
1. Button1.Attributes.Add("OnClick","javascript:JavascriptMethodName();")
2. <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="JavasscriptMethodname();" OnClick="Button1_Click" />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Thanks Sandeep
|
|
|
|
|
1 sql server,
1 class ,
1 Web.Config
1 Default.aspx
1 Default.aspx.cs
download link
www.evdenevenakliyatbul.com/DataAccess2.rar
Boya - Badana - Tadilat ve Tamirat Isleri Bir Yudum Kahve Molasi (Coffee) Dügün Nisan ve Gelinlik (wedding)
Google Reklamlarinizi Sadece Siz Yönetin Elektrik Proje Tesisat Projesi Çizimi Illere Göre Nakliyat Firmalari Istatistik
http://www.evdenevenakliyatbul.com
|
|
|
|
|
Hi,
I have developed a webservice which comprises a sinlge web method. This web method is used for document conversion. The return type of the web method is bytes. The web service is consumed in my web application and everything works fine. But when my colleague is trying to consume the same web service in my system to his web application an error is being thrown. My colleague added the web service to his application using the VS IDE. When accessing the web method after creating an object for the web service the following error is shown:
System.Net.WebException: The request failed with HTTP status 404: Not Found.
I tried to access the webservice by provinding the URL in IE then it works fine, so what are we missing? Do we have to do any addtional steps when consuming a webservice which is not in the same machine or same domain?
Any help is greatly appreciated,
gauthee
|
|
|
|
|
Client.DownloadFile("http://www.yahoo.com","C:\downloads\yahoo.html")
if i given like that yahoo.html downloaded in my C:\downloads\ physical when i run my aspx page in local host.
i run this coding in server this is not working i want to down files in a given path when i host my project into server.how can i do it
please any body can tell how to download pages into our system local physical directory.
This is haneef.............................................................
|
|
|
|
|
|
HI ALL,
Now I am facing a problem with webservice callback.We called a webmethod asynchronously from a webpage.Then the page will be rendered from the server to the client,but the result of the called method may be reaches the webservice after rendering the site.So the webservice become not able to send the result to webform.My question is how to inform the webform asynchronously without polling for its completion and too much delay?
Plz Help................
|
|
|
|
|
Hi,
VS 2003 is removing event handlers at random, I don't know why this happens or when this happens. I tried to put all handlers in separate function and call that function from OnInit(), still handlers are getting removed.
Has anyone faced this issue, I'd appreciate if you could throw some light in this issue.
Regards,
Blumen
|
|
|
|
|
Never came across such situation could you check AutoEventWireup Attribute of Page directive Don't know will work or not
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
its for a Windows Application
|
|
|
|
|
Then you are in wrong forum
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
how to find whether connection string tag is there or appsettings tag is there or not in the web.config file usign code behind
|
|
|
|
|
Just have to check nothing for ConfigurationSettings.appSettings["key"]
additionaly for other section you can use "System.Web.Configuration.WebConfigurationManager" namespace for loading web.config file and its sections
Nobody is perfect i'm Nobody
|
|
|
|
|
I am working on asp.net 2.0. I cannot find the property onMouseOver for the treeview.
Is there any other alternative so that when my cursor goes to the treenodes
an event should occur.
Can i get any sample code.
VanithaVasu
|
|
|
|
|
Are you talking about in Javascript ?
/***********************/
Parwej Ahamad
g.parwez@gmail.com
/***********************/
|
|
|
|
|
hi VanithaVasu,
I think you want to do collapse OR expand TreeView so you are requesting for OnMouseOverevent. If you wanna the same you can do in following way by changing style of each Visited OR Hover OR Selected node.
<asp:treeview id="TreeView1" runat="server" datasourceid="SiteMapDataSource1" imageset="Arrows">
<parentnodestyle font-bold="False">
<hovernodestyle font-underline="False" forecolor="#5555DD" backcolor="Yellow">
<selectednodestyle font-underline="False" forecolor="#5555DD" font-bold="True">
<nodestyle font-names="Tahoma" font-size="10pt" forecolor="Black" horizontalpadding="5px" nodespacing="0px" verticalpadding="0px">
If i am wrong than than you wanna call a javascript function OnMouseOver event of TreeView. Like this way
<asp:treeview id="TreeView1" runat="server" datasourceid="SiteMapDataSource1" imageset="Arrows" onmouseover="javascript:function();">
Hope this will Help You.
Thanks & Regards
Dilip Kumar Vishwakarma
Dilip Kumar Vishwakarma
Programmer
.Net Consulting
If this post is answer for your query then don't forget to mark as an answer.
|
|
|
|
|
Hi I have 3 fields based on i like to show chart diagram in my site,
I dont know2 how to create chart based on 3 fields,
Those fields i am getting from my table:
My table format is:
Source |-| Destination|-| Distance
Chennai |-| Delhi |-| 2000
Chennai |-| Assam |-| 6000
Assam |-| Chennai |-| 5500
Gaziabad|-| Mundka |-| 7000
Like this i have datas
The Source Field have to come X Axis
Destination Field have to come on Y Axis
Based on the distance the Size have to be show,
How to do that?,
Plz any one guide me
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|