Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Wednesday, March 28, 2012

Postback Page controls go reverse video

I'm using master pages, and have various content pages using the same paster page, with an update panel in my paster page, that wraps my content pages. All works very well.

However, on some content pages if I double click my rows in my Gridview to cause an edit of that record, all the controls on the page are reverse video for a brief second, this is only true on some content pages, not all. I've recreated one of the content pages in question from scratch, same issue.

Has anyone else ran into this reverse video issue before?

No,I have never ran into this issue before.So I'm afraid I donn't have any idea on it if you don't provide with a repro of it.

Regards

PRB: Master Pages and Update Panels/Script Manager - AJAX Magic not working

I have a master page that has the script manager control and a content place holder

I have a content page that is using the above master page and with a gridview control wrapped in an update panel

When the content page doesn't use master pages and the script manager is placed within the content page along with the panel, everything works fine

The problem arises when the master page has the script manager and thhe content page just has the update panel with the gid view. It seems to be doing a regular postback and the ajax plumbing doesn't seemto have any effect..

I also tried adding a page initi handler and specifying the trigger in the code behind but with no luck..

generated page source with script manager in master page is listed below. Why does gettting a common master page scnario be so difficult to getv it working..Please point me in the right direction

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('_ctl0:ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['t_ctl0:ContentPlaceHolder1:panel1'], [], [], 90);

//]]>
</script>


Genertated source when the script managersits on the page and the content page does not use any master pages

<script <script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tpanel1'], [], [], 90);

//]]>
</script>

Hi Ajaxnewbie,

Could you please post your code, so we can see how you have implemented it. Thanks

Regards,


Good question... I have exactly the same problem. I wish there would be a valid answer for this post.

thanks!

Monday, March 26, 2012

Probblem with Menu control inside an update panel

Hi,

I have a master page with a script manager ,update panel and Content Palce Holder. in the default page which uses the masterpage I have added a menu control, textbox and a button. I have two problems which I have seen in the past in other versions of ajax. I have not coded anything other than just these controls on a page

1) I could click on button all day long and there is no java script error but as soon as I click on a menu item I get javascript error saying:

Line:221

Char:20

Error '0.cells' is null or not an object

code: 0

2) I can not get my CSS sheet work in my app theme for the background images. I have the following code in my CSS

.Menu1BackGround

{

background-image:url(/Images/Menu1_Background.bmp);

}

and I have assigned the it to the menu. Nothing happens as if it does not recognize the image path. I could add the background:black to the code and it works fine for the color but not the image. I am not sure if thisis because of the same problem.

Any body have any ideas?

Thanks

Seehttp://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#UpdatePanelCompatibleControls. The Menu control is not supported inside an UpdatePanel.

I have been using this piece of javascript to go around the menu problem:

var oldMenu_HideItems = Menu_HideItems;if(oldMenu_HideItems){Menu_HideItems = function(items){if (!items || ((typeof(items.tagName) =="undefined") && (items instanceof Event))) { items = __rootMenuItem; }if(items && items.rows && items.rows.length == 0){ items.insertRow(0); }return oldMenu_HideItems(items);} }
I got it from the asp:menu javascript code and I hook it to "patch" the problem.
Adding it to a page where a menu resides makes the javascript error go away. 

http://forums.asp.net/thread/1517884.aspx

HTH


Menu control is not compatable with AJAX.

I m also facing sme problem..

Saturday, March 24, 2012

Problem Adding Declarative Script to a Content Page

Problem Adding Declarative Script to a Content Page - I get this error:

"Assertion failed: could not find HTML element with ID "Wait" for control type Sys.UI.Image"

I have the following:

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True">

</atlas:ScriptManager>

<scripttype="text/xml-script">

<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">

<components>

<image id="Wait" visibilityMode="Collapse" />

</components>

</page>

</script>

<imgid=Waitrunat=serversrc="Images/spinner.gif"/>

Server controls do not always have the same client ID as the ID you specify - instead, they are given a unique ID based on what naming containers they live in. If you do a View Source on the client, you'll see this.

There are two ways to solve this:

1) Don't make the img a server control. This makes sense if you're not doing anything dynamic with the image on the client - there's no value in making it a server control.

2) If you do need to make the image a server control, you can obtain the ClientID property of the control and databind that into your script:

<image id="<%# Wait.ClientID %>" visibilityMode="Collapse" />

You'll need to call DataBind on the page (or on a container control that contains the script) to get this databinding to happen.

Thanks,



Thank you.

Side question: Does it matter 'where' on the page the xml script tags are located?

The reason I ask: In the examples they are usually located outside of the form tags - but since the content pages do not have form tags.

Thanks again for the quick response.

Problem getting AJAX work on content page

Hi,

I want AJAX - enable existing content ASP .NET page. After updating web.config all seemed OK. But ...

I'm still getting full postback even on this simple testing page:

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
<asp:UpdatePanel ID="upd1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" /><br />
<asp:Label ID="Label1" runat="server" Text="Label"><%# DateTime.Now.ToString()%></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

As you guess ScriptManager is on master page and I left its properties default.

Any idea what am I missing?

You are missing your triggers!!!!

<triggers>

<asp:AsyncPostBackTrigger controlID="NameofYouControl" EventName="NameofEventThat triggers refresh"> </<asp:AsyncPostBackTrigger>

</triggers>


You are missing your triggers!!!!

<triggers>

<asp:AsyncPostBackTrigger controlID="NameofYouControl" EventName="NameofEventThat triggers refresh"> </<asp:AsyncPostBackTrigger>

</triggers>


<triggers></triggers> goes after <ContentTemplate></ContentTemplate>


Triggers shouldn't be needed in that example... There must be something wrong with the web.config, other code on the page, or possibly a configuration issue in IIS.


i would say it's the web.config issue.

Problem getting elements by ID inside <Content> of AccordionPane

Dear All,

I've got problem on changing the content inside a <div> element inside the Content part of AccordionPane. The code is below:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type="text/javascript">

function test1(){

var table = document.createElement('TABLE');
table.setAttribute('border',0);
table.setAttribute('id','sliderTable');

var tBody = document.createElement('TBODY');
table.appendChild(tBody);

var row = document.createElement('TR');

var cell = document.createElement('TD');

cell.style.backgroundColor = "#CCCCCC" ;
cell.style.width = 10+ "px";
cell.style.height = 5+ "px";

row.appendChild(cell);

tBody.appendChild(row);
}
document.getElementById('colorTable').appendChild(table);

document.getElementById('colorTable').style.display='';

}

</script>

<asp:ScriptManager id="ScriptManager1" runat="server" />

<ajaxToolkit:Accordion ID="Accordion1" .....>

<Panes>

<ajaxTookit:AccordionPane...>

<Header>Color</Header>

<Content><div id='colorTable' style="display:none"></div><Content>

</ajaxToolkit:AccordionPane>

......

</Panes>

</ajaxToolkit:Accordion>

</asp:Content>

When I run the code it said there is a javascript error "Object Required". It is the script cannot locate the 'colorTable' element? And what way can I locate the element?

Thanks!!

Stard

Hello,

As you propably discoveredSmile:

function test1(){

var table = document.createElement('TABLE');
table.setAttribute('border',0);
table.setAttribute('id','sliderTable');

var tBody = document.createElement('TBODY');
table.appendChild(tBody);

var row = document.createElement('TR');

var cell = document.createElement('TD');

cell.style.backgroundColor = "#CCCCCC" ;
cell.style.width = 10+ "px";
cell.style.height = 5+ "px";

row.appendChild(cell);

tBody.appendChild(row);
} <----- syntax error
document.getElementById('colorTable').appendChild(table);

document.getElementById('colorTable').style.display='';

}

has syntax error, there is an unnecessary } /or your copy/paste was not successful/


Hi stmarti,

sorry I've got typo error in my post :) Since I just type the main structures of my code and my original one haven't got this typo error.

Btw I searched some other forum and got some solutions like document.getElementById('<%colorTable.ClientID%>') because I am working with a content page under a master page. But I get "colorTable do not have the ClientID property" error.

Any idea on this?

Many thanks.

Stard


Hi,

I have some comments maybe it helps:

a) the correct syntax is <%= colorTable.ClientID %> or <%# colorTable.ClientID %>

but I think it is unnecessary, because your div isnot a server side control so it's id won't be altered! This is only necessary when you have:

<div id='colorTable' style="display:none"runat="server" ></div>

b) The really big problem is style="display:none"andthe empty div.

Why? Because with this style yourempty div will not ever rendered in the browser(!!!) and not even part of the DOM tree! Just check this.

Try instead of: strip style="display:none" or change it style="visibility: hidden;" or use a span instead of div as a placeholder or put some content in the div. Try all these to understand how your browser render empty or display:none divs.



Hi,

Small update, start here: change your div to

<div id='colorTable' style="display: none;"> </div>

and document.getElementById( 'colorTable' ) should worksSmile

Wednesday, March 21, 2012

problem in Update panel

Hi

I am using masterpage in my application.I put two contentplaceholder..left side and right side...In left side content I am putting menu...whenever i click on left menu, page should be open in right side contentplaceholder.Whole page should not be refresh....just right side contentplace holder should be change according to left menu click..it is possible using update panel ?..i put updatepanel on right side but it is not working..

Can anybody help..Please....

Please help me...

Thanks a lot...

Hi Sejal,

Check this article on using update panel in master pages -

http://ajax.asp.net/docs/tutorials/UsingUpdatePanelMasterPages.aspx

You can also try using update panel triggers(not sure how it will work in master page) -

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#SpecifyingUpdatePaneltriggers

Problem in using validation in Multiple step Wizard in content place holder of master page

We have a master page with many content place holders. All placed in ATLAS update panel.

In Content page we are using wizard control and we want to do validation on each step of wizard. Problem is that one 1st step is successfully validated and user moves to 2nd step of wizard and after entering data clicks next button. Validation controls used in 1st steps are invoked and causes error.

Master Page

,,,,,,,

<atlas:UpdatePanelID="AP1"runat="server">

<ContentTemplate>

<

asp:ContentPlaceHolder> < /asp:ContentPlaceHolder>

</

ContentTemplate>

</atlas:UpdatePanel>

------------------

Content page

<

asp:Content runat="Server">

<

atlas:UpdatePanel > <ContentTemplate>

<

asp:Wizard >

<

WizardSteps>

<

asp:WizardStepStepType="start">

<

asp:TextBoxID="TxBx_Extension"runat="server"ValidationGroup="Step1"></asp:TextBox> <asp:RequiredFieldValidatorID="RFV_Extension"runat="server"Display="None" ControlToValidate="TxBx_Extension"ValidationGroup="Step1"ErrorMessage="Extension Required!"> </asp:RequiredFieldValidator> <asp:ValidationSummaryID="VS_Step1"ShowMessageBox="true" ShowSummary="false"runat="server"ValidationGroup="Step1"/>

</

asp:WizardStep>

</WizardSteps>

</asp:Wizard >

</ContentTemplate>

</atlas:UpdatePanel >

</asp:Content>

Hello, hey guys and guls listen i have found a bug in asp.net but i want to tell u people and check it if u really a true lover of .net so here u goes ...

No one replied to this message query and it took almost three days to debug so i have happy to find the reason but i want every to atleast read this so he may not get struck while when he or she is coding his or her program.

Try to make a master page and then add a content page now creat contentplaceholder in master page and write ajax or atlas script manager and updatepanel in master page and go to content page make a multi step wizard and try to includ validation in step (start) and then try not to use any validation control in the next (step/final)step, this page is going to give error and if u dont use any validation control in this step and suppose i dotn't need any validation in this step but i have to use it because else i can't proceed in the next step of my step by step program, why should i have to use validation control in next step when i dont need it.

Thanx for considering this too ;)... enjoy and don't worry because this happen when there are new things to discover ...... :D.


hello.

i'm sorry, but i didn't get it...can you build a demo project and send it to me?

thanks.


Luis Abreu:

hello.

i'm sorry, but i didn't get it...can you build a demo project and send it to me?

thanks.

I'm afraid I don't get it, either. I have a multi-step Wizard with validators on every page save the last one, in a Master Page setup, with an UpdatePanel around the content placeholder.


Err, sorry, I forgot to mention my setup works without a hitch.

ashfaqcool, can you give us a short and complete example of the issue you're running in to? The code for the master page and the content page would greatly help.


hello sir,

As u said that u have validators in each step of the wizard try to remove a validation in intermediate step e.g u have validation controls on first step and then on 2nd step i dont need any of the validation control then u want to proceed to last step then u will recieve an error when u press next on the 2nd step.

thanx for looking into this and i hope u got it.


here is the demo

make a master page with name MasterPage.master and past this code ...

MasterPage.master

-----------------------------------------------

<%@. 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>
</head>
<body>

<form id="form1" runat="server">

<atlas:ScriptManager ID="Script_manager" EnablePartialRendering=true runat="server"> </atlas:ScriptManager>

<div>
<atlas:UpdatePanel runat="server" ID="UpdatePanel_1">
<ContentTemplate>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
<asp:contentplaceholder id="ContentPlaceHolder2" runat="server">
</asp:contentplaceholder>
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form>
</body>
</html>

-------------------------------------------

now make a content page with name default.aspx and paste the following code into it.

Default.aspx

-------------------------------------------

<%@. Page Language="VB" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<asp:Wizard ID="Wizard_1" Width="50%" runat="server" DisplaySideBar="False">
<WizardSteps>
<asp:WizardStep ID="Step_1" StepType="Start" runat="server" >
Enter Name: <asp:TextBox ID="TxBx_1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="TxBx_1" ID="RFV_1" runat="server" Display="None" ErrorMessage="Name Required!" />

</asp:WizardStep>

<asp:WizardStep ID="Step_2" StepType="Step" runat="server" >
Enter Password: <asp:TextBox ID="TxBx_2" runat="server"></asp:TextBox>

<%--<asp:RequiredFieldValidator ControlToValidate="TxBx_2" ID="RequiredFieldValidator1" runat="server" Display="None" ErrorMessage="Password Required!" /> --%>


</asp:WizardStep>

<asp:WizardStep ID="Step_3" StepType="finish" runat="server" >
<asp:TextBox ID="TxBx_3" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="TxBx_3" ID="RFV_3" runat="server" Display="None" ErrorMessage="Text Required!" />
</asp:WizardStep>

</WizardSteps>
</asp:Wizard>
<asp:ValidationSummary ID="VS_2" DisplayMode=BulletList ShowSummary=false runat="server" ShowMessageBox=true />

</asp:Content>
----------------------------------------------
now if u want to remove to remove or u want to debug just enable the validator written in colourful line

(green colour) in the default.aspx code

thanx i think and hope that, that solves the confusion; thanx.


I tried your code and I'm not getting the behavior you described. I uncommented the second step's validator and everything works as it should: step one's validator works as it should and so do the others. With the second step's validator commented, the page still works as it should and the behavior you describe doesn't manifest itself.

What version of ASP.NET AJAX are you running? I am running Beta 2.


i am having ASP.NET ATLAS. so u having ASP.NET AJAX beta 2.0 i think u are running the latest version.so i will try the same version ok thanx.

Problem of ModalPopup

How can I make ModalPopup control work properly in Master /content page scenario, which master page contains more than one content place holder? here's my code:

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/MasterPage.master"AutoEventWireup="false"CodeFile="Default2.aspx.vb"Inherits="Default2"title="Untitled Page" %>

<%

@dotnet.itags.org.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

<

asp:ContentID="Content1"ContentPlaceHolderID="NavigationLinksPane"Runat="Server">

</

asp:Content>

<

asp:ContentID="Content2"ContentPlaceHolderID="Pane2"Runat="Server">

</

asp:Content>

<

asp:ContentID="Content3"ContentPlaceHolderID="Pane3"Runat="Server"><atlas:ScriptManagerID="Scriptmanager1"runat="server"></atlas:ScriptManager><scripttype="text/javascript">function onOk() {

alert(

event.srcElement.Name);

}

</script><asp:PanelID="GlobalChangeQuerySourcePopupPanel"runat="server"CssClass="modalPopup"style="display:none"><p><asp:LabelID="GlobalChangeQuerySourcePopupLabel"runat="server"Text="Please select a item from list"></asp:Label></p><br/><asp:ListBoxID="GlobalChangeQuerySourceListBox"runat="server"></asp:ListBox><br/><center><asp:ButtonID="OkButton"runat="server"Text="OK"></asp:Button><asp:ButtonID="CancelButton"runat="server"Text="Cancel"></asp:Button></center></asp:Panel><atlasToolkit:ModalPopupExtenderID="ModalPopupExtender"runat="server"><atlasToolkit:ModalPopupPropertiesTargetControlID="GlobalChangeQuerySourceButton"PopupControlID="GlobalChangeQuerySourcePopupPanel"BackgroundCssClass="modalBackground"DropShadow="true"OkControlID="OkButton"OnOkScript="onOk()"CancelControlID="CancelButton"/></atlasToolkit:ModalPopupExtender>

<

asp:ButtonID="GlobalChangeQuerySourceButton"Text="..."runat="server"/>

</

asp:Content>

<

asp:ContentID="Content4"ContentPlaceHolderID="PaneJS"Runat="Server">

</

asp:Content>

I've tested out that it works very well if there is only one content place holder in my master page.

Any help will be appreciated, Thanks very much in advance.

Tony

Just want to bring this one up to get some attention from you guys

Thanks a lot if you guys can help me out.

Tony


I am having the same problem . See the last few entries on threadhttp://forums.asp.net/2/1364885/ShowThread.aspx