Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a DetailsView and a SqlDataSource to SQL Server. If I have
MasterPageFile="~/Site.Master"

at the top of the aspx page; then when in Edit mode, the textboxes (in EditItemTemplate) all appear as blank, although you can click into a textbox and backspace and remove each letter. So it's strangely like the text is white against white. As the page references a Master page, the page also has <asp:content> tags instead of html, head, body, and form tags.

However, if I do not have the MasterPageFile reference at the top, then the DetailsView operates perfectly, displaying the data while in edit mode as it should. In this case, I use html, head, body, and form tags.

I would like to use the MasterPageFile reference so I can make use of the default Navbar.

Question: Is there a way to get the MasterPageFile reference to not break the EditItemTemplate functionality?

What I have tried:

EditItemTemplate appears Blank with this line:
<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MyInfo1.aspx.cs" Inherits="UserInfo.MyInfo1" %>

EditItemTemplate works correctly with this line:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyInfo2.aspx.cs" Inherits="UserInfo.MyInfo2" %>
Posted
Updated 18-May-19 6:53am
v3
Comments
DerekT-P 18-May-19 13:01pm    
"So it's strangely like the text is white against white." ... and is that the case? Select the text - does it become visible? Use the Inspect Element tool to see what's contained and where the formatting is coming from. Remember if your edit control is taking its formatting from CSS, and the CSS selector references a control ID, that putting your repeater inside a master control *may* (depending on the options in your web.config) modify the control IDs so that CSS is not selected as you expect. Don't think there's much more we can do until you give us some more info and show us the code + css that you're using.

1 solution

Cut your master page down until it works; or, make an "extra" and start from scratch until you fail, adding chunks from the "old" master a chunk at a time.

Assuming you had a master page that worked at some point.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900