.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

where i should put jscript code in aspx page, which created by inheriting a master page

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net

hi budies,

 i am creating a simple web portal, but i am stuck in a aspx page which created by inheriting master page ,

there is some jscript code, but i don't know where to put this code in that page.

please help out ppls. 

thanx in advance 

View Complete Post

More Related Resource Links

Sharepoint 2007 - Wiki site - New Pages Not Inheriting Custom Master Page


I am working on a SP site (MOSS not WSS) which is heavily customised away from the OOTB layout. I need to create a Wiki site, which was going well - I've created a master page which displays the miniconsole (this was not visible with our customised layout), and made it the default master page for the site. This has been applied to the two standard pages that come with the Wiki site, however when a new page is created, it seems to inherit the default.master, rather than my custom master page - thus not showing the miniconsole.

When I have created a new page, I am able to use SharePoint Designer to attach my custom master page to it, which works perfectly, however this will not be a viable option going forward as end-users create their new wiki pages.

How can I get the new pages to inherit my master page when they are created?


Where to write the code for mail in master page

below is my code. please anyone tell me where to write vbscript to send email after validating the fields<%@ Page Language="VB" MasterPageFile="~/Master.master" AutoEventWireup="false" CodeFile="Enquiry.aspx.vb" Inherits="Enquiry" title="Enquiry - MTM Active" %><asp:Content ID="Content1" ContentPlaceHolderID="ConPage" Runat="Server"><script type="text/javascript" src="Js/Blank.js"></script><script type ="text/javascript">function CmdSubmit_onclick(){if (fnValidate()==true)return true;else return false;}function fnValidate() {if(IsBlank(" Name",document.getElementById ("TxtName").value)==false)        {            document.getElementById ("TxtName").focus();            return false;         }        if(IsBlank(" Email",document.getElementById ("TxtEmailID").value)==false)        {            document.getElementById ("TxtEmailID").focus();            return false;    &n

Master page is reset to v4.master when new site is created.

Hi, I have a site definition which specifies my custom master pages like this: <Project... <Configurations> <Configuration ID="0" Name="Innovations" CustomMasterUrl="_catalogs/masterpage/Innovations.master" MasterUrl="_catalogs/masterpage/Innovations.master"> ... I have a site collection http://myserver/projects and a sub-site TestSite at http://myserver/projects/testsite based on that definition above. I save TestSite as a site template and then create a new site Test2 at http://myserver/projects/test2 from the saved template. All seems to be ok but new site master page is v4.master and not Innovations.master. What's wrong here? Of course I can manually change it to Innovation.master but isn't it supposed to be done automatically upon site creation?

close aspx page after executing code behind


I am working in vs 2008, C#.

Load event in my aspx page is having a set of database operations .So after completing those operations i want to close the aspx page.

for that i am calling 

window.close() methond onload event of the body. Its closing the aspx page but it is showing the confirmation message before closing the page.

I dont want to show that message box.

How can i claose an aspx page without showing any message?.

Pls help me



How do I get a new column I created to show-up in the DisplayForm.aspx page?

Here's a little introduction to how I got here:

Downloaded the WSS Help Desk application template and installed it and now my company wants to add a column to the ServiceRequests list called "Service Request Type".  So I created a new column and made it a choice of "Incident" or "Change".  I then customized the EditForm.aspx and NewForm.aspx to provide the new entry.  Other than losing the ability to attach documents the forms are working perfectly and collecting the data.  My problem is that when I open the DisplayForm.aspx and attempt to add a new row and use the <xsl:value-of select="@SRType" /> I don't see any values displayed.  Also, I can browse  the Data Source Library and click on Service Requests > Show Data and see the new list item but when I choose the button for "Insert Selected Fields as...", the Item is greyed-out.  

Tried manually inserting code based-on similiar entries but still no luck.  Here's what I have so far:

      <td width="190px" valign="top" class="ms-formlabel">
         <H3 class="ms-standardheader">
           <nobr>Service Request Type</nobr>
      <td width="400px" valign="top" class="ms-formbody"><

Create new aspx-page from code


Hello everyone.

I'm am looking for a general idea about the following:


My customer is looking for an application - a sort of webshop-like thingie, where each product has its own infopage with a unique URL.

He does NOT want an actual CMS.

I could - and probably will - use querystrings, like http://www.example.com/products.aspx?pID=21, and then get the content from the database, but is it possible - or rather possible without too much bother - to let the administrator input text via a webform, and then form code create a contentpage like http://www.example.com/product21.aspx

Have a nice weekend



How to create a code behind page when page was created in expressions web


 When an ASPX page is created and designed in Expressions Web (which has no code behind page check box), how do I add a code behind file in VWD2008? 

The help says the following:

Adding code-behind files in ASPX or ASCX files within a traditional ASP.NET 2.0 environment is very easy thanks to Microsoft Visual Studio. All you have to do is right-click the file in Visual Studio, either in Solution Explorer or in the designer, and select View Code. Visual Studio then creates a new code behind file (if one did not already exist)

but doing the above simply displays the ASPX page. 

I follow creating a code behind page when creating a new ASPX page in VWD2008 (although I have not done it) by simply checking the box.

Any ideas?



[Sharepoint 2007]Parse error when I add code behind the page to a normal aspx page ?


Hi all,

I dont need this form to be embedded into Sharepoint. I am adding this webpage into Sharepoint because i has issues due to cross-domain permission. I cannot call refresh sharepoint from my op up window  webpage. Therefore i want to add my webpage into the same domain as sharepoint.

I have added the webpage aspx form into Sharepoint from the sharepoint designer 2007. I would like to add code behind the page too.

What i have done at the moment was to create a project in visual studio for the code behind the page. I folloed this article :



Then i have added the dll intothe bin of my sharepoint site. i have also added in webconfig the dll.

However i got the following error :

Parser Error Message: The codefile attribute on the page directive is not allowed in this page.

Source Error: 

Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormOragniseMeeting.aspx.cs" Inherits="FormOrganiseMeeting.FormOrganiseMeetingCodeBehind" %>
Line 2: 
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





error.aspx page reports that Page.MasterPageFile = ~/masterurl/default.master not ~/_layouts/simple.


This one is driving me nuts.

I'm intercepting Pages using HTTPModules so that I can change the Master Page before the page loads. This works as expected on everything except error.aspx in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS folder. Despite the fact that error.aspx specifies MasterPageFile="~/_layouts/simple.master" I keep getting Page.MasterPageFile = ~/masterurl/default.master instead!

Anybody know why this is the case?

export datatable from .net code page (aspx.cs) to sql stored procedure


Hi experts

Can any body tell can we pass datatable from code page to sql stored procedure. If yes tell me how.


Any sugession acceptable.



Getting an error while attaching the master page to custom .aspx


Hi ,

I am getting the following error while I am trying to attach the master page to the custom form

The virtual path '/_catalogs/masterpage/default.master' maps to another application, which is not allowed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The virtual path '/_catalogs/masterpage/default.master' maps to another application, which is not allowed.

Actually I am developing the association form in the custom work flow , I am calling the master on the On PreINt event of the page



Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Launch CMD File From ASPX Page


My organization uses a CMD file to install updated files for a major enterprise application. Currently, we send out an email to users with a link to the file and instructions to run it, BUT inevitably users don't update their machines until their in field and try to start the app.


We're now liking the idea of using an ASPX page to prompt the users to run the updates and to capture the fact that the updates have been run. I realize that we can't capture the success or failure of the update. But we'd like to capture the user accessed the page.


Is it possible to embed into the markup for the page a link to the file on the local intranet that the users can click on to run the file?

The user accessing the page would capture that they did just that. We'd deal with wether or not the update was actually installed or if it failed later with them directly.

Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


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


Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



Not getting multiple composite controls on master page


I have created two composite controls in the same assembly and registered that assembly in a master page using <%@ Register tag.

When I try to use these controls using the registered tag prefix I am getting only one control along with the tagprefix .

How to get all the composite controls present in the registered assembly?

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