.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Font on Page Becomes Bold After Javascript Alert -- Why?

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
In .Net 3.5   I have a web page that has several checkboxes, text boxes, dropdown boxes etc on it.  When a user clicks on the search button, I run some basic validation on the page. If any validation fails, I invoke a javascript alert letting them know what they did wrong and I return them to the page. However, when the page reloads, all of the text on the page is now larger and bold, even the text inside the menu and which resides in a master page.  I removed every instance of the word "bold" from the project but it still becomes bold after the alert fires. Any idea what could be causing this to happen?  It shouldnt matter but here is a sample of the alert I use: Response.Write("<script language='javascript'>alert('You must check at least one column to display');</script>") Any help is greatly appreciated. thanks

View Complete Post

More Related Resource Links

Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

ASP.NET Proxy Page - Used for Cross Domain Requests from AJAX and JavaScript

The article ASP.NET Proxy Page - Used for Cross Domain Requests from AJAX and JavaScript was added by Aamir Hasan on Thursday, August 19, 2010.

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn't allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull content

Check Page Referer in Javascript?

Is there a way to execute a javascript function based on the page referer?So if the user comes from an internal page then doesnt execute but if it comes from an external page then it does?Thanks

collapsiblepanelextender, master page and javascript

does anyone have any working code that uses javascript to open and close a cpe when the CPE is in a masterpage?  It seems like the javascript never is able to find the CPE when it is on a master page.  I have an DropDownList on the page and when certain items are selected, i want to collapse or expand when others are selected.  It seems to work fine on a regular page, but not when it is a page nested in a master page.  It is adding a suffix to the CPE and javascript is unable to find it.  any help would be much appreciated!<script type="text/javascript" language="javascript">        function ExpandCollapse() {            var e = document.getElementById("<%=DropDownList.ClientID%>")            var strUser = e.options[e.selectedIndex].value;            var collPanel = document.getElementById("<%=CPE.ClientID%>")            if (collPanel = null)                alert('No panel found');            if (strUser = "Collapse")    

Javascript: detect Page.IsValid and IsPostBack

In a client-side function that initializes a 3rd-party control, I want to detect whether the page is being loaded for the first time or as the result of a post back.  If it is a post back, I want to know if on posting the original page was valid. I tried using Page_ClientValidate() within the function, but that validates the page, and fires the RequiredFieldValidator, which isn't what I want to do at all! many thanks,    

How does "Alert Me" work with simple web page?

In another post (http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/83ec9566-0357-4f40-9388-f364e87c1bd4/)  I've learnt how to make simple web pages in MOSS 2007. Then I want to "subscribe" some users using the "alert me" function but it doesn't seem to work.  Do I miss something or "alert me" doesn't work with simple web pages?  

Getting Selected Item in radiobuttonlist on content page using javascript

I am trying get the selected value from a radiobuttonlist on a content page using javascript. Here is my initial code, which does not recognize the control. The js is located in a separate file and there is a link on the content page pointing to the js file. Thanks, function GetRadioButtonValue() { var radio = document.getElementsByName('<%=rblPayType.ClientID%>'); for (var j = 0; j < radio.length; j++) { if (radio[4].checked) { alert(); return; } else { return; } } }    

I installed .net FrameWork 4.0 (for Vista/Windows 7) and my Desktop Font is BOLD! (sometimes)

So at first, I installed the below: http://www.microsoft.com/downloads/details.aspx?FamilyID=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en Which is .net framework 4 (web installer), then I believe I tried the standalone. But then after I did the Redistributable 2.0 installer for Windows XP SP2, but I have SP3, does that just mean its included already? (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en)   My friend told me I needed this before I install Office 2010... I dont know!! So after I installed these different .net frameworks and then office. I have Mozilla crashing me, I disabled the framework assistant plug-in and still happens. Then, my FONT for desktop and start menu icons turns (larger/bold) but not within folders, only what shows without clicking into anything.... so.. 1.System Restore is not an option, that restore point is overwritten now... 2. This is not an appearance tab/settings issue with a larger DPI set or anything like that... Because, sometimes I click on my computer to restart and the font is all fine and will continue to be, othertimes, some program or something causes this to happen, I restart the PC and then its fine again... Can anyone tell me what I did wrong and how to fix it, easily.. if possible :) I have searched all over and while I've noticed people with simila

Newbie tring to use alert with master page - nothing happens

 I have an aspx content page that has btnCreateorUpdate. When clicked I want  to show an alert box. Unfortunatelythe alert box doesn't appear . I don't know whether the problem is that the button is runat="server", or that the button is in an update panel  or something else. I have my master page and content page markup below. Thanks<%@ Page Title="Deal Milestones" Language="VB" MasterPageFile="~/Protected/ThreeColLiquid.master" AutoEventWireup="false" EnableViewState="true" CodeFile="DealMilestones.aspx.vb" Inherits="Protected_DealMilestones" EnableTheming="true" Theme="PrimaryTheme" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <%@ MasterType virtualPath="~/protected/ThreeColLiquid.master"%> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_Head" Runat="Server"> <script type="text/javascript"> $(document).ready(function() { $("btnCreateorEdit").click(function() { alert("Hello world!"); }); }); </script> </asp:Conten

Client Javascript runs, but then page errors out when clicking on a control that uses postback

Using this script on a button click <script language="javascript"> function printdiv(printpage) { var headstr = "<html><head><title></title></head><body>"; var footstr = "</body>"; var newstr = document.all.item(printpage).innerHTML; var oldstr = document.body.innerHTML; document.body.innerHTML = headstr + newstr + footstr; window.print(); document.body.innerHTML = oldstr; return false; } </script> After it is done, I can't click on my calendar control.  I was hoping to add somethign that would force a refresh in the script, but nothing I do works. Any thoughts?  Thanks! 

Javascript error when attempting to switch page layouts in SharePoint 2010

I hope I put this in the correct forum. I am experiencing the following error when attempting to change the layout of an existing SharePoint 2010 page. But it does not seem to happen on all page types, just publishing pages. This error is happening on both the development server and both test servers. I have look in to the logs, since if it a javascript error there was nothing, which would be expected but I had to try. I have look at the cui.js file but was unable to spend enough time trying to figure out what exactly is going on in this file. Error being received ... Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E; InfoPath.3) Timestamp: Tue, 7 Sep 2010 21:10:54 UTC Message: Object required Line: 2 Char: 6422 Code: 0 URI: http://devintranet2010.myconexus.ca:85/_layouts/cui.js?rev=wvoVpqlQb30nGo4DjDk8Kg%3D%3D   If anyone has any ides or can point me in a direction that will allow me to productively continue my investigation, the information would be greatly appreciated. Regards Kyle

execute a javascript function in code page

I use js function in source page and call that js function as below in Source page<a href="javascript:;" onclick="openwin('Sample.aspx?DID=<%#Eval("UID") %>', '', '700','300','yes'); return false ">I need to call this function from vb.net code page.....how to solve this ........???????????Give ur ideas...............

Accordion control access in Javascript using Content page

Hi, I struggled with some javascript issues, and discovered that the problem seemes to come from a failed ajax control access.Here's my problem:I have a master page and a content page.In my content page, I have an accordion with 2 panes.1rst pane: a textbox and a validation button;                     I want the button to fire javascript function without reloading page (using "return false;");In my master page, I put my ToolkitScriptManager.In my content page, I put my script containing the functions.The problem is that it seems like I can't access the accordion control in my js functions, whereas I can access my textbox value...Here is my source:<%@ Page Language="C#" MasterPageFile="~/Default.master" Title="CLEOR RH | Home" CodeFile="Default.aspx.cs" Inherits="Default_aspx" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server"> <script type="text/javascript"> var step1 = false; function pageLoad() { var accCtrl = $find('AccordionCtrl_AccordionExtender');

How to make bold/regular font text the same width

Hi! In Excel the width of texts in bold font cells have the same width as regular font ones. My question is how to do that programmatically (in a DataGridView, labels, paint event, anywhere...). I can do this if I draw the string twice in the paint event (1 pixel shift for the second draw), but it requires 2 drawings of course, which I think is not too efficient. Is there any other solution? Some trick in creating the bold font? Thank you, Feri

How to call javascript function in master page

helloi have javascript file 'script.js' where i have writt en a function for print. but this function is working fine if i am not using master page in my report page but the question is i want to use master page for my report page where i am calling javascript function but it is not working . Do help me regarding MasterPage and Javascript function.

How do I add an external javascript and CSS to the head of a Sharepoint page?

I am a web designer and I was asked to design a page for our internal sharepoint server. I created a spry page using Dreamweaver CS5, and I need to add the .js and .css to the head of the sharepoint document. I created the sharepoint page, and added my html code to the html webpart, the content displays, but I need to add the external files to the <head> tag so the content displays correctly. I tryed to open the page in SP Designer 2007, but I can't edit or add to the head tag. Help
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend