•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,611 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,441 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 7914 | Replies: 10
![]() |
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,058
Reputation:
Rep Power: 4
Solved Threads: 61
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:
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,058
Reputation:
Rep Power: 4
Solved Threads: 61
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax asp browsers code combo custom data developer development dom dropdownlist email europe feed firefox gecko home internet internet explorer leak linux memory microsoft module mozilla msdn net networking news office open source reader reuse skin software sql survey teleworking theme thunderbird users weather web windows workflow work xml xoap
- 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



Linear Mode