| | |
drop down list selected index change doesn't work in mozilla
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
Hi
i want to bind a drop down list on the other drop down list selected index change event. i m using the following code---
ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
function is written in a seperate js file.
this works in IE but not in Mozilla... plz give me the solution so that it will work in Mozilla also
Thanks
i want to bind a drop down list on the other drop down list selected index change event. i m using the following code---
ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
function is written in a seperate js file.
this works in IE but not in Mozilla... plz give me the solution so that it will work in Mozilla also
Thanks
if i put that function ( which is written in a seperate js file) in the same file then it works...
i have included the js file also, but if this function is written in the js then it is not working,
please solve my this problem also
and thanks 4 solving my background-color code problem...
bbye
i have included the js file also, but if this function is written in the js then it is not working,
please solve my this problem also
and thanks 4 solving my background-color code problem...
bbye
Thanks & Regards
Umang
Umang
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
This is because you are compiling your page before the javascript runs. Try adding the javascript to your page before you call your code. Example is below:
ASP.NET Syntax (Toggle Plain Text)
If Not Page.IsPostBack Then If Not Page.IsClientScriptBlockRegistered("IncludedJavascript") Then Page.RegisterClientScriptBlock("IncludedJavascript", "<SCRIPT Language=""JavaScript"" src=""javascriptincludedfile.js""></SCRIPT>") End If ddlid.Attributes.Add("onchange","javascript:callfunction(this);") End If
Last edited by SheSaidImaPregy; Nov 8th, 2007 at 1:03 pm.
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
if you wish to know more about this stuff, microsoft has a good article on it.
http://msdn2.microsoft.com/en-us/library/aa478975.aspx
http://msdn2.microsoft.com/en-us/library/aa478975.aspx
Hi, i m using the following code but it is not working...
if(!Page.IsPostBack)
{
if(!Page.IsClientScriptBlockRegistered("scriptcode"))
{
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
}
}
actually that drop down is pasted on a user control and the user control is pasted on a page. i have written this code on the both page user control and the actual page, but it is not working....
what should i do???
if(!Page.IsPostBack)
{
if(!Page.IsClientScriptBlockRegistered("scriptcode"))
{
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
}
}
actually that drop down is pasted on a user control and the user control is pasted on a page. i have written this code on the both page user control and the actual page, but it is not working....
what should i do???
Thanks & Regards
Umang
Umang
if i write on the page
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
Response.Write("<script>alert('hit');</script>");
it shows the message hit.
but if i write the same code on the user control it doesn't show the message.
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
Response.Write("<script>alert('hit');</script>");
it shows the message hit.
but if i write the same code on the user control it doesn't show the message.
Thanks & Regards
Umang
Umang
![]() |
Similar Threads
- drop down list question. (ASP.NET)
- How to make selected index zero for dropdown list box in java script..? (JavaScript / DHTML / AJAX)
- Populate One Drop Down List From Another (ASP.NET)
- Populating a Drop-down List (PHP)
- please anybody to help Dropdownlist selected index problem (ASP.NET)
- view employee info for the employee selected from the drop down list (PHP)
- How to get a selected index from checklistbox (ASP.NET)
- Passing a drop down list item's value (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: How to calculate and compare DateTime with Integer(c#)
- Next Thread: Pass value from one page to other page
| Thread Tools | Search this Thread |
.net 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer c# c#gridviewcolumn cac checkbox class commonfunctions compatible confirmationcodegeneration content countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deployment development dgv dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash formatdecimal forms formview gridview gudi homeedition iframe iis javascript jquery listbox microsoft mouse mssql multistepregistration nameisnotdeclared news objects opera panelmasterpagebuttoncontrols problem redirect registration relationaldatabases reportemail rotatepage schoolproject security sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice youareanotmemberofthedebuggerusers






