473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Runtime Exception Occurs

malav123
217 100+
Hi,
I am using one Legend for one section of Filtering that contains one button also and i want to put some validation in that section on that button's click event but when i calls the javascript function on Button click event runtime Exception occurs, So where is the problem... The error i am getting is "run time exception Object Excepted "...
Apr 4 '08 #1
28 2633
gits
5,390 Expert Mod 4TB
without posting the code related to that problem it would be guesswork for anybody to give you an answer ... so please post the related code ...

kind regards
Apr 4 '08 #2
malav123
217 100+
without posting the code related to that problem it would be guesswork for anybody to give you an answer ... so please post the related code ...

kind regards

My code of javascript is given below,
Expand|Select|Wrap|Line Numbers
  1. function CheckFilterDates(f)
  2. {
  3.  
  4.   if(!(f.ctl00_ContentPlaceHolder1_txtsortFrom.text==""))
  5.     {
  6.  
  7.         if(f.ctl00_ContentPlaceHolder1_txtsortTo.text=="")
  8.         {
  9.             alert("Please Enter The Value of Remaining Date");
  10.             return false;
  11.          }
  12.      }
  13.  
  14.      if(!(f.ctl00_ContentPlaceHolder1_txtsortTo.text==""))
  15.     {
  16.         if(f.ctl00_ContentPlaceHolder1_txtsortFrom.text=="")
  17.         {
  18.             alert("Please Enter The Value of Remaining Date");
  19.             return false;
  20.          }
  21.      }
  22. }
  23.  
I have also used "getElementById" but it's still giving me same error...
Apr 4 '08 #3
gits
5,390 Expert Mod 4TB
do you have a formelement with:

Expand|Select|Wrap|Line Numbers
  1. name = "ctl00_ContentPlaceHolder1_txtsortFrom"
in your case or:

Expand|Select|Wrap|Line Numbers
  1. id = "ctl00_ContentPlaceHolder1_txtsortFrom";
when you use getElementById();?

kind regards
Apr 4 '08 #4
malav123
217 100+
do you have a formelement with:

Expand|Select|Wrap|Line Numbers
  1. name = "ctl00_ContentPlaceHolder1_txtsortFrom"
in your case or:

Expand|Select|Wrap|Line Numbers
  1. id = "ctl00_ContentPlaceHolder1_txtsortFrom";
when you use getElementById();?

kind regards


Yes my formelement id is
Expand|Select|Wrap|Line Numbers
  1.  id = "ctl00_ContentPlaceHolder1_txtsortFrom";
and i am using f.id, instead of this i also tried the getElementById() but in the both case i am getting the same error....
so where is the problem ??
i am calling this function with button's onclick event...
Apr 4 '08 #5
gits
5,390 Expert Mod 4TB
in case the id is correct, which you could check when having a look at the rendered page (just use view source in the browser) and search for your formelement with that id ... then:

Expand|Select|Wrap|Line Numbers
  1. var id = 'ctl00_ContentPlaceHolder1_txtsortFrom';
  2. var n  = document.getElementById(id);
  3.  
have to give you a reference to that node for variable n. could you please post the call of document.getElementById() and the rendered code for your node?

kind regards
Apr 4 '08 #6
malav123
217 100+
in case the id is correct, which you could check when having a look at the rendered page (just use view source in the browser) and search for your formelement with that id ... then:

Expand|Select|Wrap|Line Numbers
  1. var id = 'ctl00_ContentPlaceHolder1_txtsortFrom';
  2. var n  = document.getElementById(id);
  3.  
have to give you a reference to that node for variable n. could you please post the call of document.getElementById() and the rendered code for your node?

kind regards


Ya it's true, but the same thing is working well with button outside of <fieldset> means the button which is outside the legend, the problem is not with the id because if i callls simple blank function without body then also it giving me same error.... means if i calls
Expand|Select|Wrap|Line Numbers
  1. function CheckDate(f)
  2. {
  3.              alert("Date");
  4. }
  5.  
then also it is giving me same error...
so where is the problem ? please suggest me where is the problem ?
Apr 4 '08 #7
gits
5,390 Expert Mod 4TB
hmmmm ... is any other action triggered with the button click? do you have a testpage where i could have a look at? how are the event-handlers attached to the buttons?

kind regards
Apr 4 '08 #8
malav123
217 100+
hmmmm ... is any other action triggered with the button click? do you have a testpage where i could have a look at? how are the event-handlers attached to the buttons?

kind regards
No, Only one action is triggered with Button click.... that is
Expand|Select|Wrap|Line Numbers
  1.  
  2. btnFilter.Attributes.Add("Onclick", "return CheckFilterDates(this.form)")
  3.  
and my button is within the fieldset,
Expand|Select|Wrap|Line Numbers
  1. <fieldset>
  2. <legend>Filter</legend>
  3. <asp:Button ID="btnFilter" runat="server" Text="Filter" />
  4. </fieldset>
  5.  
I am not getting from where this error occurs....
Apr 4 '08 #9
gits
5,390 Expert Mod 4TB
are you sure that your parameter this.form is correct here?
Apr 4 '08 #10
malav123
217 100+
are you sure that your parameter this.form is correct here?

Yes i am using this.form with another button attributes and working proper.... i have also tried only this but still getting same error....
Apr 5 '08 #11
gits
5,390 Expert Mod 4TB
what about using no param at all? does the problem persist in that case? ... could you try the application in FF and have a look at the error-console ... probably we get a much better error description with that ...

kind regards
Apr 5 '08 #12
malav123
217 100+
what about using no param at all? does the problem persist in that case? ... could you try the application in FF and have a look at the error-console ... probably we get a much better error description with that ...

kind regards
Yes i also tried the no param but still i getting the same error, FF i have not tried yet...
Apr 7 '08 #13
gits
5,390 Expert Mod 4TB
have you tried it now? what does the console says? ...

kind regards
Apr 8 '08 #14
malav123
217 100+
have you tried it now? what does the console says? ...

kind regards

Yes it works well in FF, so now how to debug my problem in IE...? and this problem is only occurs with button which is within the legend...
Apr 10 '08 #15
gits
5,390 Expert Mod 4TB
... do you have a link to a testpage? or could you post the html source when it is laoded to IE ... have a look at view source in the browser and paste the code here ... so that we may see the code and test it?

kind regards
Apr 10 '08 #16
malav123
217 100+
... do you have a link to a testpage? or could you post the html source when it is laoded to IE ... have a look at view source in the browser and paste the code here ... so that we may see the code and test it?

kind regards
Yes i have link for that page and source code of that all legend is given below,
Expand|Select|Wrap|Line Numbers
  1. <fieldset>
  2.                         <legend style="color:Maroon; font-size:medium;">Filters</legend>
  3.                             <table class="content" width="100%">
  4.                                     <tr>
  5.                                         <td width="5%">
  6.                                             <span id="ctl00_ContentPlaceHolder1_lblsortfname">FName</span>
  7.                                         </td>
  8.                                         <td width="30%">
  9.                                             <input name="ctl00$ContentPlaceHolder1$txtsortFName" type="text" id="ctl00_ContentPlaceHolder1_txtsortFName" />
  10.                                         </td>
  11.                                         <td width="5%">
  12.                                             <span id="ctl00_ContentPlaceHolder1_lblsortlname">LName</span>
  13.                                         </td>
  14.                                         <td width="30%">
  15.                                             <input name="ctl00$ContentPlaceHolder1$txtsortlname" type="text" id="ctl00_ContentPlaceHolder1_txtsortlname" />
  16.                                         </td>
  17.                                         <td width="5%">
  18.                                             <span id="ctl00_ContentPlaceHolder1_lblsortstatus">Status</span>
  19.                                         </td>
  20.                                         <td width="10%">
  21.                                             <input name="ctl00$ContentPlaceHolder1$txtsortstatus" type="text" id="ctl00_ContentPlaceHolder1_txtsortstatus" />
  22.                                         </td>
  23.                                         <td width="5%">
  24.                                             <span id="ctl00_ContentPlaceHolder1_lblsortlofficer">L.O.</span>
  25.                                         </td>
  26.                                         <td width="10%">
  27.                                             <input name="ctl00$ContentPlaceHolder1$txtsortlofficer" type="text" id="ctl00_ContentPlaceHolder1_txtsortlofficer" />
  28.                                         </td>
  29.  
  30.                                     </tr>
  31.  
  32.                                     <tr>
  33.                                         <td>
  34.                                             <span id="ctl00_ContentPlaceHolder1_lblsortFrom">From</span></td>
  35.                                         <td>
  36.                                             <input name="ctl00$ContentPlaceHolder1$txtsortFrom" type="text" id="ctl00_ContentPlaceHolder1_txtsortFrom" style="width:70px;" />
  37.                                             <img id="imgFrom" src="../../images/calendar.gif" alt="" onclick ="showCalendarControl(ctl00$ContentPlaceHolder1$txtsortFrom)" />
  38.                                         </td>
  39.  
  40.                                         <td>
  41.                                             <span id="ctl00_ContentPlaceHolder1_lblsortTo">To</span></td>
  42.                                         <td>
  43.                                             <input name="ctl00$ContentPlaceHolder1$txtsortTo" type="text" id="ctl00_ContentPlaceHolder1_txtsortTo" style="width:70px;" />
  44.                                             <img id="imgTo" src="../../images/calendar.gif" alt="" onclick ="showCalendarControl(ctl00$ContentPlaceHolder1$txtsortTo)" />
  45.                                         </td>
  46.  
  47.                                         <td colspan="4" align="right">
  48.                                             <input type="submit" name="ctl00$ContentPlaceHolder1$btnFilter" value="Filter" id="ctl00_ContentPlaceHolder1_btnFilter" />
  49.                                         </td>
  50.                                     </tr>
  51.                                 </table>
  52.                          </fieldset>
  53.  
and my Validation is on the Filter Button...
Apr 10 '08 #17
malav123
217 100+
... do you have a link to a testpage? or could you post the html source when it is laoded to IE ... have a look at view source in the browser and paste the code here ... so that we may see the code and test it?

kind regards
Sorry that i don't know about how to post code in proper format...
Apr 10 '08 #18
gits
5,390 Expert Mod 4TB
hi ...

i just cannot see something wrong ... could you give the link to the testpage ... so that we could test it online?

kind regards
Apr 11 '08 #19
malav123
217 100+
hi ...

i just cannot see something wrong ... could you give the link to the testpage ... so that we could test it online?

kind regards
Means about which link you are asking ? we still not put it online, my project is still in developing face...
Apr 11 '08 #20
gits
5,390 Expert Mod 4TB
Yes i have link for that page ...
sorry ... i thought you had a link to test the page online ... so that problem seems to be strange ... let me summarize:

1. IE gives you the error FF does not und works properly?
2. only when the button is placed within the fieldset? even when you call an empty handler function?
3. the only javascript code that gets executed onclick is the onclick-handler function assigned to the button?

did you test it on different machines and IEs? may be its a problem with your local IE installation?

kind regards
Apr 11 '08 #21
malav123
217 100+
sorry ... i thought you had a link to test the page online ... so that problem seems to be strange ... let me summarize:

1. IE gives you the error FF does not und works properly?
2. only when the button is placed within the fieldset? even when you call an empty handler function?
3. the only javascript code that gets executed onclick is the onclick-handler function assigned to the button?

did you test it on different machines and IEs? may be its a problem with your local IE installation?

kind regards

Ok i will try on diifferent machine and than i will tell....
Thanks...
Apr 14 '08 #22
malav123
217 100+
Hi,
it's also giving the same error on the different machine....
Apr 17 '08 #23
malav123
217 100+
sorry ... i thought you had a link to test the page online ... so that problem seems to be strange ... let me summarize:

1. IE gives you the error FF does not und works properly?
2. only when the button is placed within the fieldset? even when you call an empty handler function?
3. the only javascript code that gets executed onclick is the onclick-handler function assigned to the button?

did you test it on different machines and IEs? may be its a problem with your local IE installation?

kind regards

Hi,
You was right now my all validation for buttons giving me same error that is js runtime error... so what can i do, should i reinstall IE ???
Apr 17 '08 #24
gits
5,390 Expert Mod 4TB
nope not yet :) ... could you get alerts in your validation functions? if that is the case you should start to trace the elements that are used ... i mean whenever you use a html-node-reference just alert its tagName to see whether this works or not ... may be you could track the error this way? since you don't have a test-link i don't know what i could recommend instead ... since IE's js-debugging abilities are very limited ... may be tha MS IE Script Debugger may help?
Apr 17 '08 #25
malav123
217 100+
nope not yet :) ... could you get alerts in your validation functions? if that is the case you should start to trace the elements that are used ... i mean whenever you use a html-node-reference just alert its tagName to see whether this works or not ... may be you could track the error this way? since you don't have a test-link i don't know what i could recommend instead ... since IE's js-debugging abilities are very limited ... may be tha MS IE Script Debugger may help?
No i am not getting any alert also...in all the reference nodes it's giving the same error that is runtime js error... even if i calls simply without parameterized function and if i puts simple alert then also i m getting the same runtime js error...
Apr 18 '08 #26
gits
5,390 Expert Mod 4TB
could you try to avoid

Expand|Select|Wrap|Line Numbers
  1. btn.Attributes.add();
and write an onclick directly to the tag ... does the error persist in that case?

kind regards
Apr 18 '08 #27
malav123
217 100+
could you try to avoid

Expand|Select|Wrap|Line Numbers
  1. btn.Attributes.add();
and write an onclick directly to the tag ... does the error persist in that case?

kind regards
No i have not tried it yet.... ok i will try this and then i will reply...
thanks...
Apr 18 '08 #28
malav123
217 100+
could you try to avoid

Expand|Select|Wrap|Line Numbers
  1. btn.Attributes.add();
and write an onclick directly to the tag ... does the error persist in that case?

kind regards

Hi gits,
Sorry for late reply but my problem is solved yesterday i was working on another module for 20-22 days that's why i have not reply, i have reinstall the IE7 and now it's working well.... thanks for your kind response....
May 23 '08 #29

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Carsten | last post by:
Hi, I have a problem with instantiating a Web service. When the constructor for the proxy is called a SEHException is thrown. The call stack is shown below: ...
1
by: SHC | last post by:
Hi all, I did the "Build" on the attached code in my VC++ .NET 2003 - Windows XP Pro PC. On the c:\ screen, I got the following: Microsoft Development Environment An unhandled exception of type...
5
by: Peter Steele | last post by:
We have an application that when it runs in the IDE in debug mode an unhandled exception is occurring in a system header file associated with STL stirngs. The actual statement that crashes is ...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
1
by: IdleBrain | last post by:
Hello All: I have a project deployed to a client. The client reports me of a runtime exception occuring some times: Arithmetic Overflow It does not occur on my machine where I have the source...
3
by: Larry Herbinaux | last post by:
I have built an asychronous TCP Server that uses the thread pool. I have two levels of exception handling in case the handling of the inner catch block throws an exception. The outer catch block...
3
by: =?Utf-8?B?R3JhaGFt?= | last post by:
I've added 2 tracking services to the wf runtime; one is the standard SqlTrackingService: trackingService = new SqlTrackingService(<trackingConnectionString>); <workflow...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
in event log:.NET Runtime version 2.0.50727.312 - Fatal Execution Engine Error (7A062A61) (80131506) We have an application that seems to be throwing this error, but I can't seem to work out why...
0
by: =?Utf-8?B?VGhvbWFzIFR1dGtv?= | last post by:
An ASP.NET web project has recently began crashing WebDev.WebServer.exe with a System.Runtime.InteropServices.SEHException. The EventLog for the crash looks like this: Application ID:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.