Showing posts with label master. Show all posts
Showing posts with label master. Show all posts

Wednesday, March 28, 2012

AJAX breaks AdRotator control rendering

Hi,

Does anyone know how to resolve the issue I'm experiencing with AJAX breaking the AdRotator control?

My AdRotators reside in a master page and display fine until a AJAX UpdatePanel is introduced. Once an UpdatePanel is added the AdRotators start to render their HTML output at the very beginning of the page's HTML (before the

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
in my case).

Image without AJAX problem:http://x.yougodo.com/screenshot-good.jpg

Image with AJAX problem:http://x.yougodo.com/screenshot-bad.jpg

Any help would be greatly appreciated.

Cheers

I can't seem to find any other users with your issue. You may want to give this approach a try:http://www.seesharprun.net/2007/08/09/AnAdrotatorAlternative.aspx. Where is your AdRotator located on your MasterPage? I'm assuming you are adding your UpdatePanel inside the Master's ContentTemplate?

Perhaps you can post a small snippet of code that will replicate the issue?

-Damien


Hi Damien,

Thanks for your suggestion, much appreciated - I will take a look.

Was puzzled myself why no-one else seemed to have encountered the same problem?!?

The UpdatePanel is actually located in the *.aspx page rather than the *.master - I'll try and create a small example to re-create later as everything is too intertwined in my current project to post something useful.

P.S. The Google Ads in the screenshots are not in AdRotators, only the image ads you see.


How bizarre... I've not been able to recreate problem creating a simple AJAX / master page scenario?!?

Maybe it's down to some of my non-standard controls - all pages are inherited from my own Page class that adds a bunch of extra properties and methods useful for my project. The control triggering the AJAX callback is also my own roll-your-own page number selecting control.

Quite puzzled as both these own-code-rolled controls successfully use AJAX functionality on other pages. It's jut when the AdRotator is introduced that bizarre results occur. Quite puzzled!


That's interesting that you can't reproduce it. I think your assumption may be correct with your non-standard controls. Do you perhaps have an un-closed element or something? This could be causing some issues. You also may just want to make sure your AJAX environment is setup correctly, you can refer to these common problems/fixes:http://blogs.visoftinc.com/archive/2007/09/23/asp.net-ajax--updatepanel-not-working--common-problems.aspx.

Hope you find your problem!

-Damien


Hi Damien,

Cheers once again for your help - much appreciated. Doesn't seem to be any of the issues described in the link you gave though.

Very bizarre, the output would suggest that somehow the AdRotator is getting to render it's output before the *.master or *.aspx files do?!? No html at all is output to the locations where the AdRotator is placed, only at the top of the page before all other html. Very puzzling.

I've abandoned trying to find a solution for now, coding my own temporary random ad selector for now. The AdRotators were only ever going to be a temporary measure until a fully functioning ad management system is plugged in.

Gavin.

Ajax based Tab control.

Hi all,

I need a Menu control horizontally laid out at the top the screen on a master page as shown below.

Tab1 Tab2 Tab3 Tab4 Tab5

Each tab would navigate to a different page, Tab1 to Page1.aspx, Tab2 to Page2.aspx, ...Tabi to Pagei.aspx etc.

Is it possible to change between different tabs(pages) in a Ajaxy way(so that the user doesnt see the flicker or the progress bar at the bottom of browser on the task bar),

I see that UpdatePanel does not integrate well with asp:menu, and a I saw a couple of posts where people have used the CallBack feature of asp.net 2.0 to attain the effect. Is this the only solution?


Thanks for your time

try it.....

Master.aspx File

<%@. Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" 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">
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />
<title>Master Page ::</title>
</head>
<body>
<form id="form1" runat="server">
<table cellpadding="0" cellspacing="0" id="MasterContainer" width="100%">
<tr>
<td id="BannerContainer" align="left" colspan="2">
Tab Demo Site
</td>
</tr>
<tr>
<td id="ContentContainer" valign="top" style="height: 19px">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="TabMenuContainer">
<tr>
<td>
<asp:Menu CssClass="TabMenu" DataSourceID="TabMenuSitemap" HideSelectElements= "True" ID="Menu2" Orientation="Horizontal" runat="server">
<StaticSelectedStyle CssClass="TabMenuItemSelected" />
<StaticMenuItemStyle CssClass="TabMenuItem" />
<StaticMenuStyle CssClass="SiteStaticMenu" />
<StaticHoverStyle CssClass="TabMenuItemHover" />
<DataBindings>
<asp:MenuItemBinding DataMember="SiteMapNode" Depth="0"
NavigateUrlField="Url" TextField="Title" ToolTipField="Description" />
</DataBindings>
</asp:Menu>
</td>
<td class="TabMenuSpacer" width="100%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" valign="top">
<div id="SiteContent">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</td>
<td>
<div class="SiteContentSpacer"></div>
</td>
</tr>
</table>
</tr>
</table>
<asp:SiteMapDataSource ID="TabMenuSitemap" runat="server" ShowStartingNode="false" />
</form>
</body>
</html>

WEb.sitemap File

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/ AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="" roles="*">
<siteMapNode url="~/default.aspx" title="My WebPage" description="The Home Page" roles="*" />
<siteMapNode url="~/default2.aspx" title="My WebPage 1" description="The First Tab" roles="*" />
<siteMapNode url="~/default3.aspx" title="My WebPage 2" description="The Second Tab" roles="*" />
</siteMapNode>
</siteMap>

Smile

Monday, March 26, 2012

ajax animation extender pls help

Hello all I had designed my website with help of ajax extensions in that project i had designed master page and this page inherits some another pages but whenever user goes inside the link i want to disable some of the links which presents on the master page .

i am using animation extender ,when animation flyout on button clik then i want only animated div tag and disable all background page.

I want to use same functionality as asp.net forum uses when user click's on select tags button .

whenever uses select that topic only animation is enabled on the page and background is disable

you can see this functionality by posting a query on asp.net fourm

thank you

ravi amber

Hi Ravi amber,

I'm failed to get clear enough with your question. So would you please explain what you want more clearly? Thanks.

ravi.ambar:

but whenever user goes inside the link i want to disable some of the links which presents on the master page .

i am using animation extender ,when animation flyout on button clik then i want only animated div tag and disable all background page.

I want to use same functionality as asp.net forum uses when user click's on select tags button .

What are these really mean??

Best regards,

Jonathan

Saturday, March 24, 2012

Ajax and user controls

hi all,

i have a master page whith some aspx pages that inherit from him , each page has some user controls each control has Ajax functionality

the question is where to put the script manager

    one on the master page.one on each aspx page.one on each user control,

thanks Daniel

I have found it seems to work best on the masterpage when you have controls using ajax on many content pages.

AjaxButter


YOu can't put more than one on the page, so if you have them both in the master and in a page, you should expect to see an error. Instead, put it on the Master, and then have proxies on the pages and controls

AJAX and Master Pages

I seem to be having some trouble using AJAX and the ControlToolkit with Master Pages.

Just to make sure, I created a new website based on the AJAXControlToolkit template.

and a simple default.aspx - it only has a scriptmanager, panel ( with some text in it), linkbutton and AnimationExtender.

it is set to show/hide the panel when the linkbutton is hovered on - this works as expected.

Then, I create a masterpage.master file and a new WebForm based on this master file.

using the same markup fro the default.aspx page, I get a page that looks the same as default.aspx

but does not show/hide the panel and has a Javascript error as follows:

Sys.ArgumentException:

AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control.

No element or control could be found corresponding to 'Panel1'

Parameter name: id

It seems as though the controls are being renamed and I might need to change the TargetControlID on PageLoad or something.

Any ideas would be appreciated.

Mike

This is the difference between server ID and client ID. The .ClientID property of a control can be used to get its client ID and should help here.

AJAX and Master pages

hi all,

I try AJAX with master pages and I've stucked in some probelm. Accroding to my requirement, my master page has two contentplacehoder.One on left side, and one in the middle. I have an update panel in the middle content place holder. Now I want to update the control in the middle contentplace holder on trigger click event of some Image button which is in the left contetplace holder. I've put my scriptmanager in the master page also.

But when I click the Image button,entire master page is doin a postback,which Is not AJAX. Can some tell me how to achive this.

I've seen the standard example of updatpanel with master pages in documentation, but there the button is actually on the master page. But in my situation, I've a button in some other contentplace holder, on whose click event I want to update my panel, without postback.

I really don't understand why the post back is hapening. HOw can I approach to solve this problem. can some please help me. Its kind of urgent.

Thanks a lot.

Hello,

First of all a little advise, never use (learn) a new thing, when something is urgent... :-)

Its a bit difficult to answer without a code example from your side, but i try.
The problem i think what is giving the postback, is that you use different aspx pages in your content holders, and only the middle one has a UpdatePanel, but the left one doesn't.
So the click on the button in the left content holder, act normal inside his own aspx page, and causes the masterpage to do a postback..

The problem like you have can maybe solved (just in theory), by putting the buttons also in a update panel, en doing a codebehind refresh of the update panel in the middle.

Like i said, i didn't tried this myself, but maybe gives you some direction where to go.

Marchu


Wrap everything (starting with masterpage before the contentplacholders) with a updatepanel.

add a updatepanel to both of the contentplaceholders...

This way when you have a change that happens in one that updates the other the encapulating updatepanel will update what is required...(it should work in theory at least and a technique I use for handling modalspopups within a gridview but in seperate panels


Hi Marchu,

First of all thanks for your immediate reply. And sorry for one small thing, I forgot to mention in my (long) post above, that my button and updatepanel are in same content page(aspx page). Just that I've put the button in another content place holder then my update panel. When that page is called in the master page, the button comes in the lesft contentplace holder, and update panel in the middle. Thats why I assumed that it will work and will not give post back.

I hope u got my point. I was not able to put the code as I'm not at my work place, and its lying there. I'll try to put it in my next post if possible. ( sorry for that). What do you suggest about this. Shhould still try with putting the button also in the update panel?

Thanks again.


Hey thakns a lot Jody.

I'll try Marchu and yours both way and get back to you if any issues or problems.

Thanks a lot again.....


Let us know what works for you - we are here for ya...

Hello,

yes i think you can better try that, or the solution from jodywbcb.

On the other hand, i know for sure when you post some code.
(To be honest, its not 100% clear what you mean :-))

Marchu


Hi Marchu and Jodywbcb,

Thanks a lot for reply first. Well, as you both told, I tried the same thing by keeping the butttons and everything in the update panel and everything works.I did it as follows...

My mater page is same with two content place holder,one at left and one in middle. and my Scriptmanager is in master page.

In my content page, I've kep my repeater control, which should change on click of an Image button, inside an update panel, and this goes in the middle contenplacehoder of the master page.

Also I've kept my Image button too inside the update panel, and this goes for the left contenpalceholder of the master page. I've not used any triggers.

I tried to use only one updatepanel by encapsulating both the <asp:content></asp:content> but it gives an error.

Anyway thanks again and sorry for replying late as I was traveling and not at my office.

-Regards,

MehulMistry

ajax and master page

Hello I have a problem I am using ajax and I have a aspx page that belongs to a master page. I am using the update panel on the aspx page and want to acheive the following When the user clicks a ButtonLink in the aspx page I want it to trigger the button OnClick on the master page. I have tried the following;

/*This is in the aspx page*/ ... ...

<atlas:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>
...
...
</ContentTemplate>
<Triggers>
<atlas:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>

Button1 is in the master page! But nothing happends.. Have I missed out on something?

Yes, what you're doing with the above code is telling the update panel to update when Button1 is clicked.


First, you need to set the update panel's UpdateMode to Conditional.

Next, make sure the ScriptManager's EnablePartialRendering is set to True.

You may need to set your trigger programmatically and use FindControl.


So if I have one button in my master page and one linkbutton in my aspx page could I

add a update panel to the button in the masterpage. set this update panels trigger to the link button in the aspx page?

would this work? im thinking how can I get the id of the linkburtton in the aspx page?

tnx


you want to go the other way; set the trigger of the update panel in the master page from the content page. An example is here: http://msdn2.microsoft.com/en-us/library/xxwa0ff0.aspx


What error you are facing...

whether you places SCriptManager on Master Page or not ?

http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx


Hi Guys my problem is very simple i have a masterpage with all my menus and headers and footers. Now what i want is when i click on the menus or buttons on the left i want to update only contentplaceholder with new page and controls of that page. is it possible!!! if yes plz tell me how.

Faisal

chetan.sarode:

What error you are facing...

whether you places SCriptManager on Master Page or not ?

http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx


Yes.

You can build your content pages as user controls...

Then your menu items can fire a function that loads the controls into your place holder... That way only the place holder is being updated...

But you won't need to do that in a "master page"... that sort of defeats the purpose. Just create your header/menu/footers in default.aspx, otherwise, you will just need a blank default.aspx page loading at the begining.

Master pages don't load on their own.


Thanks i will do that and let you inform what i have got.

Faisal

Wednesday, March 21, 2012

AJAX Accordion & tabcontrol

My scenario goes like this.

I have a Accordion control on a Master Page accting like a menu. In the accordion I have a MenuItem that has links. when I click on the header of the accordion it takes me to a specific page. On that specific page I have a Tab control that has the tabs as the names of the MenuItems in the accordion. when I select a MenuItem in the Accordion it must display the specific tab in the Tab control.

This is my code.....

Accordion

<

ajaxToolkit:AccordionID="Accordion1"runat="server"SelectedIndex="0"HeaderCssClass="accordionHeader"ContentCssClass="accordionContent"FadeTransitions="true"FramesPerSecond="40"TransitionDuration="240"AutoSize="None"Width="160px"><Panes><ajaxToolkit:AccordionPaneID="AccordionPane1"runat="server"ContentCssClass=""HeaderCssClass="">

<Header><ahref="Default.aspx"onclick="return false"class="accordionLink"> Home</a>

</Header><Content><asp:Menuid="Menu1"Runat="Server"CssClass="menu"><Items><asp:MenuItemText="Home"></asp:MenuItem><asp:MenuItemText="Collections"></asp:MenuItem><asp:MenuItemText="Affiliations"></asp:MenuItem><asp:MenuItemText="Talk to us"></asp:MenuItem><asp:MenuItemText="Contact us"></asp:MenuItem></Items></asp:Menu>

</Content> </ajaxToolkit:AccordionPane></Panes></ajaxToolkit:Accordion>

Tab Control......

<

ajaxToolkit:TabContainerID="TabContainer1"runat="server"><ajaxToolkit:TabPanelID="TabPanel1"HeaderText="Home"runat="server"><ContentTemplate><!--

your web form controls goes here

-->

</ContentTemplate></ajaxToolkit:TabPanel><ajaxToolkit:TabPanelID="TabPanel2"HeaderText="Collections"runat="server"><ContentTemplate><!--

your web form controls goes here

-->

</ContentTemplate></ajaxToolkit:TabPanel>

<ajaxToolkit:TabPanelID="TabPanel3"HeaderText="Affiliations"runat="server"><ContentTemplate><!--

your web form controls goes here

-->

</ContentTemplate></ajaxToolkit:TabPanel>

<ajaxToolkit:TabPanelID="TabPanel4"HeaderText="Talk to us"runat="server"><ContentTemplate><!--

your web form controls goes here

-->

</ContentTemplate></ajaxToolkit:TabPanel>

<ajaxToolkit:TabPanelID="TabPanel5"HeaderText="Contact us"runat="server"><ContentTemplate><!--

your web form controls goes here

-->

</ContentTemplate></ajaxToolkit:TabPanel></ajaxToolkit:TabContainer>

Sorry to mention that I have a menu control embeded in the Accordion Control. How do I get the selected item of the menu control?

So I can change to the appropriate tab in the Tab Control