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

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

Master-Detail GridView in Single Page example with paging throws error

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
___http://www.java2s.com/Code/ASP/Data-Binding/MasterDetailGridViewinSinglePage.htmI followed example at the link above.When I enablind paging=true (by pagesize=3).and clicking to pages 2|3|4 etc and so;error occuringIndex was out of range. Must be non-negative and less than the size of the collection.at cs line :sourceProducts.SelectParameters[0].DefaultValue = gridMaster.DataKeys[e.Row.DataItemIndex].Value.ToString();got any idea?what should I make to fix this ? is this error  fixable ?thanks much.

View Complete Post

More Related Resource Links

Master-Detail with the GridView, DetailsView and jQuery's ThickBox

One more article about grids from Matt Berseth. This time he shows how to create master-detail with the gridview, detailsview and jQuery's ThickBox. He writes:
So I thought I would check some of this out and along the way rebuild my Master-Detail with the GridView, DetailView and ModalPopup Controls and replace the ModalPopup with jQuery's ThickBox. I found it pretty interesting - read on to see how it went

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

Master-Detail with the GridView, DetailView and jQuery's ThickBox

An example of using the jQuery ThickBox with ASP.NET's GridView and DetailView controls

Master Detail-Modal Popup Duplicate Component ID error

This is my main page in which I have collapsible panel and my phone gridview is contained in it. The Initial page loads up properly and shows the gridview. All the errors happen when I select a gridview row for modal popup edit. I get the following errors one after other after ignoring each one of them. I have been struggling with his for almost a week. I would appreciate if someone could help me get rid of these errors. Following are the sections of the main page and the code in the gridview ascx control . Main GridView User Control Page.<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/basemaster.master" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <%@ Register TagPrefix="ucophone" TagName="ucopsphone" Src="~/UserControls/online_app_phone_gv.ascx" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtenderPhone" runat="server" TargetControlID="PanelContentPhone" Supp

Master Page Error



I am getting following error message. 

"Master Page Error

The page contains markup that is not valid when attached to a Master Page.

Correct the problem in code view"

What could be the problem ?

The last change i had done in the pages is;  added a  conditional xsl statement in the HTML command button. the code for conditional execution is as follows

<input type="button" value="OK" name="btnSave1" style="width:72px; height:22px;" >                                                  

Error: There are no page layout files available in the master page library of the top-level site.

I exported one of the subsite using stsadm and imported into a new site collection, I could access the new site collection but whenever I try to create a new page in my new site collection I get the following error.

There are no page layout files available in the master page library of the top-level site. Add one or more page layouts to this library before you create a page or set page properties.

Please help. Thanks.

Master page error when trying to run project



I trying to run my project and I get  the following error 'lstpreferredtheme_selectedindexchanged is not a member of ASP.Masterpages_Masterpage_master

Even I've named the id of my dropdown list lstpreferredtheme which I trying to call. My code is below

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    <form id="form1" runat="server">
    <div id="PageWrapper">
        <div id="Header">   <a href="~/" runat="server">Header Goes Here</a></div>
        <div id="MenuWrapper">

Insert page with master/detail


I have a case where I want to insert personal data and on the same page to be able to insert contact information, meaning entering more than one contact like e-mail,phone no ect. and contact data are saved to another table(it's like saving order info and order details at the same time)

is there a way to build this kind of page using dynamic data.

any link to an example would be very helpful


single master page shared in two web application



Is it possible to have a single master page used in two web app?

Or would it be possible to get the virtual path pointing to different app though I don't think so?


Master Page Error - cannot be loaded

We're using WSS 3.0
I'm not sure what's gone wrong but it all happened after authentication was set to Kerberos and then back to NTLM.
That was all sorted but now we have another problem.

The live site works fine when browsing, but when opening a page in Sharepoint Designer it says Master Page Error - The master page file '~masterurl/default.master' cannot be loaded.
If i try and attach the master page I get an error stating 'Make sure Frontpage Extensions or Sharepoint Services are installed on the server.' and there is nothing in the Details.

Sharepoint Services are installed, we have two other sites (web applications) that are working fine.

When I click on the Web Parts Taskpane in Designer it says it can only be run on servers running Windows Sharepoint Services.
Also when opening the site in Designer it asks me if I want to edit the Live Web Site or a local copy, its never done that and doesn't for the other sites.

Any idea where I've gone wrong?

'Master Page cannot be loaded' Error

Hi, I suddenly started developing some near-fatal errors with my Sharepoint site. I found that it was somehow difficult to edit the home page for the site collection, so I decided to create another 'default.aspx' and replace it as the hompage. Problem is,  the new home page was still using the original master page and looked funny, so I copied and replaced the old master page, keeping it as a copy just case. When the new home page still looked funny, I deided to change everything back, but then the following error occured:

'The Master Page cannot be loaded. "File Name"
Please attach a different Master Page or go to Code View to resolve the error'.

The link to attach a different master page doesn't do anything, and the 'go to Code View' link doesn't show the error. Strangely the file name of the master page it can't load is not the default master page, and more annoyingly, the file exists!!! I don't know what to do. In Internet Explorer, the home page only shows this erroe: 'File Not Found'.

Help me, what did I do wrong?

Problem :- using AJAX and GridView in a nested master Page


HI ,

Have been scratching my head regarding

"Control with ID 'GRID1' being registered through RegisterAsyncPostBackControl or RegisterPostBackControl must implement either INamingContainer, IPostBackDataHandler, or IPostBackEventHandler."

-------not using any update panels in masterpages.

-------grid.databind on page load of content page.

any help is really appreciated.

Thank you

How to sort the detail DataGrid in a Master-Detail page using XAML?


I have created a Master-Detail WPF on a Entity FrameWork object.


     <CollectionViewSource x:Key="MasterViewSource" />
     <CollectionViewSource x:Key="DetailViewSource"
          Source="{Binding Source={StaticResource MasterViewSource}, Path=MasterDetailRecords}" />

I am attempting to sort the details by the "SortValue" property in the details table.

When I try the following an error is generated at execution:

     <CollectionViewSource x:Key="MasterViewSource" />
     <CollectionViewSource x:Key="DetailViewSource"
          Source="{Binding Source={StaticResource MasterViewSource}, Path=MasterDetailRecords}">
                <scm:SortDescription PropertyName="SortValue"/>

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?

Create new page from master causes list threshold error?


When I try to create a new page from master I get:

Server error: the attempted operation is prohibited because it exceeds the list view threshold enfoced by the administrator.

Why would I get this error from trying to create a new page from master?

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



Server Error after Trying to Upload New Master Page


I edited our master page in SharePoint Designer 2007 and uploaded the new version.

The new version never made it to the server, and I can no longer authenticate in to make changes. I receive a 404 error - telling me "The file /Local%20Settings/Temporary%20Internet%20Files/Content.IE5/EMWCDP71/_controltemplates/DesignModeConsole.ascx does not exist."

All of our other users can still authenticate, I am the only one receiving this error.

I found posts about tildes being stripped in Designer (which they were in the file I attempted to upload)

Changed the file and reuploaded and I am still the only one who is receiving the server error.

Any ideas would be appreciated.


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