473,491 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

JavaScript to Reset page ASP.NET 2.0.

Hello,

I have a table with some controls in it, but it is not rapped in a form. I
also have a button for reseting the page. When I click the button, the page
resets, but I get the following error: "Done, but with errors on the page".
I am trying to figure out a way to use JavaScript in my master page that can
be used for all my content pages. Any help with this would be appreciated.

Thanks, sck10

<%@ Page Language="VB" StylesheetTheme="Default"
MasterPageFile="~/template/mpColumn02.master" CodeFile="ipm_survey.aspx.vb"
Inherits="ipm_survey" title="Untitled Page" Trace="false" %><asp:Content
ID="Content1" ContentPlaceHolderID="cphMainContent" Runat="Server">

<table width="95%" class="tblOutline">
<caption>IPM Survey Questions</caption>

<tr><td style="height:10px" colspan="5">&nbsp;</td></tr>

<!-- Question HRID -->
<tr visible="false">
<td style="width:4%; text-align:right;"><asp:Label ID="lblHRID"
Runat="server" /></td>
<td style="text-align:left;" colspan="4"><asp:TextBox id="txtHRID"
Columns="15" runat="server" />
&nbsp;<span class="RedM">(optional)</span></td>
</tr>

<!-- Question Region -->
<tr>
<td style="width:4%; text-align:right;"><asp:Label ID="lblRegion"
Runat="server" /></td>
<td style="text-align:left;" colspan="4"><asp:DropDownList
ID="ddlRegionType" runat="server" /></td>
</tr>

<td style="width:100px; text-align:center;"><a href="#"
onclick="reset();return false"
onmouseover="status='Reset';return true" onmouseout="status=''">
<img src="../../images/icons/b_clear_bold.gif" style="border-style:none;"
alt="Reset" /></a></td>
</table

Script from the Master Page
----------------------------------------------------
<script language="Javascript" type="text/Javascript">
<!--
document.myform.reset();
//-->
</script>


Jun 30 '06 #1
1 2010
Hi sck10,

Thank you for your post.

When you get the following error "Done, but with errors on the page" on the
status bar, you can double click on it to view a detailed description of
the error.

Javascript files or functions defined in master page can be used in content
page. But I saw that you didn't enclose the javascript code in a function,
which means it will run everytime the page loads, and since then the
document is not fully loaded, referencing controls on the page will result
error.

Actually the reset() function of html form can be called directly, you
don't have to define a function in master page and let the content page
call it.

At last, when ASP.NET merges the master page and the content page, the form
name gets changed to pre-defined 'aspnetForm', not the name you defined in
master page, this is by design. We can use 'document.forms[0]' to reference
the form.

Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
18446
by: Pete | last post by:
I have a site which is using sessions to pass data from one page through to the next. The problem that I have is that there are only two places where the session could/should be destroyed. This...
12
6505
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
6
13798
by: Geoff | last post by:
Here's the situation. I have a static html page which we want to update to include some dynamic content. I want a counter that keeps track of the number of times anyone presses the "add" button,...
16
23264
by: datactrl | last post by:
Hi, Is that posible to create a web page completely with javascript and open it without request to server? Please show a simple sample. Thanks in advance! Jack
4
1789
by: Marc | last post by:
Is there a way to produce 3 radio buttons, which when one is selected, enables 11 check boxes which are otherwise disabled (greyed out)? EXAMPLE: Option 1 --Radio buttons Option 2 Option 3 ...
13
3578
by: johnemmatty | last post by:
I am using an asp page in which i dynamically fill the ACTION property of the form. The problem is that whenever i try to redirect to a html page using the javascript:location, it is getting...
31
15304
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
1
2009
by: Joey | last post by:
Hey guys, here's what I have... To help manage browser windows with session state on the server, I have some javascript code in one of my master pages that gets planted into most (content) pages...
0
6980
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
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7364
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
5452
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,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.