Showing posts with label panel. Show all posts
Showing posts with label panel. Show all posts

Monday, March 26, 2012

Will using Update Panel really give any performance improvements compared to non-AJAX site

Hi,

When one uses the Update Panel to remove the browser refresh then will there be any real performance gains as it yet does a full page postback and goes through the complete page life cycle on the server?

Using Update Panel sure makes the end user feel as though the browser refresh has been removed. But is there anything more to it?

Thanks,

- Manoj

Hi,

if you want to know more about this I would like to recommend you to check out this video that was shot on TechEd 2006 Barcelona:http://www.microsoft.com/emea/msdnshowtime/sessionh.aspx?videoid=331.

It shows the good and the bad of the UpdatePanel and how to tweak it.

Grz, Kris.


hello.

and the obvious answer is that it's not there to increase performance :)

Windows 2000 issue(s) with ModalPopupExtender ?

Hi,

I Have a webform containing a ModalPopupExtender, and I've just seen that the associated panel (the one that is displayed as a popup by the extender) is always visible on the page if I'm testing the page under Win2K, but this problem does not appear under Win XP (except a little and unwanted flashing).

Moreover, the panel is not displayed by the extender, it's acting as if the extender did not exist and the panel was always displayed as a simple panel on the page instead of beeing shown/hidden when required.

Win2K doest not like AJAX ?

Hi,

According to my knowledge, it should work on both win2000 & win xp. Please check the generated html to see if the source for ajax control toolkit is injected.

Like this:

Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ModalPopupBehavior, {"OkControlID":"Button2","PopupControlID":"Panel1","PopupDragHandleControlID":"Panel2","X":500,"Y":500,"dynamicServicePath":"/MyAJAXSampleSite/AjaxToolKit/ModalPopupExtender.aspx","id":"mpe"}, null, null, $get("Button1"));
});
  

Saturday, March 24, 2012

Wizard Control

I am using the Wizard Control in an aspx page inside an Update Panel control. What I want to do is to navigate to this page and set which Wizard Step should be active dynamically. Something like :

if(Request["whichstep"]!=null)

Wizard1.ActiveStepIndex=int.Parse(Request["whichstep"]);

Now this works fine in that the correct Wizard step is shown when the page is loaded. But the problem is that the Wizard gets STUCK on this step. i.e. you can't use the previous/next navigation buttons to move forward or backwards.

Any help would be greatly appreciated (PS. we also tried taking the Update panel out, but the same problem exists).

HN.

can you post your code? where in your code are you checking the wizard activestepindex?

Hi boolie,

Thanks for taking the time.

The code is very simple. The page that is calling the page with the Wizard has button and its click event has Response.Redirect("WizardPage.apsx?step=3");

The page that has the Wizard on it checks on the Page_Load : if(Request["step"]!=null) Wizard1.ActiveStepIndex=Int32.Parse(Request["step"]);

As I mentioned, this works. The wizard shows the correct step. But the problem is that you can't navigate i.e. go backward or forwards using the previous/next buttons.

By the way I tried putting the code in various other events that is raised by the Wizard, they all have the same behaviour!


not sure this will fix the problem, but at least it might help eliminate some things to troubleshoot...

Are you checking for whether or not it's a postback before running the "if(Request["step"]!=null)..."?

something like this:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//code would go here...
}
}

if you haven't tried this, test it and see if you notice any difference. What might be happening is that when you click on "Next" or "Previous" it's causing the page to reload which would cause the Page_Load code to run again which would show you the same step. I could be completely wrong, but at least we'll have one troubleshooting step out of the way. Let me know what happens.



Sorry. But I should have mentioned that I do test the Postback in my last Post and it still gets Stuck. Is this some kind of Bug in the Control do you think? After all they are only panels that get their visibility changed!
I kind of thought you might be checking that already. honestly, i have no idea whether or not it's a bug, but it does seem pretty strange. i'll try some tests on my own and see if i can duplicate the problem and then maybe i can help find a solution
Many Than

Many Thanks.

Looking forward to your findings.

Wizard Control problem

This is an interesting one, although I did have it working earlier, it has since ceased to function.

I have a wizard control in an update panel on a user control on a page which uses a master page. oh, on a second note, a calendar extenders style / theme seems to break if the calendar control is not on the first page displayed in the wizard bar; but thats another story and not my immediate consern.

the problem is, that the next button returns a javascript error " 'null' is null or not an object, line 105 " ... but the odd thing is that it only breaks on the second page, so the first click of the next button works and sends you to the second page, but the second one does not work.

There is some code under the next button;

Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick
If Wizard1.ActiveStepIndex = 1 Then
'some code here
end if
end sub

but it still breaks even if I comment out all the code or change the index from 1 to 2...

Thanks for reading this far, it was a bit of a long post.

Scott

you should go to your Internet Explorer's Internet Options and then go to the Advanced Tab. There you can check out 2 options: "Disable script debugging (IE)" and "Disable script debugging (other)".

Check these out and then debug. Then you can go into more detail about the javascript error.


the only extra i can add to the error message is this

Line: 104
Char: 5
Error: 'null' is null or not an object
Code: 0

I suspect that the javascript error is in the Update Panel, but im not sure...

Sorry.


Hey scott,

since nobody responded with something useful, ill give it a try ...

The error you are getting is very wide. This error can be thrown everytime an object isn't initialised at the moment you try to allocate a value to it.

because the error is so wide it's not easy for us to give a straight to the point answer.

You could try to strip down the problem into a demoProject which replicates the error so its very easy for everyone to follow what's going on.

Another thing you could do is look at the way your wizard runs through its pages. How is it set up? When creating wizards I would go for the multiview with serveral views in it for each wizardPage and then some buttons for the navigation. I made some sort of tabsControl with a multiview in an updatepanel and some navigation and all works fine :p

Good luck!


Thanks for the reply.

It gets weirder every time I look at it. In Mozilla FF it works fine; it seems only IE7 (not tried <6) stops me moving between the pages of the wizard control.

After what you said, a thought did occur to me, it stops on the page after the page containing two ajax calendar controls... but this was the wrong line of enquiry so i copied my script and progressivly removed parts until it started working.

I think this is caused by a common variable in the javascript between "something" and the required field validator control. I am using:

Modal Popup
Calendar Extender
Update Panel
and Required Field Validators

and it works fine when I remove all the validators.

I am a little behind schedule now, but I will try and recreate this on a new project later and if I get the same results with the error, it might be a small bug.

Thanks for the advice btw,

Scott M


I found out how to fix it, apparently its the required field validators use an old API to register their script !? there is a post on here somewhere (which I failed to find) that has a link to a recently compiled version of them which works flawlessly.

Wizard inside of update panel, still getting postbacks

Hi,

I placed a wizard inside of an update panel and when I click on the button for the next step, I still get a postback. I have tried setting the mode to conditional and it still occurs.

I even tried making a new atlas website and putting nothing but the update panel with the wizard inside and it still does not work. Here is the code below. Any idea what I am doing wrong??

<atlas:ScriptManagerID="ScriptManager1"runat="server"/><div><atlas:UpdatePanelID="UpdatePanel1"runat="server"Mode="Conditional"><ContentTemplate><asp:WizardID="Wizard1"runat="server"><WizardSteps><asp:WizardSteprunat="server"Title="Step 1"></asp:WizardStep><asp:WizardSteprunat="server"Title="Step 2"></asp:WizardStep></WizardSteps></asp:Wizard></ContentTemplate></atlas:UpdatePanel>

Hi,

it seems that you are not setting EnablePartialRendering="True" in the ScriptManager control.

Yes you are right. In the sample code I pasted that was the problem (and I feel very stupid). However in my actual code I did remember to set partial rendering to true.

Now, that being said, I think I figured out what was wrong, and hopefully the Atlas guys watching this forum can tell us if I am correct.

A little more background on the page first, it is a content page and the master page has a flash banner on it that I put their using the asp.net 2.0 flash control. On my developoment machine I didn't have the flash file it was pointing to. Instead of throwing an exception when I view the page in my browser it just kept perpetually loading the page.

It occured to me that the update panel may not work properly if the page had never completed loading before a postback was called. All I had to do was copy the flash file from the webserver to my development system and VOILA! The page loads, the update panel works.


Hi,

glad to hear that you solved it :) I'll bookmark this post for future reference.

Wizard with Update Panel

I have a Wizard control with inupdatepanel . I am trying to create dynamic wizard steps in pagepre_init event, but it is giving me an error " object reference not setto an instance of an object" . without updatepanel it's workingproperly.

Thanks in Advance

Do you have a fileupload control in the wizard? If so,see this thread.

hello.

please post a simple page that reproduces this problem.

working with dataset using asp.net ajax 1.0

I have a web service which is returning a dataset ... this dataset will be bound to a data grid inside an update panel.

How can I get that dataset to the data grid IF the web service is being called via java script ?

Am trying to avoid getting back XML as that would mean a lot of DOM parsing and I dont want to use the DOM structure unless abs necessary ?

If the webservice is being called using javascript, I assume it is on the clientside.

But the binding to the data grid will have to be done on the server.

One way to go is to call the webservice on the server and bind the returned dataset to the datagrid.


Hi,

Maybe this article is helpful to you:http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx

Best Regards

Wrapper control for Slider Extender and Properties

I've written a control and that inherits from Panel and ITextControl. In CreateChildControls I create a table containing a text box and label, then I create the slider extender and properties pointing to the appropriate controls. The control loads properly (visually), but when I click the slider I get a series of javascript errors (Invalid Argument). If anyone has any suggestions they would be helpful.

Hi,

could you post the code that instantiates the slider extender?


/// <summary>
/// This web control class renders a Centralpoint console textbox.
/// </summary>
[ValidationProperty("Text")]
public class ConsoleSlider : Panel, ITextControl
{
private TextBox tbxSlider = null;
private Label lblTarget = null;
private SliderExtender seExtender = null;
private SliderProperties seProperties = null;

public ConsoleSlider() : base()
{
}

/// <summary>
/// This method is overridden to create the child controls of the console editor.
/// </summary>
protected override void CreateChildControls()
{
base.CreateChildControls();

HtmlTable table = new HtmlTable();
this.Controls.Add(table);

HtmlTableRow row = new HtmlTableRow();
table.Rows.Add(row);

HtmlTableCell left = new HtmlTableCell();
row.Cells.Add(left);

HtmlTableCell right = new HtmlTableCell();
row.Cells.Add(right);

tbxSlider = new TextBox();
tbxSlider.ID = this.ID + "_Slider";
left.Controls.Add(tbxSlider);

lblTarget = new Label();
lblTarget.ID = this.ID + "_Target";
right.Controls.Add(lblTarget);

seExtender = new SliderExtender();
seExtender.ID = this.ID + "_Extender";

seProperties = new SliderProperties();
seProperties.ID = this.ID + "_Properties";
seProperties.Minimum = 0;
seProperties.Maximum = 100;
seProperties.Steps = 1;
seProperties.Length = 300;
seProperties.EnableHandleAnimation = true;
seProperties.Orientation = SliderOrientation.Horizontal;

seProperties.TargetControlID = tbxSlider.ID;
seProperties.BoundControlID = lblTarget.ClientID;
seExtender.TargetProperties.Add(seProperties);

this.Controls.Add(seExtender);
}

/// <summary>
/// Gets or sets the control text.
/// </summary>
public string Text
{
get { this.EnsureChildControls(); return lblTarget.Text; }
set { this.EnsureChildControls(); lblTarget.Text = value; }
}
}


Hi,

mkerchenski:

seProperties.Steps = 1;

the problem is in the above statement, since it has no sense to set 1 step (it means 1 possible value, so there would be no need for a slider).

However, this is a "pathological" case that causes a bug since the slider extender is not able to handle this situation at the moment. I'll make sure to fix this for the next release.

Since the number of steps is the number of possible values, try to set steps > 1 and let me know if it solves the problem.

You can found a related threadhere.


I've tried a few different values for the Steps property and it doesn't seem to make any difference at all. If you disable script debugging (in IE) the control doesn't slide, and if you enable script debugging you get the error described initially. In the firefox javascript console I get the following errors:
Error: Found unclosed string '"'. Selector expected. Ruleset ignored due to bad selector.
Error: Unexpected end of file while searching for closing } of invalid rule set.
I'm not entirely sure they're related, but they're not there when the slider is not present.

Wednesday, March 21, 2012

wysiwyg in atlas

Has anyone found a wysiwyg editor that will work inside an update panel yet?The FCKEditor (http://www.fckeditor.net/) seems to work. Though its not the fastest loading.

newbie2006:

The FCKEditor (http://www.fckeditor.net/) seems to work. Though its not the fastest loading.

Hy!

I'm developing an Chat engine based on Atlas and I'm using FCK editor. I can't change the properties of FCKeditor inside the UpdatePanel. I want to clean the Message after Send Button Click. The code is the follow:

protected void Send_Click(object sender, EventArgs e){// Update Chat Panel ... //Clean up the editor FCKeditor1.Value ="";}

And the code in the ASPX is:

<atlas:UpdatePanelID="panelMessage"runat="server"Mode="Conditional"><ContentTemplate><FCKeditorV2:FCKeditorid="FCKeditor1"runat="server"/><asp:ButtonID="Send"runat="server"Text="Send"OnClick="Send_Click"/></ContentTemplate></atlas:UpdatePanel>


When I press the Send button the message is updated in the Chat, but the message from the editor don't desapear, only when I refresh the browser.

Anyone know one solution for this?

Thanks.

Paulo Alves.


Now I find the solution. First there is some incompatibilty with my CSS and the Atlas JS, so I replace with Server Side Label. The other was the property of UpdatePanel="Conditional", where I need to put an triger to work:

<atlas:UpdatePanel runat="server" ID="UpdatePanelMsg" Mode="Conditional"><Triggers> <atlas:ControlEventTrigger ControlID="Send" EventName="Click" /></Triggers><ContentTemplate><FCKeditorV2:FCKeditor id="FCKeditor1" runat="server" /></ContentTemplate></atlas:UpdatePanel> <asp:Button ID="Send" runat="server" Text="Send" OnClick="Send_Click" CausesValidation="False" />

The Mode="always" is not a good option because it post the UpdatePanel every 2 sec fired by Triger of Chat panel refresh.

The FCK is a little bit slow for this purpose, I' m tring to find another option like the FreeTextBox or just a TextArea.

Best regards,

Paulo Alves.



Hellow.,

Sorry for direct contact.But i want to ask u a query .Its argent to be in work.My task is

Test and evaluate the FCKeditor.NET control.(FCKEditor in SketchControl).

But i not understand why FCK editor require.Still i try 1 example send u code -->

<%@. Page Language="C#" AutoEventWireup="false" ValidateRequest="false" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@. Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>

<html>

<head>

<title>FCKeditor - Sample</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>

<body>

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

<FCKeditorV2:FCKeditor id="FCKeditor1" BasePath="/FCKeditor/" runat="server"></FCKeditorV2:FCKeditor>

<br>

<input id="Submit1" type="submit" value="Submit" runat="server">

</form>

</body>

</html>

But Give error like->server error HTTP Error 404 - Not Found.
pls tell what to do ...